
CVE catalog
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
- Severity
- High · CVSS 8.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Published
- Source
- [NVD] · [CVE record]
- EPSS
- 1.13% · Oct 25, 2026
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.
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | ruby3.1 | bookworm | 3.1.2-7+deb12u1 | vulnerable |
| Debian | ruby3.1 | bookworm-security | 3.1.2-7+deb12u1 | vulnerable |
| Cpe | ruby3.1 | Not reported | Not reported | vulnerable |
| Suse | ruby2.5 | linux enterprise module for basesystem 15 sp7 | 2.5.9-150700.24.11.1 | fixed |
| Opensuse | ruby4.0 | tumbleweed | 4.0.3-1.1 | fixed |
| Alpine | ruby | 3.21 | 3.3.13-r0 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | ruby3.1 | source | bookworm | (unfixed) | not yet assigned | Not reported | Not reported |
| Suse | ruby2.5 | rpm | linux enterprise module for basesystem 15 sp7 | 2.5.9-150700.24.11.1 | Not reported | SUSE-SU-2026:3556-1 | Not reported |
| Opensuse | ruby4.0 | rpm | tumbleweed | 4.0.3-1.1 | Not reported | OPENSUSE-SU-2026:10609-1 | Not reported |
| Alpine | ruby | apk | 3.21 | 3.3.13-r0 | Not reported | ALPINE-CVE-2026-41316 | Not reported |
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [libruby3.1]Affected
Source package: [ruby3.1]
Details (4)
3.1.2-7+deb12u1· amd64 · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· arm64 · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· amd64 · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· arm64 · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
- [ruby3.1]Affected
Details (4)
3.1.2-7+deb12u1· amd64 · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· arm64 · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· amd64 · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· arm64 · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
- [ruby3.1-dev]Affected
Source package: [ruby3.1]
Details (4)
3.1.2-7+deb12u1· amd64 · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· arm64 · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· amd64 · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· arm64 · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
- [ruby3.1-doc]Affected
Source package: [ruby3.1]
Details (4)
3.1.2-7+deb12u1· all · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· all · bookwormAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· all · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
3.1.2-7+deb12u1· all · bookworm-securityAffected
nvd · ruby3.1 · debian · bookworm; nvd · ruby3.1 · debian · 12
[Debian 13 (Trixie)]
- [libruby3.3]Affected
Source package: [ruby3.3]
Details (2)
3.3.8-2· amd64 · trixieAffected
nvd · ruby3.3 · debian · 13
3.3.8-2· arm64 · trixieAffected
nvd · ruby3.3 · debian · 13
- [ruby3.3]Affected
Details (2)
3.3.8-2· amd64 · trixieAffected
nvd · ruby3.3 · debian · 13
3.3.8-2· arm64 · trixieAffected
nvd · ruby3.3 · debian · 13
- [ruby3.3-dev]Affected
Source package: [ruby3.3]
Details (2)
3.3.8-2· amd64 · trixieAffected
nvd · ruby3.3 · debian · 13
3.3.8-2· arm64 · trixieAffected
nvd · ruby3.3 · debian · 13
- [ruby3.3-doc]Affected
Source package: [ruby3.3]
Details (2)
3.3.8-2· all · trixieAffected
nvd · ruby3.3 · debian · 13
3.3.8-2· all · trixieAffected
nvd · ruby3.3 · debian · 13
[openSUSE Tumbleweed]
- [libruby4_0-4_0]Unknown
Source package: [ruby4.0]
Details (1)
4.0.6-1.2· x86_64 · tumbleweedUnknown · Fixed:
4.0.3-1.1Version impact unknown
nvd · ruby4.0 · opensuse · tumbleweed
- [ruby4.0-devel]Unknown
Source package: [ruby4.0]
Details (1)
4.0.6-1.2· x86_64 · tumbleweedUnknown · Fixed:
4.0.3-1.1Version impact unknown
nvd · ruby4.0 · opensuse · tumbleweed
- [ruby4.0-devel-extra]Unknown
Source package: [ruby4.0]
Details (1)
4.0.6-1.2· x86_64 · tumbleweedUnknown · Fixed:
4.0.3-1.1Version impact unknown
nvd · ruby4.0 · opensuse · tumbleweed
- [ruby4.0-doc]Unknown
Source package: [ruby4.0]
Details (1)
4.0.6-1.2· x86_64 · tumbleweedUnknown · Fixed:
4.0.3-1.1Version impact unknown
nvd · ruby4.0 · opensuse · tumbleweed
- [ruby4.0-doc-ri]Unknown
Source package: [ruby4.0]
Details (1)
4.0.6-1.2· noarch · tumbleweedUnknown · Fixed:
4.0.3-1.1Version impact unknown
nvd · ruby4.0 · opensuse · tumbleweed
- [ruby4.0]Fixed
Source package: [ruby4.0]
Details (1)
4.0.6-1.2· x86_64 · tumbleweedFixed · Fixed:
4.0.3-1.1nvd · ruby4.0 · opensuse · tumbleweed
Observed:
References
- [https://access.redhat.com/errata/RHSA-2026:18030]
- [https://access.redhat.com/errata/RHSA-2026:18039]
- [https://access.redhat.com/errata/RHSA-2026:18065]
- [https://access.redhat.com/errata/RHSA-2026:20596]
- [https://access.redhat.com/errata/RHSA-2026:20606]
- [https://access.redhat.com/errata/RHSA-2026:20614]
- [https://access.redhat.com/errata/RHSA-2026:20670]
- [https://access.redhat.com/errata/RHSA-2026:26312]
- [https://access.redhat.com/errata/RHSA-2026:26655]
- [https://access.redhat.com/errata/RHSA-2026:33462]
- [https://access.redhat.com/errata/RHSA-2026:33478]
- [https://access.redhat.com/errata/RHSA-2026:35834]
- [https://access.redhat.com/errata/RHSA-2026:37238]
- [https://access.redhat.com/security/cve/CVE-2026-41316]
- [https://bugzilla.redhat.com/show_bug.cgi?id=2461369]
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2026_3556-1.json]
- [https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv]
- [https://nvd.nist.gov/vuln/detail/CVE-2026-41316]
- [https://osv.dev/vulnerability/ALPINE-CVE-2026-41316]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2026-41316]
- [https://osv.dev/vulnerability/SUSE-SU-2026:3556-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2026:10609-1]
- [https://security-tracker.debian.org/tracker/CVE-2026-41316]
- [https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json]
- [https://wid.cert-bund.de/.well-known/csaf/white/2026/wid-sec-w-2026-2455.json]
[CERT-Bund public advisories] · [Debian Security Tracker] · [FIRST EPSS] · [National Vulnerability Database (NVD)] · [OSV Package Vulnerability Database] · [Red Hat security advisories and VEX] · [SUSE security advisories and VEX]