LiveActive security incident?Get immediate response
CVE Record

CVE-2026-41316: ERB has an @_init deserialization guard bypass via def_module / def_method / def_class

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.

HighCVSS 8.1Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2026-41316 is a high-severity Ruby ERB flaw. If a Ruby application deserializes untrusted Marshal data while ERB is loaded, an attacker may bypass ERB’s deserialization guard and reach code execution paths. The sources name fixed ERB releases, but do not show confirmed active exploitation.

Executive priority

Treat as high priority for Ruby environments that deserialize data. It can lead to code execution, but exploitation depends on a dangerous deserialization pattern. Prioritize exposed systems and services processing serialized Ruby objects.

Technical view

Ruby ERB added an @_init guard for ERB#result and ERB#run, but ERB#def_method, ERB#def_module, and ERB#def_class also evaluated @src and lacked the same guard. A deserialized ERB object could therefore bypass the intended protection. Patched versions are ERB 4.0.3.1, 4.0.4.1, 6.0.1.1, and 6.0.4.

Likely exposure

Exposure is likely limited to Ruby applications or platforms using affected ERB versions and performing Marshal.load on attacker-controlled or untrusted data. The highest-risk cases are internet-facing services, background job systems, or internal APIs that accept serialized Ruby objects.

Exploitation context

The source bundle indicates network attackability with high attack complexity and no required privileges or user interaction. Active exploitation is not established: KEV is false, and the provided sources do not cite exploitation in the wild.

Researcher notes

The key condition is unsafe Ruby Marshal deserialization with ERB present. The vulnerability is a guard coverage gap across ERB methods that evaluate template source. Evidence supports patched ERB versions and high severity, but does not establish public exploitation or broad exposure.

Mitigation direction

  • Upgrade ERB to a patched version named by the advisory.
  • Apply relevant Red Hat errata where using affected Red Hat packages.
  • Remove or block Marshal.load on untrusted data.
  • Audit deserialization boundaries and prefer safe data formats.
  • Follow vendor guidance for Ruby runtime or packaged dependency updates.

Validation and detection

  • Inventory Ruby applications and ERB versions in dependency metadata.
  • Review code paths that call Marshal.load or equivalent deserialization.
  • Confirm whether ERB is loaded in services accepting serialized input.
  • Verify patched ERB versions are deployed after updates.
  • Check vendor advisories for distribution-specific package status.
Prepared
Confidence
high
Sources
8

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-502: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cwe · low confidence lookup

CWE-693: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-41316 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.1 (3.1)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
18Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.1CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H2.25.9GitHub_M
8.1CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H2.25.9redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

8.1High
CVSS 3.1 vector shape for CVE-2026-41316Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPerb: ERB: Arbitrary code execution via deserialization bypass
other:Red Hat severity ratingcvssV3_1
  • 2026-04-24T03:01:16.620Z: Reported to Red Hat.
  • 2026-04-24T02:35:41.160Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
rubyerb< 4.0.3.1, = 4.0.4, >= 5.0.0, < 6.0.1.1, >= 6.0.2, < 6.0.4Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-502 · source CWE mapping

Deserialization of Untrusted Data

Deserialization of Untrusted Data represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

CWE-693 · source CWE mapping

Protection Mechanism Failure

Protection Mechanism Failure represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.