{"id":"DHI-pwnh-u2v3-tpfm-s4dr","summary":"ERB is a templating system for Ruby. Ruby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an `@_init`…","details":"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.","modified":"2026-11-20T14:45:42.996676900Z","published":"2026-11-11T16:59:50Z","upstream":["CVE-2026-41316"],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-pwnh-u2v3-tpfm-s4dr"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41316"},{"type":"ADVISORY","url":"https://errata.almalinux.org/9/ALSA-2026-18030.html"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:18030"},{"type":"ADVISORY","url":"https://errata.almalinux.org/9/ALSA-2026-18039.html"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:18039"},{"type":"ADVISORY","url":"https://errata.almalinux.org/9/ALSA-2026-20596.html"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:20596"},{"type":"ADVISORY","url":"https://errata.almalinux.org/8/ALSA-2026-20614.html"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:20614"},{"type":"ADVISORY","url":"https://security.alpinelinux.org/vuln/CVE-2026-41316"},{"type":"ADVISORY","url":"https://alas.aws.amazon.com/AL2/ALAS-2026-3284.html"},{"type":"ADVISORY","url":"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-41316"},{"type":"ADVISORY","url":"https://alas.aws.amazon.com/AL2023/ALAS-2026-1690.html"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-41316"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-q339-8rmv-2mhv"},{"type":"ADVISORY","url":"https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv"},{"type":"ADVISORY","url":"https://access.redhat.com/security/cve/CVE-2026-41316"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:37238"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:35834"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:33478"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:33462"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:26655"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:26312"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:20670"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:20606"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:18065"},{"type":"FIX","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/erb/CVE-2026-41316.yml"},{"type":"FIX","url":"https://github.com/ruby/erb/commit/ef61b591b270f8ba58d47f12472a1c53a77b4d61"},{"type":"FIX","url":"https://github.com/ruby/erb/commit/dd34ce41031327269a5fb83b0bc2c0d852895e9f"},{"type":"FIX","url":"https://github.com/ruby/erb/commit/c3b721f7f7570c23e3423590af0419c1b10e1255"},{"type":"FIX","url":"https://github.com/ruby/erb/commit/9d017be4e375cdd058650ce528ee6adfead20cac"},{"type":"ADVISORY","url":"https://linux.oracle.com/cve/ELSA-2026-18030.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/errata/ELSA-2026-18030.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/cve/ELSA-2026-18039.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/errata/ELSA-2026-18039.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/cve/ELSA-2026-18065.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/errata/ELSA-2026-18065.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/cve/ELSA-2026-20596.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/errata/ELSA-2026-20596.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/cve/ELSA-2026-20606.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/errata/ELSA-2026-20606.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/cve/ELSA-2026-20614.html"},{"type":"ADVISORY","url":"https://linux.oracle.com/errata/ELSA-2026-20614.html"},{"type":"ADVISORY","url":"https://www.cve.org/CVERecord?id=CVE-2026-41316"},{"type":"ADVISORY","url":"https://errata.rockylinux.org/RLSA-2026:18030"},{"type":"ADVISORY","url":"https://errata.rockylinux.org/RLSA-2026:18039"},{"type":"ADVISORY","url":"https://errata.rockylinux.org/RLSA-2026:18065"},{"type":"ADVISORY","url":"https://errata.rockylinux.org/RLSA-2026:20596"},{"type":"ADVISORY","url":"https://errata.rockylinux.org/RLSA-2026:20606"},{"type":"ADVISORY","url":"https://errata.rockylinux.org/RLSA-2026:20614"},{"type":"ADVISORY","url":"https://ubuntu.com/security/CVE-2026-41316"},{"type":"ADVISORY","url":"http://people.ubuntu.com/~ubuntu-security/cve/CVE-2026-41316"}],"affected":[{"package":{"name":"ruby-3.2","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/ruby-3.2"},"versions":["3.2.10-r0","3.2.10-r1","3.2.11-r1","3.2.11-r2","3.2.11-r3"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-pwnh-u2v3-tpfm-s4dr.json"}},{"package":{"name":"ruby-3.2","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/ruby-3.2"},"versions":["3.2.11-r1","3.2.11-r2","3.2.11-r3"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-pwnh-u2v3-tpfm-s4dr.json"}},{"package":{"name":"ruby-3.3","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/ruby-3.3"},"versions":["3.3.10-r0","3.3.10-r1","3.3.11-r1","3.3.11-r2","3.3.11-r3","3.3.12-r3","3.3.13-r3","3.3.14-r3","3.3.14-r4"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-pwnh-u2v3-tpfm-s4dr.json"}},{"package":{"name":"ruby-3.4","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/ruby-3.4"},"versions":["3.4.10-r2","3.4.10-r3","3.4.11-r3","3.4.12-r3","3.4.13-r3","3.4.13-r4","3.4.8-r0","3.4.8-r1","3.4.9-r1","3.4.9-r2"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-pwnh-u2v3-tpfm-s4dr.json","owner_kind":"HSP"}},{"package":{"name":"ruby-4.0","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/ruby-4.0"},"versions":["4.0.1-r0","4.0.1-r1","4.0.10-r4","4.0.10-r5","4.0.2-r1","4.0.2-r2","4.0.3-r2","4.0.4-r2","4.0.4-r3","4.0.5-r3","4.0.6-r3","4.0.6-r4","4.0.7-r4","4.0.9-r4"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-pwnh-u2v3-tpfm-s4dr.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}