Logo
componentruby
Name
ruby
Version
3.4.9
Type
library
Description
-
Licenses
Ruby or BSD-2-ClauseBSD-3-ClauseMITothers
PURL
-
CPE
cpe:2.3:a:ruby-lang:ruby:3.4.9:-:*:*:*:*:*:*

Other Versions#


Project
Branch
Version
master
4.0.3

Patches#


#
Title
Author
Resolve
1
[ruby/erb] Prohibit def_method on marshal-loaded ERB instances
Takashi Kokubun <takashikkbn@gmail.com>
CVE-2026-41316

Vulnerabilities#


Name
Analysis
Description
Patched
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.
Exploitable
RubyGems.org is the Ruby community gem host. A bug in password & email change confirmation code allowed an attacker to change their RubyGems.org account's email to an unowned email address. Having access to an account whose email has been changed could enable an attacker to save API keys for that account, and when a legitimate user attempts to create an account with their email (and has to reset password to gain access) and is granted access to other gems, the attacker would then be able to publish and yank versions of those gems. Commit number 90c9e6aac2d91518b479c51d48275c57de492d4d contains a patch for this issue.