{"id":"CVE-2022-21831","published":"2022-05-26T00:00:00Z","modified":"2024-08-03T02:53:36Z","title":"A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via…","vendor":null,"product":null,"tier":"tail","description":{"text":"A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.03098,"percentile":0.88058,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/advisories/GHSA-w749-p3v6-hccq","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/09/msg00002.html","tags":["mailing-list"]},{"url":"https://security.netapp.com/advisory/ntap-20221118-0001/","tags":[]},{"url":"https://www.debian.org/security/2023/dsa-5372","tags":["vendor-advisory"]}],"priority":{"score":22.6,"factors":[{"name":"EPSS percentile","points":17.61},{"name":"Public exploit code","points":5.0}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2020-04-05","earliestUrl":"https://github.com/usutani/study-turbolinks-link","repos":[{"name":"usutani/study-turbolinks-link","url":"https://github.com/usutani/study-turbolinks-link","stars":0,"created":"2020-04-05"}]},"first":{"date":"2020-04-05","source":"PoC-in-GitHub","url":"https://github.com/usutani/study-turbolinks-link"},"provenance":"source"},"affectedVersions":[{"vendor":"n/a","product":"https://github.com/rails/rails","versions":["7.0.2.3, 6.1.4.7, 6.0.4.7, 5.2.6.3"]}],"affected":[{"ecosystem":"RubyGems","package":"activestorage","vulnerableRanges":[">=5.2.0, <5.2.6.3",">=6.0.0, <6.0.4.7",">=6.1.0, <6.1.4.7",">=7.0.0, <7.0.2.3"],"patched":["5.2.6.3","6.0.4.7","6.1.4.7","7.0.2.3"],"from":["GHSA-w749-p3v6-hccq"],"provenance":"source"}],"summary":{"text":"A code injection flaw exists in Active Storage, the file-attachment component of Rails, in version 5.2.0 and later, where image_processing arguments are not handled safely. An attacker who can influence those image_processing arguments may be able to execute arbitrary code on the server.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:28:32Z"},"euvd":{"id":"EUVD-2022-1564","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-rails-activestorage-cve-2022-21831","children":[{"from":"CVE-2022-21831","to":"CVE-2025-24293","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["activestorage/lib/active_storage.rb"],"commits":["https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e","https://github.com/rails/rails/commit/1b1adf6ee6ca0f3104fcfce79360b2ec1e06a354","https://github.com/rails/rails/commit/2d612735ac0d9712fdfffaf80afa627e7295f6ce"],"basis":"shared function","functions":["ActiveStorage"]}]},{"from":"CVE-2022-21831","to":"CVE-2026-122006","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["activestorage/lib/active_storage/engine.rb"],"commits":["https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e","https://github.com/rails/rails/commit/468aa9a93fc98f5476b6821770f4ccfcb7f7d328","https://github.com/rails/rails/commit/ea8c40121ce53a3d0255cd4eb6d13bfe3bc01776"],"basis":"shared function","functions":["Engine"]}]}],"packageHistory":[{"cve":"CVE-2018-16477","published":"2018-11-30","fixed":"5.2.1.1","kev":false},{"cve":"CVE-2020-8162","published":"2020-06-19","fixed":"6.0.3.1","kev":false,"link":{"from":"CVE-2020-8162","to":"CVE-2022-21831","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:activestorage","fromFixed":"5.2.4.3","toFixed":"5.2.6.3","daysApart":706},{"kind":"version-step","provenance":"source","package":"RubyGems:activestorage","fromFixed":"6.0.3.1","toFixed":"6.0.4.7","daysApart":706}]}},{"cve":"CVE-2022-21831","published":"2022-05-26","fixed":"7.0.2.3","kev":false},{"cve":"CVE-2024-26144","published":"2024-02-27","fixed":"7.0.8.1","kev":false,"link":{"from":"CVE-2022-21831","to":"CVE-2024-26144","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:activestorage","fromFixed":"6.1.4.7","toFixed":"6.1.7.7","daysApart":642},{"kind":"version-step","provenance":"source","package":"RubyGems:activestorage","fromFixed":"7.0.2.3","toFixed":"7.0.8.1","daysApart":642}]}},{"cve":"CVE-2025-24293","published":"2026-01-30","fixed":"8.0.2.1","kev":false},{"cve":"CVE-2026-33173","published":"2026-03-23","fixed":"8.1.2.1","kev":false}],"package":"RubyGems:activestorage"}}