Vulnerability
CVE-2026-41316
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.
118 advisories report this vulnerability, across 14 ecosystems.
Advisories
-
ALAS2-2026-3284
Amazon Linux 2 2017.12 - ALAS2-2026-3284: important priority package update for ruby
-
ALAS2023-2026-1690
Amazon Linux 2023 - ALAS2023-2026-1690: Important priority package update for ruby3.4
-
ALPINE-CVE-2026-41316
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…
-
ALSA-2026:18030
Important: ruby:3.3 security update
-
ALSA-2026:18039
Important: ruby security update
-
ALSA-2026:18065
Important: ruby security update
-
ALSA-2026:20596
Important: ruby:4.0 security update
-
ALSA-2026:20606
Important: ruby4.0 security update
-
ALSA-2026:20614
Important: ruby:3.3 security update
- CGA-2gg9-9w8g-p32x
- CGA-3598-v72j-q8gr
- CGA-3c9w-mrgm-f75p
- CGA-3cx9-fxh7-2rr8
- CGA-3p69-2x6j-53mq
- CGA-3r58-vmcc-x3rm
- CGA-3xpq-5h4x-x3cx
- CGA-459q-g5mf-92f5
- CGA-47x3-768q-h47g
- CGA-48w3-h4c5-f7p3
- CGA-4cwg-jjmx-98q6
- CGA-4q38-j2hr-8ffw
- CGA-4v77-3375-546q
- CGA-538c-2w4v-xg9c
- CGA-5x87-fvfp-q336
- CGA-6465-48hr-r5pj
- CGA-69hq-6vxq-jfx6
- CGA-6hxp-qvm2-24hj
- CGA-6q4w-vp22-c69p
- CGA-6r84-crg3-rfgh
- CGA-6rrv-vj2f-vcmc
- CGA-6x4x-wqgh-6wgp
- CGA-7ccr-rrvr-2wgq
- CGA-826w-9m95-2gwv
- CGA-85p2-m5mm-rrpw
- CGA-89rj-fcf7-fm63
- CGA-8gpf-gjjh-mww2
- CGA-8gxh-rrj5-6xvf
- CGA-8rc8-jc3v-rvgq
- CGA-8xqm-jv94-h3wp
- CGA-92p9-583r-fq2j
- CGA-9j43-r4x4-vfcp
- CGA-9jm8-h2fj-pm3g
- CGA-9pwh-c65p-c64r
- CGA-9rx9-m75g-vpvw
- CGA-c6hj-59rf-78mw
- CGA-cgxw-qvg6-gx3v
- CGA-cjgh-gmp2-85ph
- CGA-cw7f-cp35-fppp
- CGA-f557-j3gr-q246
- CGA-fhw7-vx6j-c8rq
- CGA-fx27-jv86-7c89
- CGA-g8pj-xh23-5r7m
- CGA-gvhg-mr4h-hfv6
- CGA-hv46-v8xp-mcfj
- CGA-j324-hpvp-jjxw
- CGA-j4wq-vp25-8r96
- CGA-jh7f-8g6j-jqfq
- CGA-jqvc-rm6g-2p2w
- CGA-m5cv-3w96-jf5h
- CGA-m8qx-c7hg-2fmm
- CGA-mg68-qhv7-r8c3
- CGA-p2r4-97rq-9h8c
- CGA-p7vh-j2f4-h2xw
- CGA-pj5c-8mww-g72c
- CGA-pq5h-xhvh-98hf
- CGA-pqch-c99c-wj9x
- CGA-prq6-cq4v-xxhc
- CGA-pw8q-hwfh-394g
- CGA-q2cc-25vr-j63v
- CGA-q836-86c4-4mj7
- CGA-r866-2cg2-6hw3
- CGA-rg86-pgh8-w24x
- CGA-rvh4-2cpw-3994
- CGA-v455-3pwp-357x
- CGA-vqwp-qrp3-j4fc
- CGA-wcwq-fcq5-f64m
- CGA-wg88-42m8-pwqr
- CGA-wh82-j676-rg4m
- CGA-wjm6-jpfg-cpgj
- CGA-wqxq-wwrj-438m
- CGA-x64h-c4xg-9mfp
- CGA-xc2w-6g6x-hmcf
- CGA-xfvp-r6qx-hh9p
-
DEBIAN-CVE-2026-41316
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…
-
DLA-4716-1
ruby2.7 - security update
-
DSA-6614-1
ruby3.3 - security update
-
ELSA-2026-18030
ELSA-2026-18030: ruby:3.3 security update (IMPORTANT)
-
ELSA-2026-18039
ELSA-2026-18039: ruby security update (IMPORTANT)
-
ELSA-2026-18065
ELSA-2026-18065: ruby security update (IMPORTANT)
-
ELSA-2026-20596
ELSA-2026-20596: ruby:4.0 security update (IMPORTANT)
-
ELSA-2026-20606
ELSA-2026-20606: ruby4.0 security update (IMPORTANT)
-
ELSA-2026-20614
ELSA-2026-20614: ruby:3.3 security update (IMPORTANT)
-
GHSA-q339-8rmv-2mhv
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
-
OESA-2026-2263
ruby security update
-
RHSA-2026:18030
Red Hat Security Advisory: ruby:3.3 security update
-
RHSA-2026:18039
Red Hat Security Advisory: ruby security update
-
RHSA-2026:18065
Red Hat Security Advisory: ruby security update
-
RHSA-2026:20596
Red Hat Security Advisory: ruby:4.0 security update
-
RHSA-2026:20606
Red Hat Security Advisory: ruby4.0 security update
-
RHSA-2026:20614
Red Hat Security Advisory: ruby:3.3 security update
Showing the first 100. The API lists them all: /api/v1/vulnerabilities/CVE-2026-41316.
References
- https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv
- https://access.redhat.com/errata/RHSA-2026:18030
- https://access.redhat.com/errata/RHSA-2026:18039
- https://access.redhat.com/errata/RHSA-2026:18065
- https://access.redhat.com/errata/RHSA-2026:20596
- https://access.redhat.com/errata/RHSA-2026:20606
- https://access.redhat.com/errata/RHSA-2026:20614
- https://access.redhat.com/errata/RHSA-2026:20670
- https://access.redhat.com/errata/RHSA-2026:26312
- https://access.redhat.com/errata/RHSA-2026:26655
- https://access.redhat.com/errata/RHSA-2026:33462
- https://access.redhat.com/errata/RHSA-2026:33478
- https://access.redhat.com/errata/RHSA-2026:35834
- https://access.redhat.com/errata/RHSA-2026:37238
- https://access.redhat.com/security/cve/CVE-2026-41316
- https://bugzilla.redhat.com/show_bug.cgi?id=2461369
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41316.json