Skip to main content
No exploitation reportedFix available

CVE-2026-41316

No exploitation reported by the sources we read.

  • Published2026-04-24
  • Fixed in6.0.4 · 6.0.1.1 · 4.0.4.1 · 4.0.3.1
  • WeaknessCWE-502 · CWE-693

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2026-04-2403:16CVE publishedNVD

Observed activity

isMalicious corpus · updated 2026-10-23 21:37 UTC
Indicators tagged with this CVE, per day0 indicators over 7 days
Block these indicators
  • Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2026-41316?format=txt
  • CSV export: https://api.ismalicious.com/edl/cve/CVE-2026-41316?format=csv
  • TAXII collection of exploited CVEs
  • The EDL and CSV take an API key on the Pro plan.

Versions per branch

OSV
erb
BranchAffectedFixed in
6.0≥ 6.0.2, < 6.0.46.0.4
6.0≥ 5.0.0, < 6.0.1.16.0.1.1
4.0≥ 4.0.4, < 4.0.4.14.0.4.1
4.0< 4.0.3.14.0.3.1

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • rubyAlmaLinux:9all versions · fixed in 3.0.7-166.el9_7and 4 other packages
  • rubyAlmaLinux:9all versions · fixed in 3.3.10-6.module_el9.7.0+245+447713a2and 5 other packages
  • rubyAlmaLinux:9all versions · fixed in 4.0.3-32.module_el9.8.0+251+5fdbd96band 5 other packages
  • rubyAlmaLinux:8all versions · fixed in 3.3.10-6.module_el8.10.0+4183+69a3c42fand 5 other packages
  • ruby-docAlmaLinux:10all versions · fixed in 3.3.10-12.el10_1and 1 other package
  • ruby4.0AlmaLinux:10all versions · fixed in 4.0.3-34.el10_2and 2 other packages
  • ruby4.0-rubygem-mysql2AlmaLinux:10all versions · fixed in 0.5.7-34.el10_2
  • ruby4.0-rubygem-pgAlmaLinux:10all versions · fixed in 1.6.3-34.el10_2

84 more package ranges on OSV.dev

Full record on NVD

Fix

  1. Update erb to 6.0.4 · 6.0.1.1 · 4.0.4.1 · 4.0.3.1

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof-of-concept repositories
none listed
PoC-in-GitHub

Sources

  • NVDCVE recordread 2026-10-23
  • CISA-ADPSSVC decisionnone2026-04-25
  • OpenCVESSVC decisionnone—
  • CNACVSS 3.18.1read 2026-10-23
  • CNAweakness (CWE)CWE-502, CWE-693read 2026-10-23
  • FIRST EPSSEPSS score1.3 %2026-10-22
  • OSVaffected packages—

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Published
2026-04-24
Last Modified
2026-08-24
NVD status
Deferred

Frequently asked questions

What is CVE-2026-41316?

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.

Is CVE-2026-41316 actively exploited?

Active exploitation of CVE-2026-41316 has not been confirmed. Its EPSS score was 1.3% on 2026-10-22, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2026-41316?

CVE-2026-41316 has a CVSS v3 base score of 8.1 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.

Running erb? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month