CVE-2026-41316: ruby erb · Protection Mechanism Failure
Affects ruby erbSource CVE Database V5
Not known to be exploited · CVSS 8.1 High · fixed in 6.0.4 : patch ruby erb soon.
Data as of 30 Oct 2026, 11:52 UTC
- EPSS
- 1.1% chance of exploitation in 30 days – higher than 66% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 6.0.4, 6.0.1.1, 4.0.3.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 24 Apr 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.
What to do
Upgrade erb to 6.0.4, 6.0.1.1 or 4.0.3.1; erb to 4.0.3.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| rubyerb | Affected
| Fixed in
|
RubyGemserbpkg:gem/erbOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available and should be applied by upgrading to patched versions of ERB (4.0.3.1, 4.0.4.1, 6.0.1.1, or 6.0.4) or the corresponding Ruby packages provided by vendors such as Red Hat. Red Hat has released security updates for affected Enterprise Linux versions and recommends applying these updates promptly. If upgrading is not immediately possible, avoid deserializing untrusted data with Marshal.load in applications using ERB. Follow vendor advisories for detailed update instructions.
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.
References
- github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv (opens in a new tab)
- access.redhat.com/security/cve/CVE-2026-41316 (opens in a new tab)
- bugzilla.redhat.com/show_bug.cgi?id=2461369 (opens in a new tab)
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:33478 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:18065 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:20606 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:20614 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:20670 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:35834 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:26312 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:26655 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:33462 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:37238 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:18039 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:18030 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:20596 (opens in a new tab)