Skip to main content
VulnerabilityPublished Updated

CVE-2026-41316: ruby erb · Protection Mechanism Failure

Affects ruby erbSource CVE Database V5

0
Compare

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

CVSS 3.1 base score
8.1High
How severe the flaw is on the 0–10 CVSS scale.
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:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 24 Apr 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
rubyerbAffected
  • <4.0.3.1
  • >=5.0.0 <6.0.1.1
  • >=6.0.2 <6.0.4
  • =4.0.4
Fixed in
  • 6.0.4
  • 6.0.1.1
  • 4.0.3.1
RubyGemserbpkg:gem/erbOther threatsAffected
  • <4.0.3.1
  • =4.0.4
Fixed in
  • 4.0.3.1

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

Community reviews

Loading reviews…