{"id":"CVE-2022-24720","aliases":["CVE-2022-24720","GHSA-cxf7-qrc5-9446"],"related":[],"kind":"vulnerability","state":"published","title":"Improper Input Validation in image_processing","summary":"image_processing is an image processing wrapper for libvips and ImageMagick/GraphicsMagick. Prior to version 1.12.2, using the `#apply` method from image_processing to apply a series of operations that are coming from unsanitized user input allows the attacker to execute shell commands. This method is called internally by Active Storage variants, so Active Storage is vulnerable as well. The vulnerability has been fixed in version 1.12.2 of image_processing. As a workaround, users who process based on user input should always sanitize the user input by allowing only a constrained set of operations.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"image_processing is an image processing wrapper for libvips and ImageMagick/GraphicsMagick. Prior to version 1.12.2, using the `#apply` method from image_processing to apply a series of operations that are coming from unsanitized user input allows the attacker to execute shell commands. This method is called internally by Active Storage variants, so Active Storage is vulnerable as well. The vulnerability has been fixed in version 1.12.2 of image_processing. As a workaround, users who process based on user input should always sanitize the user input by allowing only a constrained set of operations.","source":"cvelist"},{"lang":"en","text":"### 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```","format":"markdown","source":"ghsa"},{"lang":"es","text":"image_processing es una envoltura de procesamiento de imágenes para libvips e ImageMagick/GraphicsMagick. En versiones anteriores a 1.12.2, usar el método \"#apply\" de image_processing para aplicar una serie de operaciones que provienen de una entrada de usuario no saneada permite al atacante ejecutar comandos del shell. Este método es llamado internamente por las variantes de Active Storage, por lo que Active Storage también es vulnerable. La vulnerabilidad ha sido corregida en versión 1.12.2 de image_processing. Como medida de mitigación, los usuarios que procesan en base a la entrada del usuario deben siempre sanear la entrada del usuario permitiendo sólo un conjunto restringido de operaciones","source":"nvd"}],"published":"2022-03-01T00:00:00.000Z","modified":"2026-06-17T04:32:22.093Z","severity":{"scorer":"GitHub_M","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_M","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":"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:L/Au:N/C:C/I:C/A:C","score":10,"rating":"HIGH"}],"cwes":["CWE-20","CWE-78"],"affected":[{"ranges":[{"version":"< 1.12.2","status":"affected"}],"vendor":"janko","product":"image_processing","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.12.2"}],"ecosystem":"RubyGems","package":"image_processing","purl":"pkg:gem/image_processing","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.12.2"}],"vendor":"image_processing_project","product":"image_processing","cpe":"cpe:2.3:a:image_processing_project:image_processing:*:*:*:*:*:ruby:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/janko/image_processing/security/advisories/GHSA-cxf7-qrc5-9446","tags":["exploit","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/janko/image_processing/commit/038e4574e8f4f4b636a62394e09983c71980dada","tags":["patch","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.debian.org/security/2022/dsa-5310","tags":["third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24720","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/janko/image_processing","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/image_processing/CVE-2022-24720.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2025-04-22T15:37:38.696Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-24720","url":"https://www.cve.org/CVERecord?id=CVE-2022-24720","licence":"CVE Terms of Use","modified":"2025-04-22T18:21:17.800Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cxf7-qrc5-9446","url":"https://github.com/advisories/GHSA-cxf7-qrc5-9446","licence":"CC-BY-4.0","modified":"2023-11-08T04:08:33.532Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-24720","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24720","licence":"Public domain","modified":"2026-06-17T04:32:22.093Z"}],"updatedAt":"2026-11-25T22:58:09.879Z","epss":{"score":0.02686,"percentile":0.8626,"date":"2026-12-01T12:00:22.000Z"}}