ERB has an @_init deserialization guard bypass via def_module / def_method / def_class

Summary

CVECVE-2026-41316
StatePUBLISHED
AssignerGitHub_M
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-04-24 03:16:11 UTC
Updated2026-07-15 02:21:15 UTC
DescriptionERB 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.

Risk And Classification

Primary CVSS: v3.1 8.1 HIGH from ADP

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS: 0.011310000 probability, percentile 0.626500000 (date 2026-07-13)

Problem Types: CWE-693 | CWE-502 | CWE-693 CWE-693: Protection Mechanism Failure | CWE-502 Deserialization of Untrusted Data


VersionSourceTypeScoreSeverityVector
3.1ADPCVSS8.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
3.1[email protected]Secondary8.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
3.10b0ca135-0b70-47e7-9f44-1890c2a1c46cSecondary8.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
3.1CNADECLARED8.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

CVSS v3.1 Breakdown

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Ruby Erb affected < 4.0.3.1 Not specified
CNA Ruby Erb affected = 4.0.4 Not specified
CNA Ruby Erb affected >= 5.0.0, < 6.0.1.1 Not specified
CNA Ruby Erb affected >= 6.0.2, < 6.0.4 Not specified
ADP Red Hat Red Hat Enterprise Linux 10 unaffected 0:3.3.10-12.el10_1 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 10 unaffected 0:4.0.3-34.el10_2 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 10.0 Extended Update Support unaffected 0:3.3.10-11.el10_0.1 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 8 unaffected 8100020260428163940.489197e6 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9 unaffected 9070020260428163621.9 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9 unaffected 0:3.0.7-166.el9_7 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9 unaffected 9080020260513131334.9 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9.0 Update Services For SAP Solutions unaffected 0:3.0.4-160.2.el9_0 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9.2 Update Services For SAP Solutions unaffected 0:3.0.4-161.el9_2.3 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9.4 Update Services For SAP Solutions unaffected 0:3.0.7-162.el9_4.2 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9.4 Update Services For SAP Solutions unaffected 9040020260520083544.9 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9.6 Extended Update Support unaffected 0:3.0.7-165.el9_6.1 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 9.6 Extended Update Support unaffected 9060020260630075016.9 * rpm Not specified
ADP Red Hat Red Hat Enterprise Linux 6 Not specified Not specified
ADP Red Hat Red Hat Enterprise Linux 7 Not specified Not specified
ADP Red Hat Red Hat Enterprise Linux 8 Not specified Not specified
ADP Red Hat Red Hat Hardened Images Not specified Not specified
ADP Red Hat Red Hat Hardened Images Not specified Not specified
ADP Red Hat Red Hat Hardened Images Not specified Not specified
ADP Red Hat Red Hat OpenShift Container Platform 4 Not specified Not specified

References

ReferenceSourceLinkTags
github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv [email protected] github.com
access.redhat.com/errata/RHSA-2026:26655 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:20606 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:33478 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:18039 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:20614 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:18065 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json 0b0ca135-0b70-47e7-9f44-1890c2a1c46c security.access.redhat.com
access.redhat.com/errata/RHSA-2026:33462 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/security/cve/CVE-2026-41316 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:18030 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:20670 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:26312 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:35834 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:20596 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
bugzilla.redhat.com/show_bug.cgi 0b0ca135-0b70-47e7-9f44-1890c2a1c46c bugzilla.redhat.com
access.redhat.com/errata/RHSA-2026:37238 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Additional Advisory Data

SourceTimeEvent
ADP2026-04-24T03:01:16.620ZReported to Red Hat.
ADP2026-04-24T02:35:41.160ZMade public.

Solutions

ADP: RHSA-2026:33478: Red Hat Enterprise Linux AppStream EUS (v. 10.0), Red Hat Enterprise Linux CodeReady Linux Builder EUS (v. 10.0)

ADP: RHSA-2026:18065: Red Hat Enterprise Linux AppStream (v. 10), Red Hat Enterprise Linux CodeReady Linux Builder (v. 10)

ADP: RHSA-2026:20606: Red Hat Enterprise Linux AppStream (v. 10), Red Hat Enterprise Linux CodeReady Linux Builder (v. 10)

ADP: RHSA-2026:20614: Red Hat Enterprise Linux AppStream (v. 8)

ADP: RHSA-2026:20670: Red Hat Enterprise Linux AppStream E4S (v.9.0)

ADP: RHSA-2026:35834: Red Hat Enterprise Linux AppStream E4S (v.9.2)

ADP: RHSA-2026:26312: Red Hat Enterprise Linux AppStream E4S (v.9.4)

ADP: RHSA-2026:26655: Red Hat Enterprise Linux AppStream E4S (v.9.4)

ADP: RHSA-2026:33462: Red Hat CodeReady Linux Builder EUS (v.9.6), Red Hat Enterprise Linux AppStream EUS (v.9.6)

ADP: RHSA-2026:37238: Red Hat Enterprise Linux AppStream EUS (v.9.6)

ADP: RHSA-2026:18039: Red Hat Enterprise Linux AppStream (v. 9), Red Hat Enterprise Linux CodeReady Linux Builder (v. 9)

ADP: RHSA-2026:18030: Red Hat Enterprise Linux AppStream (v. 9)

ADP: RHSA-2026:20596: Red Hat Enterprise Linux AppStream (v. 9)

© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report