CVE-2026-41316

Source
https://cve.org/CVERecord?id=CVE-2026-41316
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-41316.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-41316
Aliases
Downstream
ALPINE (1)
ALSA (6)
BELL (1)
CGA (74)
CLEANSTART (3)
CLSA (2)
DEBIAN (1)
ECHO (1)
MINI (18)
OESA (1)
openSUSE (2)
RHSA (13)
RLSA (6)
ROOT (1)
SUSE (1)
UBUNTU (1)
Related
Published
2026-04-24T02:35:41Z
Modified
2026-10-28T02:30:29Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
Details

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.

Database specific
{
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
        "CWE-693"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41316.json"
}
References

Affected packages

Git / github.com/ruby/erb

Affected ranges

Type
GIT
Repo
https://github.com/ruby/erb
Events
Database specific
Show details
{
    "extracted_events": [
        {
            "range": [
                {
                    "introduced": "0"
                },
                {
                    "fixed": "4.0.3.1"
                }
            ],
            "source": "AFFECTED_FIELD",
            "strategy": "StringRangeExpression"
        },
        {
            "range": [
                {
                    "introduced": "5.0.0"
                },
                {
                    "fixed": "6.0.1.1"
                }
            ],
            "source": "AFFECTED_FIELD",
            "strategy": "StringRangeExpression"
        },
        {
            "range": [
                {
                    "introduced": "6.0.2"
                },
                {
                    "fixed": "6.0.4"
                }
            ],
            "source": "AFFECTED_FIELD",
            "strategy": "StringRangeExpression"
        },
        {
            "range": [
                {
                    "introduced": "= 4.0.4"
                },
                {
                    "last_affected": "= 4.0.4"
                }
            ],
            "source": "AFFECTED_FIELD",
            "strategy": "StandaloneSingleVersion"
        }
    ]
}

Affected versions

= 4.*
= 4.0.4
v2.*
v2.2.0
v2.2.1
v2.2.2
v2.2.3
v3.*
v3.0.0
v4.*
v4.0.0
v4.0.1
v4.0.2
v4.0.3
v4.0.4
v5.*
v5.0.0
v5.0.1
v5.0.2
v5.0.3
v5.1.0
v5.1.1
v5.1.2
v5.1.3
v6.*
v6.0.0
v6.0.1
v6.0.3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-41316.json"