CVE-2026-41316
Security update for ruby2.5
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.
Metrics
Weakness classes (CWE)
CWE-693Pillar
Protection Mechanism Failure
The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
cwe.mitre.org →
Reanalysis & status changes
Chronological NVD audit events for this CVE — reanalyses, CVSS updates, CPE diffs.
- CVE Modified2026-08-24 13:18 UTC· 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
- Affected: Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10.0 Extended Update Support (+17) → Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10.0 Extended Update Support (+17)
- CVE Modified2026-08-05 13:22 UTC· 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
- Affected: Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10.0 Extended Update Support (+17) → Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 10.0 Extended Update Support (+17)
- CVE Modified2026-07-06 13:16 UTC· 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
- Reference: https://access.redhat.com/errata/RHSA-2026:35834
- Affected: Red Hat Enterprise Linux AppStream EUS (v. 10.0), Red Hat Enterprise Linux AppStream (v. 10), Red Hat Enterprise Linux AppStream (v. 8) (+13) → Red Hat Enterprise Linux AppStream EUS (v. 10.0), Red Hat Enterprise Linux AppStream (v. 10), Red Hat Enterprise Linux AppStream (v. 8) (+14)
Affected products
Products and version ranges extracted from the vendor/CERT advisory. A range like „<4.14.6“ implies the update recommendation „upgrade to 4.14.6 or later“.
rubygems
erb2.2.0
rubygems
erb2.2.1
rubygems
erb2.2.2
rubygems
erb2.2.3
rubygems
erb3.0.0
rubygems
erb4.0.0
rubygems
erb4.0.1
rubygems
erb4.0.2
rubygems
erb4.0.3
rubygems
erb4.0.4
rubygems
erb5.0.0
rubygems
erb5.0.1
rubygems
erb5.0.2
rubygems
erb5.0.3
rubygems
erb5.1.0
rubygems
erb5.1.1
rubygems
erb5.1.2
rubygems
erb5.1.3
rubygems
erb6.0.0
rubygems
erb6.0.1
rubygems
erb6.0.2
rubygems
erb6.0.3
References & sources
- https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhvweb
- https://nvd.nist.gov/vuln/detail/CVE-2026-41316advisory
- https://github.com/ruby/erbpackage
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/erb/CVE-2026-41316.ymlweb
- https://access.redhat.com/security/cve/CVE-2026-41316vdb-entryx_refsource_REDHAT
- https://bugzilla.redhat.com/show_bug.cgi?id=2461369issue-trackingx_refsource_REDHAT
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.jsonx_sadp-csaf-vex
- https://access.redhat.com/errata/RHSA-2026:33478vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:18065vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20606vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20614vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20670vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:35834vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:26312vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:26655vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:33462vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:37238vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:18039vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:18030vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:20596vendor-advisoryx_refsource_REDHAT