ERB Vulnerability Allows Code Execution via Untrusted Data
CVE-2026-41316

8.1HIGH

Key Information:

Vendor

Ruby

Status
Vendor
CVE Published:
24 April 2026

What is CVE-2026-41316?

CVE-2026-41316 is a vulnerability found in the ERB templating system used in Ruby, specifically impacting versions of Ruby before ERB 2.2.0. ERB is integral for generating text documents like HTML by embedding Ruby code within them. This vulnerability arises from insufficient protections in certain methods that interact with potentially unsafe data. When untrusted input is processed through Marshal.load in an application that uses ERB, an attacker can exploit the ERB#def_module method to execute arbitrary code. This means that the safety mechanisms designed to uphold integrity during the deserialization of ERB objects can be bypassed, allowing malicious actors to manipulate applications that rely on this templating system, resulting in severe security risks for organizations.

Potential impact of CVE-2026-41316

  1. Arbitrary Code Execution: The primary risk associated with CVE-2026-41316 is the ability for attackers to execute arbitrary code on the server. This can lead to unauthorized access, data exfiltration, and manipulation of the server environment.

  2. Compromise of Application Integrity: Due to this vulnerability, any Ruby application utilizing ERB and handling untrusted data is at risk. An attacker can exploit this flaw to alter application logic, potentially redirecting users, injecting malicious content, or disrupting services.

  3. Increased Attack Surface: Organizations utilizing ERB in their applications become more vulnerable to targeted attacks. If exploited, this vulnerability could serve as a gateway for attackers to infiltrate broader network systems, leading to larger-scale breaches, including potential ransomware operations.

Affected Version(s)

erb < 4.0.3.1 < 4.0.3.1

erb = 4.0.4 = 4.0.4

erb >= 5.0.0, < 6.0.1.1 < 5.0.0, 6.0.1.1

References

CVSS V3.1

Score:
8.1
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Network
Attack Complexity:
High
Privileges Required:
None
User Interaction:
None
Scope:
Unchanged

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.