Skip to content
OpenAdvisories
High ALAS2-2026-3284 1 CVE

Important: ruby security update (Amazon Linux 2)

Published May 11, 2026 · Updated May 13, 2026

Summary

Package updates are available for Amazon Linux 2 that fix the following vulnerabilities: 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.

Fixed packages 16

ReleasePackageFixed in
Amazon Linux · 2 ruby 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 ruby-debuginfo 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 ruby-devel 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 ruby-doc 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 ruby-irb 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 ruby-libs 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 ruby-tcltk 0:2.0.0.648-36.amzn2.0.18
Amazon Linux · 2 rubygem-bigdecimal 0:1.2.0-36.amzn2.0.18
Amazon Linux · 2 rubygem-io-console 0:0.4.2-36.amzn2.0.18
Amazon Linux · 2 rubygem-json 0:1.7.7-36.amzn2.0.18
Amazon Linux · 2 rubygem-minitest 0:4.3.2-36.amzn2.0.18
Amazon Linux · 2 rubygem-psych 0:2.0.0-36.amzn2.0.18
Amazon Linux · 2 rubygem-rake 0:0.9.6-36.amzn2.0.18
Amazon Linux · 2 rubygem-rdoc 0:4.0.0-36.amzn2.0.18
Amazon Linux · 2 rubygems 0:2.0.14.1-36.amzn2.0.18
Amazon Linux · 2 rubygems-devel 0:2.0.14.1-36.amzn2.0.18

Vulnerabilities 1

  • High 8.1

    ERB has an @_init deserialization guard bypass via def_module / def_method / def_class

    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` (des…

References

  • web
    https://alas.aws.amazon.com/cve/html/CVE-2026-41316.html