{"answers":{"affected":"8 open source packages ship an affected version, including activestorage. It affects 2 products.","exploited":"There is no known exploitation of CVE-2022-21831 in the wild and no public exploit code.","fix":"Upgrade activestorage to a fixed version for your release line: 5.2.6.3, 6.0.4.7, 6.1.4.7 or 7.0.2.3.","what":"CVE-2022-21831 is a critical code injection vulnerability in Debian Debian Linux, published on 26 May 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-21831 and fix it if it is affected.\n\nWhat it is: CVE-2022-21831 is a critical code injection vulnerability in Debian Debian Linux, published on 26 May 2022. 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-2022-21831 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- activestorage (RubyGems): affected from 5.2.0; fixed in 5.2.6.3\n- activestorage (RubyGems): affected from 5.2.0; fixed in 5.2.6.3\n- activestorage (RubyGems): affected from 6.0.0; fixed in 6.0.4.7\n- activestorage (RubyGems): affected from 6.0.0; fixed in 6.0.4.7\n- activestorage (RubyGems): affected from 6.1.0; fixed in 6.1.4.7\n- activestorage (RubyGems): affected from 6.1.0; fixed in 6.1.4.7\n- activestorage (RubyGems): affected from 7.0.0; fixed in 7.0.2.3\n- activestorage (RubyGems): affected from 7.0.0; fixed in 7.0.2.3\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-2022-21831/ (Markdown: https://insights.sbomify.com/CVE-2022-21831/index.md)","id":"CVE-2022-21831","markdown":"https://insights.sbomify.com/CVE-2022-21831/index.md","name":"CVE-2022-21831","record":{"aliases":["DEBIAN-CVE-2022-21831","GHSA-w749-p3v6-hccq","UBUNTU-CVE-2022-21831","openSUSE-SU-2024:11903-1","openSUSE-SU-2024:12880-1","openSUSE-SU-2024:14070-1","openSUSE-SU-2025:15113-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Ruby on Rails","requires_auth":"none","summary":"Attackers can execute arbitrary code via image processing arguments in Active Storage, requiring an upgrade to secure Ruby on Rails applications.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"hackerone","cpe":[{"product":"debian_linux","vendor":"debian"},{"product":"active_storage","vendor":"rubyonrails"}],"cvss":{"score":9.8,"severity":"critical","source":"nvd","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"description":"A code injection vulnerability exists in the Active Storage \u003e= v5.2.0 that could allow an attacker to execute code via image_processing arguments.","ecosystems":["RubyGems","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":"2020-04-05","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2020-04-05T08:17:56Z","kind":"github_poc","ref":"https://github.com/usutani/study-turbolinks-link","stars":0,"title":"Known security vulnerabilities detected. CVE-2022-21831 Critical severity CVE-2025-24293 Critical severity CVE-2020-8162 High severity CVE-2024-26144 Moderate severity"}],"tier":"poc_unverified"},"has_fix":true,"headline":"Possible code injection vulnerability in Rails / Active Storage","id":"CVE-2022-21831","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":"debian:debian_linux","products":["debian:debian_linux"],"type":"code_injection","year":"2022"},"n_packages":12,"n_references":4,"next":{"headline":"Virtual Machine IDE Drive Elevation of Privilege Vulnerability","id":"CVE-2022-21833"},"packages":[{"ecosystem":"RubyGems","fixed":["5.2.6.3"],"introduced":["5.2.0"],"last_affected":[],"package":"activestorage","purl":null,"source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["5.2.6.3"],"introduced":["5.2.0"],"last_affected":[],"package":"activestorage","purl":"pkg:gem/activestorage","source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["6.0.4.7"],"introduced":["6.0.0"],"last_affected":[],"package":"activestorage","purl":null,"source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["6.0.4.7"],"introduced":["6.0.0"],"last_affected":[],"package":"activestorage","purl":"pkg:gem/activestorage","source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["6.1.4.7"],"introduced":["6.1.0"],"last_affected":[],"package":"activestorage","purl":null,"source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["6.1.4.7"],"introduced":["6.1.0"],"last_affected":[],"package":"activestorage","purl":"pkg:gem/activestorage","source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["7.0.2.3"],"introduced":["7.0.0"],"last_affected":[],"package":"activestorage","purl":null,"source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"RubyGems","fixed":["7.0.2.3"],"introduced":["7.0.0"],"last_affected":[],"package":"activestorage","purl":"pkg:gem/activestorage","source":"GHSA-w749-p3v6-hccq"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["7.0.4.3-1.1"],"introduced":["0"],"last_affected":[],"package":"ruby3.2-rubygem-activestorage-7.0","purl":"pkg:rpm/opensuse/ruby3.2-rubygem-activestorage-7.0\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:12880-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["7.0.2.3-1.1"],"introduced":["0"],"last_affected":[],"package":"rubygem-activestorage-7.0","purl":"pkg:rpm/opensuse/rubygem-activestorage-7.0\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:11903-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["7.0.8.4-1.1"],"introduced":["0"],"last_affected":[],"package":"rubygem-activestorage-7.0","purl":"pkg:rpm/opensuse/rubygem-activestorage-7.0\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:14070-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["7.0.8.6-1.3"],"introduced":["0"],"last_affected":[],"package":"rubygem-activestorage-7.0","purl":"pkg:rpm/opensuse/rubygem-activestorage-7.0\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2025:15113-1"}],"prev":{"headline":"Cross-site Scripting in @rocket.chat/livechat","id":"CVE-2022-21830"},"products":["https://github.com/rails/rails"],"published":"2022-05-26","related":[{"cvss_score":10,"headline":"ProFTPD Improper Access Control","id":"CVE-2015-3306","kev_date_added":"2026-10-08","published":"2015-05-18"},{"cvss_score":9.9,"headline":"RoundCube Webmail Deserialization of Untrusted Data","id":"CVE-2025-49113","kev_date_added":"2026-02-20","published":"2025-06-02"},{"cvss_score":9.8,"headline":"GNU InetUtils Argument Injection","id":"CVE-2026-24061","kev_date_added":"2026-01-26","published":"2026-01-21"},{"cvss_score":9.8,"headline":"Linux Kernel Improper Check for Unusual or Exceptional Conditions","id":"CVE-2025-39682","kev_date_added":"2026-09-18","published":"2025-09-05"},{"cvss_score":9.8,"headline":"Mozilla Firefox Use-After-Free","id":"CVE-2024-9680","kev_date_added":"2024-10-15","published":"2024-10-09"},{"cvss_score":9.8,"headline":"RARLAB UnRAR Directory Traversal","id":"CVE-2022-30333","kev_date_added":"2022-08-09","published":"2022-05-09"},{"cvss_score":9.8,"headline":"Roundcube Webmail SQL Injection","id":"CVE-2021-44026","kev_date_added":"2023-06-22","published":"2021-11-19"}],"sources":[{"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":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["n/a"]},"summary":"Attackers can execute arbitrary code via image processing arguments in Active Storage, requiring an upgrade to secure Ruby on Rails applications.","url":"https://insights.sbomify.com/CVE-2022-21831/"}