erb: Protection Mechanism Failure
CVE-2026-41316 is a high-severity protection mechanism failure vulnerability in erb from Ruby, with a CVSS 3.1 base score of 8.1 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected erb versions: < 4.0.3.1; = 4.0.4; >= 5.0.0, < 6.0.1.1, and others listed below. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.13% chance of exploitation within 30 days, higher than 67% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of erb you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- HighSuccess depends on conditions outside the attacker's control.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by CNA (github.com).
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.1 | High | CNA (github.com) |
| CVSS 3.1 | 8.1 | High | CNA |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Protection Mechanism Failure
The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Other references
- access.redhat.com/errata/RHSA-2026:18030
- access.redhat.com/errata/RHSA-2026:18039
- access.redhat.com/errata/RHSA-2026:18065
- access.redhat.com/errata/RHSA-2026:20596
- access.redhat.com/errata/RHSA-2026:20606
- access.redhat.com/errata/RHSA-2026:20614
- access.redhat.com/errata/RHSA-2026:20670
- access.redhat.com/errata/RHSA-2026:26312
- access.redhat.com/errata/RHSA-2026:26655
- access.redhat.com/errata/RHSA-2026:33462
- access.redhat.com/errata/RHSA-2026:33478
- access.redhat.com/errata/RHSA-2026:35834
- access.redhat.com/errata/RHSA-2026:37238
- access.redhat.com/security/cve/CVE-2026-41316
- bugzilla.redhat.com/show_bug.cgi?id=2461369
Recent Protection Mechanism Failure vulnerabilities
- 7.5 High severity
- 9.8 Critical severity
- 8.8 High severity
- 4.3 Medium severity
- 10.0 Critical severity
- 10.0 Critical severity
Spotted an error? Tell us.