REDHAT-BUG-2461369: High severity rubygems/erb vulnerability

Published Apr 24, 2026
·
Updated

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#defmethod, ERB#defmodule, and ERB#defclass. An attacker who can trigger Marshal.load on untrusted data in a Ruby application that has erb loaded can use ERB#defmodule (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.

Affected Software

1 affected component
rubygems/erb<4.0.3.1, <4.0.4.1, <6.0.1.1, <6.0.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Ruby ERB to a version that resolves this vulnerability.

    Patch ERB 4.0.3.1
  2. Compensating control

    If an attacker can trigger `Marshal.load` on untrusted data in the Ruby application, prevent deserialization of attacker-controlled objects by ensuring `Marshal.load` is only used on trusted data (or by replacing it with a safe alternative), since ERB deserialization/Reconstruction is the precondition for the `@_init` bypass mentioned.

Event History

Apr 24, 2026
Data Sourced
via Red Hat·03:01 AM
DescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of REDHAT-BUG-2461369?

The severity of REDHAT-BUG-2461369 is classified as high with a rating of 7.

2

How do I fix REDHAT-BUG-2461369?

To fix REDHAT-BUG-2461369, upgrade to ERB version 2.2.0 or later.

3

What software is affected by REDHAT-BUG-2461369?

The software affected by REDHAT-BUG-2461369 is rubygems/erb.

4

What vulnerabilities are associated with REDHAT-BUG-2461369?

REDHAT-BUG-2461369 is associated with vulnerabilities related to code execution during ERB object reconstruction.

5

When was REDHAT-BUG-2461369 published?

REDHAT-BUG-2461369 was published on April 24, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203