A newly disclosed vulnerability in Ruby on Rails’ Active Storage component has drawn serious attention from the security community after researchers demonstrated a complete chain from server secret exposure to remote code execution.
Tracked as CVE-2026-66066 (GHSA-xr9x-r78c-5hrm), the flaw affects Active Storage releases before 7.2.3.2, as well as vulnerable Rails 8.0 and 8.1 releases, when applications use the Vips variant processor for image handling.
The vulnerability stems from an untrusted-loader issue in how Active Storage interacts with libvips during image variant processing.
Attackers can craft a direct-upload blob that, when processed through an Active Storage representation response, allows them to recover readable file content from the server. This is not a simple information leak.
Critical Rails Flaw
Once attackers extract sufficient data, they can derive the Active Storage verifier key from recovered Rails signing material and then forge a signed ImageProcessing variation that executes arbitrary commands on the underlying system.
A Metasploit module submitted by researcher jburgess-r7 demonstrates the practical severity of this flaw. The module, exploit/multi/http/rails_activestorage_vips_rce, implements the full attack chain documented in a Rails forensic analysis repository.
It supports secret recovery from multiple sources including /proc/self/environ, /proc/1/environ, local Rails secret files, encrypted credentials, and legacy secrets.yml configurations.
The exploit works across SHA-1, SHA-256, SHA-384, and SHA-512 key-generator combinations and handles JSON, Marshal, and MessagePack-compatible signed message formats.
Jburgess stated that a particularly effective exploit is its resize-tolerant exfiltration technique, which uses multiple square HDF5 layouts combined with Vips sharpen inversion to reliably extract data regardless of how the target application resizes images.
The module also accommodates both modern redirect routes and legacy Rails 6 representation routes, broadening its reach across different application versions.
In validated lab testing against Rails 8.0.5 and Rails 6.0.6.1 targets, the exploit successfully recovered SECRET_KEY_BASE from process environment variables, derived the correct verifier key, and opened command shell sessions running as the Rails process user.
Testing also confirmed the exploit fails safely against patched Rails 8.0.5.1 targets, returning HTTP 500 errors when SECRET_KEY_BASE isn’t already known to the operator.
Notably, the module deliberately omits certain research-only techniques documented by the original discoverers, including a /proc/self/mem verifier-key recovery path and an instance_eval-based RCE variation.
The developer explained that the representation-based PNG transport method used in the released module produces larger, more reliably verifiable reads suited for automated secret recovery, making it preferable for practical exploitation over narrower metadata-based channels.
Organizations running Rails applications with Active Storage and the Vips variant processor should immediately prioritize patching to Active Storage 7.2.3.2 or later.
Given the module’s demonstrated reliability across multiple Rails versions and its support for reverse shell payloads including cmd/unix/reverse_bash and Meterpreter, defenders should treat this as a critical, actively exploitable risk rather than a theoretical concern.
Cut SOC investigation blind spots and contain threats earlier to reduce response costs and business disruption with ANY.RUN.