
Summary
The Ruby on Rails project has patched CVE-2026-66066, dubbed KindaRails2Shell, a critical arbitrary file read and remote code execution vulnerability in Active Storage, the Ruby on Rails framework's built-in file attachment and image-processing component. Applications first became exposed to active exploitation risk around July 29, 2026, when the underlying weakness was identified: Active Storage never disabled libvips operations that the imaging library itself marks as unsafe for untrusted content. Any Ruby on Rails application that uses libvips for Active Storage image processing and accepts image uploads from untrusted users is affected, because Rails selects Vips under load_defaults 7.0, and later defaults retain it.
| CVE | Name | Affected Product | Patch |
|---|---|---|---|
CVE-2026-66066 |
KindaRails2Shell (Ruby on Rails Active Storage Arbitrary File Read Vulnerability) | Ruby on Rails Active Storage | AVAILABLE |
Vulnerability Details
Active Storage never disabled unsafe libvips loaders
The Ruby on Rails project has released fixes for CVE-2026-66066 (KindaRails2Shell), a critical arbitrary file read and remote code execution vulnerability in Active Storage. The flaw stems from Active Storage failing to disable libvips operations that the imaging library itself marks as unsafe for untrusted content. Affected applications use libvips for Active Storage image processing and accept image uploads from untrusted users. Rails selects Vips under load_defaults 7.0, and later defaults retain it.
Unauthenticated file read escalates to secret exposure and RCE
An unauthenticated attacker who can upload an image to an affected Ruby on Rails application can craft a file that libvips will parse through one of these unsafe loaders, causing the application to read a file of the attacker's choosing off the server filesystem and return its contents rendered as image pixels. The files most valuable to an attacker are the ones the Rails process can always reach: the process environment, which typically holds secret_key_base, and the encrypted credentials that the Rails master key unlocks. Once secret_key_base is recovered, the attacker holds the application's master cryptographic key and can forge signed and encrypted material, escalating CVE-2026-66066 into full remote code execution.
The trust boundary between Active Storage and libvips
The root cause of CVE-2026-66066 sits at the trust boundary between Active Storage and libvips rather than in either component's own logic. libvips reads and writes image formats through operations it calls loaders and savers, many of which are backed by third-party libraries and handle formats unrelated to web imagery. libvips itself marks a subset of these operations as unfuzzed, meaning they have not been hardened against hostile input. Since version 8.13, libvips has offered a mechanism to block those operations outright.
No known exploitation, but the vulnerable setting remains widespread
Active Storage never invoked the libvips blocking mechanism, so every unfuzzed loader remained reachable by any file the application handed to the processor. The vulnerable setting is config.active_storage.variant_processor = :vips, which no subsequent Rails default has changed. No threat actor group or malware family has been linked to activity involving CVE-2026-66066, and the Rails Security Team has stated that it is not aware of exploitation attempts before or after disclosure.
| CVE ID | Affected Products | Affected CPE | CWE ID |
|---|---|---|---|
CVE-2026-66066 |
Ruby on Rails Active Storage, all versions before 7.2.3.2; version 8.0 and later, before 8.0.5.1; and version 8.1 and later, before 8.1.3.1. | cpe:2.3:a:rubyonrails:rails:-:*:*:*:*:*:*:* |
CWE-1188 |
Recommendations
Upgrade Active Storage Without Waiting for a Patch Window
Move affected applications to Rails 7.2.3.2, 8.0.5.1, or 8.1.3.1, or a later release on those branches. It's advised to upgrade regardless of how a specific deployment is configured. Applications on Rails 7.1 or earlier will not receive a backport because those branches are end of life, so they must be migrated to a supported fixed branch or run one of the workarounds below indefinitely.
Upgrade libvips as a Separate Task
The fix for CVE-2026-66066 depends on libvips being version 8.13 or later, because earlier builds cannot disable the unsafe operations at all. Upgrading Rails alone leaves an application on older libvips unprotected, and patched Active Storage versions will deliberately raise an exception during boot rather than start in that unsecurable state. Where ruby-vips is installed, ensure it is version 2.2.1 or later. If libvips exists in the dependency tree only for image analysis, removing the ruby-vips gem from the Gemfile is a valid alternative to upgrading it.
Apply the Temporary Workaround Only Where Upgrading Must Wait
On libvips 8.13 or later, the unfuzzed operations can be disabled without upgrading Rails by setting the VIPS_BLOCK_UNTRUSTED environment variable, which libvips reads during initialisation. Applications running ruby-vips 2.2.1 or later can instead call Vips.block_untrusted(true) from an initialiser, which is the same protection the official patch invokes when Active Storage starts. For libvips earlier than 8.13, Rails states there is no workaround other than removing the libvips dependency from the application.
Rotate Every Secret the Application Process Could Read
Upgrading closes CVE-2026-66066 but does nothing about a secret that was already exfiltrated, so treat every secret readable by the application process as potentially exposed and replace it. That list covers secret_key_base, the master key, whether it lives in config/master.key or arrives as RAILS_MASTER_KEY, along with everything in config/credentials.yml.enc that it decrypts, Active Storage service credentials for S3, GCS or Azure, database credentials, and tokens or keys for every third-party service the application calls. Rails is explicit that rotation should only be an intermediate step where unavoidable and that an exposed secret must never be retained as a fallback.
MITRE ATT&CK TTPs
References & Patch Links
The Ruby on Rails release notes and GitHub security advisory detail the fixed Active Storage releases and workarounds for CVE-2026-66066.
What Next?
At Hive Pro, it is our mission to detect the most likely threats to your organization and to help you prevent them from happening.