Amazon Linux 2 Security Advisory: ALAS2-2026-3284
Advisory Released Date: 2026-05-14
Advisory Updated Date: 2026-05-14
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. (CVE-2026-41316)
Affected Packages:
ruby
Note:
This advisory is applicable to Amazon Linux 2 (AL2) Core repository. Visit this FAQ section for the difference between AL2 Core and AL2 Extras advisories.
Issue Correction:
Run yum update ruby or yum update --advisory ALAS2-2026-3284 to update your system.
aarch64:
ruby-2.0.0.648-36.amzn2.0.18.aarch64
ruby-devel-2.0.0.648-36.amzn2.0.18.aarch64
ruby-libs-2.0.0.648-36.amzn2.0.18.aarch64
rubygem-bigdecimal-1.2.0-36.amzn2.0.18.aarch64
rubygem-io-console-0.4.2-36.amzn2.0.18.aarch64
rubygem-json-1.7.7-36.amzn2.0.18.aarch64
rubygem-psych-2.0.0-36.amzn2.0.18.aarch64
ruby-tcltk-2.0.0.648-36.amzn2.0.18.aarch64
ruby-debuginfo-2.0.0.648-36.amzn2.0.18.aarch64
i686:
ruby-2.0.0.648-36.amzn2.0.18.i686
ruby-devel-2.0.0.648-36.amzn2.0.18.i686
ruby-libs-2.0.0.648-36.amzn2.0.18.i686
rubygem-bigdecimal-1.2.0-36.amzn2.0.18.i686
rubygem-io-console-0.4.2-36.amzn2.0.18.i686
rubygem-json-1.7.7-36.amzn2.0.18.i686
rubygem-psych-2.0.0-36.amzn2.0.18.i686
ruby-tcltk-2.0.0.648-36.amzn2.0.18.i686
ruby-debuginfo-2.0.0.648-36.amzn2.0.18.i686
noarch:
rubygems-2.0.14.1-36.amzn2.0.18.noarch
rubygems-devel-2.0.14.1-36.amzn2.0.18.noarch
rubygem-rake-0.9.6-36.amzn2.0.18.noarch
ruby-irb-2.0.0.648-36.amzn2.0.18.noarch
rubygem-rdoc-4.0.0-36.amzn2.0.18.noarch
ruby-doc-2.0.0.648-36.amzn2.0.18.noarch
rubygem-minitest-4.3.2-36.amzn2.0.18.noarch
src:
ruby-2.0.0.648-36.amzn2.0.18.src
x86_64:
ruby-2.0.0.648-36.amzn2.0.18.x86_64
ruby-devel-2.0.0.648-36.amzn2.0.18.x86_64
ruby-libs-2.0.0.648-36.amzn2.0.18.x86_64
rubygem-bigdecimal-1.2.0-36.amzn2.0.18.x86_64
rubygem-io-console-0.4.2-36.amzn2.0.18.x86_64
rubygem-json-1.7.7-36.amzn2.0.18.x86_64
rubygem-psych-2.0.0-36.amzn2.0.18.x86_64
ruby-tcltk-2.0.0.648-36.amzn2.0.18.x86_64
ruby-debuginfo-2.0.0.648-36.amzn2.0.18.x86_64