{"id":"CVE-2022-21831","aliases":["CVE-2022-21831","GHSA-w749-p3v6-hccq"],"related":[],"kind":"vulnerability","state":"published","title":"Possible code injection vulnerability in Rails / Active Storage","summary":"A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"The Active Storage module of Rails starting with version 5.2.0 is possibly vulnerable to code injection. This issue was patched in versions 5.2.6.3, 6.0.4.7, 6.1.4.7, and 7.0.2.3. To work around this issue, applications should implement a strict allow-list on accepted transformation methods or arguments.  Additionally, a strict ImageMagick security policy will help mitigate this issue.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se presenta una vulnerabilidad de inyección de código en Active Storage versiones posteriores a v5.2.0 incluyéndola, que podría permitir a un atacante ejecutar código por medio de argumentos image_processing","source":"nvd"}],"published":"2022-03-08T21:25:54.000Z","modified":"2026-06-17T04:27:03.960Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"7.0.2.3, 6.1.4.7, 6.0.4.7, 5.2.6.3","status":"affected"}],"product":"https://github.com/rails/rails","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.2.0","status":"affected","fixed":"5.2.6.3"}],"ecosystem":"RubyGems","package":"activestorage","purl":"pkg:gem/activestorage","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.0.4.7"}],"ecosystem":"RubyGems","package":"activestorage","purl":"pkg:gem/activestorage","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.1.0","status":"affected","fixed":"6.1.4.7"}],"ecosystem":"RubyGems","package":"activestorage","purl":"pkg:gem/activestorage","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.0.0","status":"affected","fixed":"7.0.2.3"}],"ecosystem":"RubyGems","package":"activestorage","purl":"pkg:gem/activestorage","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"5.2.0","fixed":"5.2.6.3"},{"status":"affected","introduced":"6.0.0","fixed":"6.0.4.7"},{"status":"affected","introduced":"6.1.0","fixed":"6.1.4.7"},{"status":"affected","introduced":"7.0.0","fixed":"7.0.2.3"}],"vendor":"rubyonrails","product":"active_storage","cpe":"cpe:2.3:a:rubyonrails:active_storage:*:*:*:*:*:ruby:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/advisories/GHSA-w749-p3v6-hccq","tags":["advisory","patch","third-party-advisory","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/09/msg00002.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.netapp.com/advisory/ntap-20221118-0001/","tags":["third-party-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://www.debian.org/security/2023/dsa-5372","tags":["vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21831","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rails/rails","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/CVE-2022-21831.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI","tags":["web"],"sources":["ghsa"]},{"url":"https://rubysec.com/advisories/CVE-2022-21831","tags":["web"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20221118-0001","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"hackerone","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-21831","url":"https://www.cve.org/CVERecord?id=CVE-2022-21831","licence":"CVE Terms of Use","modified":"2024-08-03T02:53:36.300Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w749-p3v6-hccq","url":"https://github.com/advisories/GHSA-w749-p3v6-hccq","licence":"CC-BY-4.0","modified":"2026-03-13T22:14:30.413Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-21831","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21831","licence":"Public domain","modified":"2026-06-17T04:27:03.960Z"}],"updatedAt":"2026-11-25T22:58:11.959Z","epss":{"score":0.03084,"percentile":0.88046,"date":"2026-12-01T12:00:22.000Z"}}