{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-41316","id":"CVE-2026-41316","title":"ERB has an @_init deserialization guard bypass via def_module / def_method / def_class","description":"ERB is a templating system for Ruby. Ruby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an `@_init` instance variable guard in `ERB#result` and `ERB#run` to prevent code execution when an ERB object is reconstructed via `Marshal.load` (deserialization). However, three other public methods that also evaluate `@src` via `eval()` were not given the same guard: `ERB#def_method`, `E","descriptionLong":"ERB is a templating system for Ruby. Ruby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an `@_init` instance variable guard in `ERB#result` and `ERB#run` to prevent code execution when an ERB object is reconstructed via `Marshal.load` (deserialization). However, three other public methods that also evaluate `@src` via `eval()` were not given the same guard: `ERB#def_method`, `ERB#def_module`, and `ERB#def_class`. An attacker who can trigger `Marshal.load` on untrusted data in a Ruby application that has `erb` loaded can use `ERB#def_module` (zero-arg, default parameters) as a code execution sink, bypassing the `@_init` protection entirely. ERB 4.0.3.1, 4.0.4.1, 6.0.1.1, and 6.0.4 patch the issue.","published":"2026-04-24T02:35:41.160Z","updated":"2026-10-28T02:30:29.400894775Z","reserved":"2026-04-20T14:01:46.671Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"github.com"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"0b0ca135-0b70-47e7-9f44-1890c2a1c46c"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"redhat-SADP"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub"}],"rating":"high","products":["ruby erb"],"affectedProducts":[{"vendor":"ruby","product":"erb","defaultStatus":null,"versions":[{"version":"< 4.0.3.1","status":"affected"},{"version":"= 4.0.4","status":"affected"},{"version":">= 5.0.0, < 6.0.1.1","status":"affected"},{"version":">= 6.0.2, < 6.0.4","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"RubyGems","name":"erb","purl":"pkg:gem/erb","ranges":["<4.0.3.1",">=4.0.4 <4.0.4.1",">=5.0.0 <6.0.1.1",">=6.0.2 <6.0.4"],"fixed":["4.0.3.1","4.0.4.1","6.0.1.1","6.0.4"],"advisory":"GHSA-q339-8rmv-2mhv"}],"cwes":["CWE-693","CWE-502"],"aliases":["GHSA-q339-8rmv-2mhv"],"references":[{"url":"https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-41316","tags":["vdb-entry","x_refsource_REDHAT","advisory","web"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2461369","tags":["issue-tracking","x_refsource_REDHAT","report","web"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json","tags":["x_sadp-csaf-vex","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:33478","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:18065","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:20606","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:20614","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:20670","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:35834","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26312","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26655","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:33462","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:37238","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:18039","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:18030","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:20596","tags":["vendor-advisory","x_refsource_REDHAT","advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41316.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41316","tags":["advisory"]},{"url":"https://github.com/ruby/erb/commit/ef61b591b270f8ba58d47f12472a1c53a77b4d61","tags":["web"]},{"url":"https://github.com/ruby/erb/commit/dd34ce41031327269a5fb83b0bc2c0d852895e9f","tags":["web"]},{"url":"https://github.com/ruby/erb/commit/c3b721f7f7570c23e3423590af0419c1b10e1255","tags":["web"]},{"url":"https://github.com/ruby/erb/commit/9d017be4e375cdd058650ce528ee6adfead20cac","tags":["web"]},{"url":"https://www.ruby-lang.org/en/news/2026/04/21/erb-cve-2026-41316","tags":["web"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/erb/CVE-2026-41316.yml","tags":["web"]},{"url":"https://github.com/ruby/erb","tags":["package"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.01131,"epssPercentile":0.67061,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-41316","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41316","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-41316","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-q339-8rmv-2mhv","ok":true,"note":"GHSA-q339-8rmv-2mhv"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-41316","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}