Home / ruby / erb / CVE-2026-41316
CVE-2026-41316: is it exploited, and which versions of ruby erb are affected and fixed?
CVE-2026-41316 is a protection mechanism failure vulnerability in ruby erb. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 11:08 UTC). Affected: erb before 4.0.3.1, erb from 4.0.4 before 4.0.4.1, erb from 5.0.0 before 6.0.1.1 and 1 more (GitHub advisory GHSA-q339-8rmv-2mhv). Fixed in 4.0.3.1, 4.0.4.1, 6.0.1.1 and 6.0.4 (GitHub advisory GHSA-q339-8rmv-2mhv). Severity: High (8.1, CVSS 3.1, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 11:08 UTC, CVE record November 19, 2026, 07:07 UTC and NVD November 19, 2026, 07:11 UTC.
What is 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.
From the CVE record by GitHub_M, last updated August 24, 2026, 12:06 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| ruby | erb | < 4.0.3.1 = 4.0.4 >= 5.0.0, < 6.0.1.1 >= 6.0.2, < 6.0.4 |
As the CVE record by GitHub_M states it, last updated August 24, 2026. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| RubyGems | erb | < 4.0.3.1 | 4.0.3.1 | GHSA-q339-8rmv-2mhv |
| RubyGems | erb | >= 4.0.4, < 4.0.4.1 | 4.0.4.1 | GHSA-q339-8rmv-2mhv |
| RubyGems | erb | >= 5.0.0, < 6.0.1.1 | 6.0.1.1 | GHSA-q339-8rmv-2mhv |
| RubyGems | erb | >= 6.0.2, < 6.0.4 | 6.0.4 | GHSA-q339-8rmv-2mhv |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated November 17, 2026. Summary: ERB has an @_init deserialization guard bypass via def_module / def_method / def_class.
How severe is CVE-2026-41316?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 8.1 | CVSS 3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H | GitHub_M |
| High 8.1 | CVSS 3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H | redhat-SADP |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2026-41316 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: none; automatable: no; technical impact: total (CISA ADP, April 25, 2026)
- EPSS
- 1.15% probability of exploitation activity in the next 30 days, percentile 67.8 (FIRST EPSS, scores of December 2, 2026)
What kind of flaw is it?
Where are the vendor advisories and references?
- https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv x_refsource_CONFIRM
- https://access.redhat.com/security/cve/CVE-2026-41316 vdb-entry, x_refsource_REDHAT
- RHBZ#2461369 issue-tracking, x_refsource_REDHAT
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json x_sadp-csaf-vex
- https://access.redhat.com/errata/RHSA-2026:33478 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:18065 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20606 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20614 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20670 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:35834 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:26312 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:26655 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:33462 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:37238 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:18039 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:18030 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20596 vendor-advisory, x_refsource_REDHAT
When was it published, and where is the official record?
- Reserved
- April 20, 2026
- Published
- April 24, 2026, 02:35 UTC
- CVE record updated
- August 24, 2026, 12:06 UTC by GitHub_M
- NVD
- Deferred, last modified October 26, 2026, 22:10 UTC
- Last checked
- CVE list November 19, 2026, 07:07 UTC; NVD November 19, 2026, 07:11 UTC; KEV December 3, 2026, 11:08 UTC; EPSS December 2, 2026
- Official record
- cve.org · NVD
Questions about CVE-2026-41316
Is CVE-2026-41316 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 11:08 UTC. FIRST's EPSS gives it a 1.15% chance of exploitation activity in the next 30 days (scores of December 2, 2026).
Which versions of ruby erb are affected by CVE-2026-41316?
erb before 4.0.3.1, erb from 4.0.4 before 4.0.4.1, erb from 5.0.0 before 6.0.1.1 and erb from 6.0.2 before 6.0.4, per the GitHub advisory GHSA-q339-8rmv-2mhv. The tables above give every range the sources list.
Which version fixes CVE-2026-41316?
4.0.3.1, 4.0.4.1, 6.0.1.1 and 6.0.4, per the GitHub advisory GHSA-q339-8rmv-2mhv. Check the vendor's advisory before you rely on it.
How severe is CVE-2026-41316?
High (8.1, CVSS 3.1, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2026-41316?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.