CVE-2026-41316
CVE-2026-41316 — ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
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 Updated Sources: cvelistV5, GitHub_M
Triage
Is it exploited, how likely is exploitation, what does it touch, and how severe do the scoring sources call it.
Exploitation
Unreported
no source claims exploitation
EPSS
1%
chance of exploitation in 30 days
CVSS base
8.1
HIGH
CISA SSVC assessment
Three decision points CISA publishes for the CVEs it assesses · SSVC 2.0.3. A stakeholder decision, not a severity score.
Exploitation
None
none · proof-of-concept · active
Automatable
No
can an attacker script all four kill-chain steps
Technical impact
Total
partial · total control of the vulnerable component
Affected scope
The catalog records vendors and products as separate lists, not pairs, so which product belongs to which vendor is not something this page can say.
Products (13)
Every base score collected
Sources score independently and disagree; each row says who scored it and under which version.
| Score | Version | Severity | Expl. | Impact | Source |
|---|---|---|---|---|---|
| 8.1 | CVSS 3.1 | HIGH | — | — | cvelistV5 |
Weakness & attack patterns
- CWE-693
- CWE-502
Attack patterns reported against this CVE. The ATT&CK techniques below are inferred from its weakness class.
- T1574.010Hijack Execution Flow: ServicesFile Permissions Weakness
- T1083File and Directory Discovery
- T1574.005Hijack Execution Flow: Executable Installer File Permissions Weakness
References
17 on the record
- github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv
x_refsource_CONFIRM
- access.redhat.com/security/cve/CVE-2026-41316
vdb-entry, x_refsource_REDHAT
- bugzilla.redhat.com/show_bug.cgi?id=2461369
issue-tracking, x_refsource_REDHAT
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json
x_sadp-csaf-vex
- access.redhat.com/errata/RHSA-2026:33478
vendor-advisory, x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:18065
vendor-advisory, x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:20606
vendor-advisory, x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:20614
vendor-advisory, x_refsource_REDHAT
Elsewhere on this site
Not in any source we poll
Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.
- No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
- No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
- No exploit packet captures, log samples, or incident case IDs supplied.