Code execution through image_processing operation dispatch
Published: November 21, 2026
SECURITY IDENTIFIERS
- GHSA: GHSA-jm85-wxjw-3vv5
- Vendor Advisory: https://github.com/janko/image_processing/security/advisories/GHSA-jm85-wxjw-3vv5
GEM
SEVERITY
CVSS v3.x: 9.8 (Critical)
PATCHED VERSIONS
>= 2.0.3
DESCRIPTION
Impact
When operations passed to #apply come from unsanitized user input, an
attacker can execute arbitrary Ruby code by going through the #operation
meta-builder.
This bypasses both the public_send fix for CVE-2022-24720 (1.12.2) and the
operation denylist added in 2.0.0. It affects both ImageProcessing::Vips and
ImageProcessing::MiniMagick, regardless of the web framework.
Patches
The vulnerability has been fixed in version 2.0.3 of image_processing, which
validates operation names at the point of dispatch, covering #operation,
#method_missing and nested #send calls. Version 2.2.1 replaces the
denylist with an allowlist of known operation owners, so upgrading to the
latest version is recommended.
Workarounds
Sanitize user input by allowing only a constrained set of operations before
passing them to #apply:
ALLOWED = %w[resize_to_limit resize_to_fill strip]
operations = params[:operations]
.map { |operation| [operation[:name], *operation[:value]] }
.select { |name, *| ALLOWED.include?(name.to_s) }
ImageProcessing::Vips.apply(operations)
