{"id":"CVE-2022-24720","aliases":["GHSA-cxf7-qrc5-9446"],"url":"https://o3.security/vulnerability/CVE-2022-24720","summary":"Improper Input Validation in image_processing","details":"### Impact\n\nWhen using the `#apply` method from image_processing to apply a series of operations that are coming from unsanitized user input, this allows the attacker to execute shell commands:\n\n```rb\nImageProcessing::Vips.apply({ system: \"echo EXECUTED\" })\n#>> EXECUTED\n```\n\nThis method is called internally by Active Storage variants, so Active Storage is vulnerable as well.\n\n### Patches\n\nThe vulnerability has been fixed in version 1.12.2 of image_processing.\n\n### Workarounds\n\nIf you're processing based on user input, it's highly recommended that you always sanitize the user input, by allowing only a constrained set of operations. For example:\n\n```rb\noperations = params[:operations]\n  .map { |operation| [operation[:name], *operation[:value]] }\n  .select { |name, *| name.to_s.include? %w[resize_to_limit strip ...] } # sanitization\n\nImageProcessing::Vips.apply(operations)\n```","published":"2022-03-01T00:00:00Z","modified":"2026-08-12T03:51:41.970802187Z","cvss":{"score":9.8,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"epss":{"score":0.02686,"percentile":0.84661,"asOf":"2026-08-23"},"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"RubyGems","name":"image_processing","fixedVersion":"1.12.2"}],"fix":{"url":"https://github.com/janko/image_processing/commit/038e4574e8f4f4b636a62394e09983c71980dada","label":"janko/image_processing@038e457"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24720.json"},{"type":"ADVISORY","url":"https://github.com/janko/image_processing/security/advisories/GHSA-cxf7-qrc5-9446"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24720"},{"type":"ADVISORY","url":"https://www.debian.org/security/2022/dsa-5310"},{"type":"FIX","url":"https://github.com/janko/image_processing/commit/038e4574e8f4f4b636a62394e09983c71980dada"},{"type":"PACKAGE","url":"https://github.com/janko/image_processing"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/image_processing/CVE-2022-24720.yml"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:41.970802187Z"}}