Summary
CVE-2026-66066 is a critical vulnerability in Ruby on Rails Active Storage. When Active Storage generates image variants with libvips, it does not disable libvips operations that are marked unsafe for untrusted content, allowing a crafted upload to invoke such an operation. This enables unauthenticated arbitrary file read and, through leaked secrets, potential remote code execution. It carries a CVSS 4.0 base score of 9.5 (Critical).
Technical details
- Root cause: libvips ships operations that are unsafe (unfuzzed) for untrusted content; Active Storage failed to block these operations when processing variants of user-supplied files (CWE-1188, Insecure Default Initialization of Resource).
- Trigger conditions: A Rails application that uses Active Storage with the libvips variant processor and accepts untrusted file uploads, then generates variants of those uploads.
- Attack vector: Network. An unauthenticated attacker uploads a specially crafted file that causes an unsafe libvips operation to run during variant processing.
- Impact: Arbitrary reading of files accessible to the Rails process, including the process environment, which commonly exposes credentials such as
secret_key_base. Exposure of such secrets can enable remote code execution or lateral movement.
Affected software
- Active Storage / Rails
< 7.2.3.2 - Active Storage / Rails
>= 8.0.0,< 8.0.5.1 - Active Storage / Rails
>= 8.1.0,< 8.1.3.1
Severity
- CVSS 4.0 base score: 9.5 (Critical)
- Vector:
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Mitigation and recommended actions
- Immediate: Upgrade to a fixed release — Rails
7.2.3.2,8.0.5.1, or8.1.3.1. - If no patch can be applied, workarounds:
- With libvips
>= 8.13, set theVIPS_BLOCK_UNTRUSTEDenvironment variable. - With ruby-vips
>= 2.2.1, callVips.block_untrusted(true). - Remove the ruby-vips dependency if it is not required for other purposes.
- With libvips

