Skip to content
Threat Brief

← All advisories

CVE-2026-41316

High 8.1No known exploitationFix available

ERB has an @_init deserialization guard bypass via def_module / def_method / def_class

Vendor advisory: GHSA-q339-8rmv-2mhv

Record last updated

CVSS score

8.1

High on a 0 to 10 scale

EPSS, chance of exploitation in 30 days

1.1%

Higher than 68% of scored CVEs. A prediction, not evidence.

CISA remediation deadline

None

Not in the KEV catalog

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.

Weakness: CWE-693

Patching and mitigation

Patch status
Fix available (source: GitHub Advisory Database)
Fix documented (source date)
Mitigation
None documented
Vendor guidance
access.redhat.com (opens in a new tab)

Affected products

VendorProductAffected versionsFixed inPer
rubyerb< 4.0.3.1Not documentedCVE Program
rubyerb= 4.0.4Not documentedCVE Program
rubyerb>= 5.0.0, < 6.0.1.1Not documentedCVE Program
rubyerb>= 6.0.2, < 6.0.4Not documentedCVE Program
rubygemserbfrom 5.0.0 before 6.0.1.16.0.1.1GitHub Advisory Database
rubygemserbfrom 6.0.2 before 6.0.46.0.4GitHub Advisory Database
rubygemserb4.0.44.0.4.1GitHub Advisory Database
rubygemserball versions before 4.0.3.14.0.3.1GitHub Advisory Database

Timeline

  1. Disclosure

    CVE record published by GitHub_M

    Source: CVE Program (opens in a new tab)

  2. Patch

    Fix documented by GitHub Advisory Database

    Source: GitHub Advisory Database (opens in a new tab)

Vendor guidance and references