Critical Ruby on Rails Vulnerability Disclosed in Active Storage (CVE-2026-66066)
- CVE ID
- CVE-2026-66066
- Affected Products / Orgs
- Ruby on Rails Active Storage (v6.0.0 through v8.1.3 using libvips)
A critical Ruby on Rails Active Storage vulnerability tracked as CVE-2026-66066 allows unauthenticated remote attackers to read arbitrary files from application servers. By uploading specially crafted image files to any endpoint accepting untrusted uploads, attackers can breach the process boundary and exfiltrate highly sensitive configuration data. The security flaw carries a CVSS severity score of 9.5 and impacts Rails applications configured to process image attachments using the libvips library.
Because the flaw grants direct access to environment variables and configuration files, an attacker can extract critical application secrets—including secret_key_base, the Rails master key, cloud storage credentials, and database connection strings—frequently turning an arbitrary file read into complete server compromise.
How the libvips Trust Boundary Failed
Active Storage relies on third-party image libraries to parse uploads, generate thumbnails, extract metadata, and transform images. Starting with Rails 7.0 (load_defaults 7.0), Rails switched its default image processing engine from MiniMagick to libvips due to its superior memory management and speed.
However, libvips supports a vast collection of image formats, loaders, and savers, many of which rely on legacy code or third-party format delegates. Within libvips, complex or unverified format handlers are internally marked as “untrusted” or “unfuzzed” because they are unsafe to execute against untrusted input from the open internet.
The core vulnerability in Active Storage is an improper trust boundary enforcement. Neither the Active Storage Vips analyzer (which inspects uploaded files upon receipt) nor the Vips transformer blocked these unsafe operations. When an untrusted user uploads a crafted payload, Active Storage passes the file directly to libvips, which invokes an untrusted loader or file-access operation. This grants the attacker an arbitrary file-read primitive executed with the privileges of the underlying Rails worker process.
An application does not need to expose an explicit image resizing or variant endpoint to be exposed. The flaw is triggered as soon as Active Storage analyzes an incoming file attachment, meaning standard image upload fields across an application are vulnerable.
Realistic Blast Radius: From File Read to Remote Code Execution
In Ruby on Rails applications, an arbitrary file-read primitive is rarely just an information disclosure issue; it is almost always a stepping stone to full Remote Code Execution (RCE) or complete environment compromise.
If an attacker uses CVE-2026-66066 to read /proc/self/environ or inspect configuration files on disk, the blast radius typically includes:
secret_key_baseand Session Secrets: Withsecret_key_base, an attacker can forge signed or encrypted session cookies. Depending on the application’s serialization setup, forged session state can allow attackers to gain administrative sessions or execute arbitrary Ruby code via deserialization vectors.- Rails Master Key and Decrypted Credentials: Access to
config/master.keyallows an attacker to decryptconfig/credentials.yml.enc, revealing plain-text production secrets. - Cloud Infrastructure Keys: Active Storage configurations routinely hold AWS S3, Google Cloud Storage, or Azure Blob storage API keys. Stolen cloud credentials allow attackers to read, alter, or delete underlying data stores across the organization’s cloud tenant.
- Database Credentials: Plain-text database passwords allow direct lateral movement into production databases if management ports or internal networks are reachable.
Scope and Affected Versions
The vulnerability affects installations using libvips across multiple major Rails release trains:
- Rails 8.1.x: Versions 8.1.0 through 8.1.3 (fixed in 8.1.3.1)
- Rails 8.0.x: Versions 8.0.0 through 8.0.5 (fixed in 8.0.5.1)
- Rails 7.2.x: Versions 7.2.0 through 7.2.3.1 (fixed in 7.2.3.2)
- Rails 7.0.x & 7.1.x: All releases in these branches are vulnerable when using
libvips. Because Rails 7.0 and 7.1 have reached End of Life (EOL), no patches will be issued for them; applications running these versions must upgrade to Rails 7.2.3.2 or higher. - Rails 6.0.x & 6.1.x: Versions 6.0.0 through 6.1.7.10 are vulnerable only if explicitly configured to use
libvipsinstead of the default MiniMagick processor.
Applications using MiniMagick exclusively as their Active Storage engine are not vulnerable to this specific attack vector. At the gem level, the vulnerability spans activestorage < 7.2.3.2.
Mitigation and Secret Rotation Requirements
Remediating CVE-2026-66066 requires a combination of dependency updates, configuration adjustments, and mandatory post-patch operational cleanup.
1. Update Packages
Deploy updated Rails releases immediately:
- Upgrade to Rails 7.2.3.2, 8.0.5.1, or 8.1.3.1.
- Ensure system dependencies are updated: the patch requires libvips 8.13 or later and the ruby-vips 2.2.1 or later gem wrapper.
2. Immediate Workarounds
If upgrading Rails immediately is not feasible, operators running libvips >= 8.13 can explicitly enforce trust boundaries in one of two ways:
- Set the environment variable
VIPS_BLOCK_UNTRUSTED=1in the worker process environment. - Add
Vips.block_untrusted(true)to an application initializer (requiresruby-vips >= 2.2.1).
Applications running older versions of libvips that cannot be updated immediately should temporarily switch their Active Storage processor to MiniMagick or disable file upload handling until dependencies can be upgraded.
3. Rotate All Process Secrets
Applying code patches prevents future file reads, but it does not invalidate credentials that may have already been extracted. Any organization running a vulnerable configuration must assume application-accessible secrets may be compromised and execute a full key rotation:
- Generate a new
secret_key_baseand rotate session store keys. - Re-key the Rails master key (
config/master.key) and re-encrypt application credentials. - Rotate all production database credentials, cloud storage access keys, and third-party API tokens exposed to the application process environment.
The flaw was independently discovered and reported by André Baptista, Bruno Mendes, and Rafael Castilho of Ethiack, alongside RyotaK of GMO Flatt Security. While technical details and proof-of-concept code remain embargoed until late August 2026, immediate patching is critical before exploit payloads circulate broadly.
Related content
Critical Rails Active Storage Vulnerability CVE-2026-66066 Allows Server RCE
Security NewsRuby on Rails Patches Critical File Read and RCE Flaw in Active Storage
Security NewsRuby on Rails Patches Critical RCE Flaw CVE-2026-66066 in Active Storage
Security NewsCertighost Exploit Enables Domain Controller Impersonation via Misconfigured AD CS
Found something similar in your stack?
Let's find out before it becomes an incident.
Book an advisory call