Logo
vulnerabilityCVE-2026-41316
Name
CVE-2026-41316
Source
NVD ( link)Debian ( link)
Description
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.
Published Date
Updated Date
Workaround
-
Advisories

Analysis#


Affected Component
Analysis
ruby
Patched

Vulnerability Ratings#


8.1
CVSSv31
NaN
other

Others affected components#


Name
Project
Project Version
Version
Status
buildroot
master
4.0.3
Not Affected
openwrt
master
4.0.2-r1
Not Affected
openwrt
openwrt-25.12
3.4.9-r1
Not Affected
yocto
kirkstone
3.1.3
Not Affected
yocto
master
4.0.5
Not Affected
yocto
scarthgap
3.3.10
Not Affected

Resolved with patches#


ruby (buildroot:2025.02.x)

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