cve.bz

CVE-2026-41316 ruby erb: Protection Mechanism Failure

8.1 highEPSS 1.1%Fix available

High (8.1) in ruby erb. EPSS 1.1% estimated probability of exploitation activity in the next 30 days. Fixed in erb 4.0.3.1, 4.0.4.1, 6.0.1.1.

On this page
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.

Severity

CVSS 3.1

8.1 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
1.1% (unchanged from 1.1% a week ago; 1.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 68th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-04-25. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-693 Protection Mechanism Failure
CWE-502 Deserialization of Untrusted Data
OWASP Top 10
A06:2025 Insecure Design, A08:2025 Software or Data Integrity Failures
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-41316 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-41316?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-41316?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-41316 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
ruby erb< 4.0.3.1
ruby erb= 4.0.4
ruby erb>= 5.0.0, < 6.0.1.1
ruby erb>= 6.0.2, < 6.0.4

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-q339-8rmv-2mhvRubyGemserb<4.0.3.14.0.3.1
GHSA-q339-8rmv-2mhvRubyGemserb>=4.0.4 <4.0.4.14.0.4.1
GHSA-q339-8rmv-2mhvRubyGemserb>=5.0.0 <6.0.1.16.0.1.1
GHSA-q339-8rmv-2mhvRubyGemserb>=6.0.2 <6.0.46.0.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11ruby2.72.7.4-1+deb11u6DLA-4716-1
Debian12ruby3.1no fix listedDEBIAN-CVE-2026-41316
Debian13ruby3.33.3.13-0+deb13u1DEBIAN-CVE-2026-41316 DSA-6614-1
Debian14ruby3.3no fix listedDEBIAN-CVE-2026-41316
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 1 morejrubyno fix listedUBUNTU-CVE-2026-41316
Ubuntu22.04:LTSruby3.0no fix listedUBUNTU-CVE-2026-41316
Ubuntu24.04:LTSruby3.2no fix listedUBUNTU-CVE-2026-41316
Ubuntu25.10, 26.04:LTS, 26.10jruby, ruby3.3no fix listedUBUNTU-CVE-2026-41316
UbuntuPro:16.04:LTSruby2.3no fix listedUBUNTU-CVE-2026-41316
UbuntuPro:18.04:LTSruby2.5no fix listedUBUNTU-CVE-2026-41316
UbuntuPro:20.04:LTSruby2.7no fix listedUBUNTU-CVE-2026-41316
Red Hatenterprise_linux:8::appstreamruby, ruby-doc, ruby-libs and 7 more0:3.3.10-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-abrt, rubygem-abrt-doc0:0.4.0-1.module+el8.10.0+21226+b78a28c4RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-bigdecimal, rubygem-bigdecimal-debuginfo0:3.1.5-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-bundler0:2.5.22-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-io-console, rubygem-io-console-debuginfo0:0.7.1-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-irb0:1.13.1-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-json, rubygem-json-debuginfo0:2.7.2-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-minitest0:5.20.0-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-mysql2, rubygem-mysql2-doc, rubygem-mysql2-debuginfo and 1 more0:0.5.5-1.module+el8.10.0+21226+b78a28c4RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-pg, rubygem-pg-doc, rubygem-pg-debuginfo and 1 more0:1.5.4-1.module+el8.10.0+21226+b78a28c4RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-power_assert0:2.0.3-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
Red Hatenterprise_linux:8::appstreamrubygem-psych, rubygem-psych-debuginfo0:5.1.2-6.module+el8.10.0+24247+b74f0fb8RHSA-2026:20614
214 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Basesystem 15 SP7ruby2.52.5.9-150700.24.11.1SUSE-SU-2026:3556-1
openSUSELeap 16.0ruby3.43.4.10-160000.1.1openSUSE-SU-2026:21878-1
openSUSETumbleweedruby4.04.0.3-1.1openSUSE-SU-2026:10609-1
AlmaLinux8ruby, ruby-doc, ruby-libs and 3 more3.3.10-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.4.0-1.module_el8.10.0+3799+191214ccALSA-2026:20614
AlmaLinux8rubygem-bigdecimal3.1.5-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-bundler2.5.22-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-io-console0.7.1-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-irb1.13.1-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-json2.7.2-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-minitest5.20.0-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-mysql2, rubygem-mysql2-doc0.5.5-1.module_el8.10.0+3799+191214ccALSA-2026:20614
AlmaLinux8rubygem-pg, rubygem-pg-doc1.5.4-1.module_el8.10.0+3799+191214ccALSA-2026:20614
AlmaLinux8rubygem-power_assert2.0.3-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
AlmaLinux8rubygem-psych5.1.2-6.module_el8.10.0+4183+69a3c42fALSA-2026:20614
48 more for AlmaLinux in the JSON.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Important.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10ruby-0:3.3.10-12.el10_1Fixed 2026-05-18RHSA-2026:18065
Red Hat Enterprise Linux 10ruby4.0-0:4.0.3-34.el10_2Fixed 2026-05-26RHSA-2026:20606
Red Hat Enterprise Linux 10.0 Extended Update Supportruby-0:3.3.10-11.el10_0.1Fixed 2026-06-30RHSA-2026:33478
Red Hat Enterprise Linux 8ruby:3.3-8100020260428163940.489197e6Fixed 2026-05-26RHSA-2026:20614
Red Hat Enterprise Linux 9ruby:3.3-9070020260428163621.9Fixed 2026-05-18RHSA-2026:18030
Red Hat Enterprise Linux 9ruby-0:3.0.7-166.el9_7Fixed 2026-05-18RHSA-2026:18039
Red Hat Enterprise Linux 9ruby:4.0-9080020260513131334.9Fixed 2026-05-26RHSA-2026:20596
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutionsruby-0:3.0.4-160.2.el9_0Fixed 2026-05-26RHSA-2026:20670
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutionsruby-0:3.0.4-161.el9_2.3Fixed 2026-07-06RHSA-2026:35834
Red Hat Enterprise Linux 9.4 Update Services for SAP Solutionsruby-0:3.0.7-162.el9_4.2Fixed 2026-06-16RHSA-2026:26312
Red Hat Enterprise Linux 9.4 Update Services for SAP Solutionsruby:3.3-9040020260520083544.9Fixed 2026-06-17RHSA-2026:26655
Red Hat Enterprise Linux 9.6 Extended Update Supportruby-0:3.0.7-165.el9_6.1Fixed 2026-06-30RHSA-2026:33462
Red Hat Enterprise Linux 9.6 Extended Update Supportruby:3.3-9060020260630075016.9Fixed 2026-07-09RHSA-2026:37238
Red Hat Enterprise Linux 6rubyNot affected
Red Hat Enterprise Linux 7rubyNot affected
Red Hat Enterprise Linux 8ruby:2.5/rubyNot affected
Red Hat Hardened Imagesruby3.3Not affected
Red Hat Hardened Imagesruby3.4Not affected
Red Hat Hardened Imagesruby4.0Not affected
Red Hat OpenShift Container Platform 4openshift/ose-rhel-coreos-9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-41316.

Attack patterns (CAPEC)

  • CAPEC-586 Object Injection Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-693 (17).

References

Check your stackJSON