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: 2026-04-23 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2026-41316 is rated Moderate Risk (46.5/100): CVSS High severity, with low exploitation likelihood (EPSS 0.51%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2026-41316

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.04% 0.51% +0.46%
2 2026-05-22 0.08% 0.04% -0.04%
3 2026-04-24 0.08%

Full EPSS history (3 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2026-41316

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.1 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.2 5.9 [email protected]

Weakness enumeration for CVE-2026-41316

GitHub Security Advisory for CVE-2026-41316

GHSA-q339-8rmv-2mhv · Severity: high · Ecosystem: rubygems — ERB has an @_init deserialization guard bypass via def_module / def_method / def_class

OS Trackers for CVE-2026-41316

vendor priority summary link
debian not yet assigned CVE-2026-41316 not yet assigned priority: Debian including 3 source packages (ruby2.7, ruby3.1, ruby3.3), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): open 5. https://security-tracker.debian.org/tracker/CVE-2026-41316
redhat high https://access.redhat.com/security/cve/CVE-2026-41316
suse high CVE-2026-41316 severity important: SUSE including 6 source package names (libruby4_0-4_0-4.0.3-1.1, ruby4.0-4.0.3-1.1, ruby4.0-devel-4.0.3-1.1, ruby4.0-devel-extra-4.0.3-1.1, ruby4.0-doc-4.0.3-1.1, ruby4.0-doc-ri-4.0.3-1.1), 6 product×package rows across 1 product lines (openSUSE Tumbleweed): Fixed 6. https://www.suse.com/security/cve/CVE-2026-41316/
ubuntu medium CVE-2026-41316 medium priority: Ubuntu including 7 source packages (jruby, ruby2.3, …), 42 status rows across 9 suites (bionic, focal, jammy, noble, questing, resolute, trusty, upstream, xenial): DNE 21, needs-triage 21. https://ubuntu.com/security/CVE-2026-41316

Affected software / configurations for CVE-2026-41316

Vendor Product Version Raw CPE
No affected products in dataset.

References for CVE-2026-41316

cvelogic Threat Intelligence