{"answers":{"affected":"8 open source packages ship an affected version, including erb.","exploited":"There is no known exploitation of CVE-2026-41316 in the wild and no public exploit code.","fix":"Upgrade erb to a fixed version for your release line: 4.0.3.1, 4.0.4.1, 6.0.1.1 or 6.0.4.","what":"CVE-2026-41316 is a high-severity unsafe deserialization vulnerability in ruby erb, published on 24 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-41316 and fix it if it is affected.\n\nWhat it is: CVE-2026-41316 is a high-severity unsafe deserialization vulnerability in ruby erb, published on 24 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2026-41316 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- erb (RubyGems): affected all versions; fixed in 4.0.3.1\n- erb (RubyGems): affected all versions; fixed in 4.0.3.1\n- erb (RubyGems): affected from 4.0.4; fixed in 4.0.4.1\n- erb (RubyGems): affected from 4.0.4; fixed in 4.0.4.1\n- erb (RubyGems): affected from 5.0.0; fixed in 6.0.1.1\n- erb (RubyGems): affected from 5.0.0; fixed in 6.0.1.1\n- erb (RubyGems): affected from 6.0.2; fixed in 6.0.4\n- erb (RubyGems): affected from 6.0.2; fixed in 6.0.4\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-41316/ (Markdown: https://insights.sbomify.com/CVE-2026-41316/index.md)","id":"CVE-2026-41316","markdown":"https://insights.sbomify.com/CVE-2026-41316/index.md","name":"CVE-2026-41316","record":{"aliases":["ALPINE-CVE-2026-41316","ALSA-2026:18030","ALSA-2026:18039","ALSA-2026:18065","ALSA-2026:20614","BELL-CVE-2026-41316","CLEANSTART-2026-EK77943","CLEANSTART-2026-PT72236","CLSA-2026-1779745996","CLSA-2026-1781100836","DEBIAN-CVE-2026-41316","ECHO-f356-2b11-6f16","GHSA-q339-8rmv-2mhv","MINI-28qx-8vr9-x9rm","MINI-2rm4-mr5r-9hh7","MINI-48x5-jcf5-w28w","MINI-6w9c-jh5r-65w5","MINI-7fcp-qrvm-4vh8","MINI-83qg-295f-cwp3","MINI-97r8-38m9-8fw4","MINI-fmfc-gfx6-hqj5","MINI-gvgx-65f9-5cx8","MINI-hpmj-chv8-whv3","MINI-jp3g-7hqx-x2v7","MINI-jvg7-3m89-29j4","MINI-mm5r-5g65-3wcq","MINI-ppwx-vr2x-r5wc","MINI-q5c6-f36g-q9gc","MINI-q7fx-f8qm-3hf5","MINI-w2q9-cg3x-787c","MINI-w7cp-335r-r22m","OESA-2026-2263","RHSA-2026:18030","RHSA-2026:18039","RHSA-2026:18065","RHSA-2026:20614","RHSA-2026:20670","RHSA-2026:26312","RHSA-2026:26655","RHSA-2026:33478","RLSA-2026:18030","RLSA-2026:18039","RLSA-2026:18065","RLSA-2026:20614","ROOT-APP-RUBY-CVE-2026-41316","SUSE-SU-2026:3556-1","UBUNTU-CVE-2026-41316","openSUSE-SU-2026:10609-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Ruby ERB library","requires_auth":"none","summary":"Attackers can bypass deserialization guards in the Ruby ERB library to execute arbitrary code via specific public methods.","user_interaction":"not_required","vuln_class":"deserialization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-502","name":"Deserialization of Untrusted Data"},{"id":"CWE-693","name":"Protection Mechanism Failure"}],"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.","ecosystems":["AlmaLinux:10","AlmaLinux:8","AlmaLinux:9","Red Hat:enterprise_linux:10.1","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:9::appstream","Red Hat:enterprise_linux:9::crb","Red Hat:enterprise_linux_eus:10.0","Red Hat:rhel_e4s:9.0::appstream","Red Hat:rhel_e4s:9.4::appstream","Rocky Linux:10","Rocky Linux:8","Rocky Linux:9","RubyGems","SUSE:Linux Enterprise Module for Basesystem 15 SP7","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"ERB has an @_init deserialization guard bypass via def_module / def_method / def_class","id":"CVE-2026-41316","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"deserialization","year":"2026"},"n_packages":399,"n_references":1,"next":{"headline":"Frappe Press has an unsafe HTTP method / CSRF-adjacent issue on API secret generation","id":"CVE-2026-41317"},"packages":[{"ecosystem":"RubyGems","fixed":["4.0.3.1"],"introduced":["0"],"last_affected":[],"package":"erb","purl":null,"source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["4.0.3.1"],"introduced":["0"],"last_affected":[],"package":"erb","purl":"pkg:gem/erb","source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["4.0.4.1"],"introduced":["4.0.4"],"last_affected":[],"package":"erb","purl":null,"source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["4.0.4.1"],"introduced":["4.0.4"],"last_affected":[],"package":"erb","purl":"pkg:gem/erb","source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["6.0.1.1"],"introduced":["5.0.0"],"last_affected":[],"package":"erb","purl":null,"source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["6.0.1.1"],"introduced":["5.0.0"],"last_affected":[],"package":"erb","purl":"pkg:gem/erb","source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["6.0.4"],"introduced":["6.0.2"],"last_affected":[],"package":"erb","purl":null,"source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"RubyGems","fixed":["6.0.4"],"introduced":["6.0.2"],"last_affected":[],"package":"erb","purl":"pkg:gem/erb","source":"GHSA-q339-8rmv-2mhv"},{"ecosystem":"AlmaLinux:10","fixed":["3.3.10-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"ruby-default-gems","purl":"pkg:rpm/almalinux/ruby-default-gems","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["3.3.10-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"ruby-doc","purl":"pkg:rpm/almalinux/ruby-doc","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["2.5.22-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-bundler","purl":"pkg:rpm/almalinux/rubygem-bundler","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["1.13.1-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-irb","purl":"pkg:rpm/almalinux/rubygem-irb","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["5.20.0-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-minitest","purl":"pkg:rpm/almalinux/rubygem-minitest","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["2.0.3-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-power_assert","purl":"pkg:rpm/almalinux/rubygem-power_assert","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["13.1.0-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-rake","purl":"pkg:rpm/almalinux/rubygem-rake","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["6.6.3.1-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-rdoc","purl":"pkg:rpm/almalinux/rubygem-rdoc","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["3.4.4-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-rexml","purl":"pkg:rpm/almalinux/rubygem-rexml","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["0.3.1-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-rss","purl":"pkg:rpm/almalinux/rubygem-rss","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["3.6.1-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-test-unit","purl":"pkg:rpm/almalinux/rubygem-test-unit","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["0.21.9-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygem-typeprof","purl":"pkg:rpm/almalinux/rubygem-typeprof","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["3.5.22-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygems","purl":"pkg:rpm/almalinux/rubygems","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:10","fixed":["3.5.22-12.el10_1"],"introduced":["0"],"last_affected":[],"package":"rubygems-devel","purl":"pkg:rpm/almalinux/rubygems-devel","source":"ALSA-2026:18065"},{"ecosystem":"AlmaLinux:8","fixed":["3.3.10-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"ruby","purl":"pkg:rpm/almalinux/ruby","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["3.3.10-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"ruby-bundled-gems","purl":"pkg:rpm/almalinux/ruby-bundled-gems","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["3.3.10-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"ruby-default-gems","purl":"pkg:rpm/almalinux/ruby-default-gems","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["3.3.10-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"ruby-devel","purl":"pkg:rpm/almalinux/ruby-devel","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["3.3.10-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"ruby-doc","purl":"pkg:rpm/almalinux/ruby-doc","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["3.3.10-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"ruby-libs","purl":"pkg:rpm/almalinux/ruby-libs","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["0.4.0-1.module_el8.10.0+3799+191214cc"],"introduced":["0"],"last_affected":[],"package":"rubygem-abrt","purl":"pkg:rpm/almalinux/rubygem-abrt","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["0.4.0-1.module_el8.10.0+3799+191214cc"],"introduced":["0"],"last_affected":[],"package":"rubygem-abrt-doc","purl":"pkg:rpm/almalinux/rubygem-abrt-doc","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["3.1.5-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"rubygem-bigdecimal","purl":"pkg:rpm/almalinux/rubygem-bigdecimal","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["2.5.22-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"rubygem-bundler","purl":"pkg:rpm/almalinux/rubygem-bundler","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["0.7.1-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"rubygem-io-console","purl":"pkg:rpm/almalinux/rubygem-io-console","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["1.13.1-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"rubygem-irb","purl":"pkg:rpm/almalinux/rubygem-irb","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.2-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"rubygem-json","purl":"pkg:rpm/almalinux/rubygem-json","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["5.20.0-6.module_el8.10.0+4183+69a3c42f"],"introduced":["0"],"last_affected":[],"package":"rubygem-minitest","purl":"pkg:rpm/almalinux/rubygem-minitest","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["0.5.5-1.module_el8.10.0+3799+191214cc"],"introduced":["0"],"last_affected":[],"package":"rubygem-mysql2","purl":"pkg:rpm/almalinux/rubygem-mysql2","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["0.5.5-1.module_el8.10.0+3799+191214cc"],"introduced":["0"],"last_affected":[],"package":"rubygem-mysql2-doc","purl":"pkg:rpm/almalinux/rubygem-mysql2-doc","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["1.5.4-1.module_el8.10.0+3799+191214cc"],"introduced":["0"],"last_affected":[],"package":"rubygem-pg","purl":"pkg:rpm/almalinux/rubygem-pg","source":"ALSA-2026:20614"},{"ecosystem":"AlmaLinux:8","fixed":["1.5.4-1.module_el8.10.0+3799+191214cc"],"introduced":["0"],"last_affected":[],"package":"rubygem-pg-doc","purl":"pkg:rpm/almalinux/rubygem-pg-doc","source":"ALSA-2026:20614"}],"prev":{"headline":"Command injection in mdserver-web","id":"CVE-2026-41315"},"products":["erb"],"published":"2026-04-24","related":[],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-08-24","vendors":["ruby"]},"summary":"Attackers can bypass deserialization guards in the Ruby ERB library to execute arbitrary code via specific public methods.","url":"https://insights.sbomify.com/CVE-2026-41316/"}