{"cve":"CVE-2026-41316","nvd":{"published":"2026-04-24T03:16:11.897","modified":"2026-10-26T22:10:00.163","status":"Deferred","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`, `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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1},"cwes":["CWE-693","CWE-502"],"references":["https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv","https://access.redhat.com/errata/RHSA-2026:18030","https://access.redhat.com/errata/RHSA-2026:18039","https://access.redhat.com/errata/RHSA-2026:18065","https://access.redhat.com/errata/RHSA-2026:20596"],"products":[],"source":"nvd","synced_at":"2026-10-26T22:26:44.656832877+00:00"},"epss":{"cve":"CVE-2026-41316","score":0.01131,"percentile":0.66194,"date":"2026-10-26"},"kev":null,"osv":[{"id":"GHSA-q339-8rmv-2mhv","url":"https://osv.dev/vulnerability/GHSA-q339-8rmv-2mhv","summary":"ERB has an @_init deserialization guard bypass via def_module / def_method / def_class","modified":"2026-09-10T03:51:02.746201088Z","packages":[{"ecosystem":"RubyGems","name":"erb","purl":"pkg:gem/erb","ranges":["<4.0.3.1"],"fixed":["4.0.3.1"]},{"ecosystem":"RubyGems","name":"erb","purl":"pkg:gem/erb","ranges":[">=4.0.4 <4.0.4.1"],"fixed":["4.0.4.1"]},{"ecosystem":"RubyGems","name":"erb","purl":"pkg:gem/erb","ranges":[">=5.0.0 <6.0.1.1"],"fixed":["6.0.1.1"]},{"ecosystem":"RubyGems","name":"erb","purl":"pkg:gem/erb","ranges":[">=6.0.2 <6.0.4"],"fixed":["6.0.4"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}