>samit_hota
Back to security news
SN-2026-269CriticalMitigated

Ruby on Rails Patches Critical RCE Flaw CVE-2026-66066 in Active Storage

Samit Hota·
CVE ID
CVE-2026-66066
Affected Products / Orgs
Ruby on Rails Active Storage (versions using libvips), libvips prior to 8.13
#news#vulnerability-disclosure#ruby

Ruby on Rails maintainers have issued security updates to fix a critical vulnerability, tracked as CVE-2026-66066, in the framework’s Active Storage component. Carrying a CVSS severity score of 9.5, the flaw allows unauthenticated remote attackers to read arbitrary files from the underlying server filesystem when image processing is handled via the libvips library. Under standard Rails application configurations, this exposure leaks process environments and core cryptographic secrets, allowing attackers to escalate arbitrary file reads into unauthenticated remote code execution (RCE) or lateral movement across target networks.

The issue impacts Rails applications configured to process image variants using libvips that allow untrusted users to upload image files. Rapid7 reported no evidence of active exploitation in the wild as of July 30, but the simplicity of file read primitives and the high potential for full application compromise make prompt remediation critical.

Unauthenticated Arbitrary File Read in Active Storage

Active Storage is the built-in Rails framework responsible for uploading files to cloud storage services or local disks and generating transformed file variants—such as image thumbnails or resized uploads. To perform high-performance image manipulation, many Rails deployments rely on libvips as their underlying image processing engine instead of traditional alternatives like ImageMagick.

The vulnerability stems from how libvips handles certain internal file read and write routines. Within libvips, several complex format parser and file handling operations are explicitly designated as “unfuzzed,” meaning they were never intended or hardened to safely parse untrusted content from unknown sources. In affected configurations, Active Storage failed to disable these unfuzzed operations when invoking libvips on user-supplied files.

An unauthenticated attacker can exploit this oversight by uploading a specially crafted file to an application endpoint that triggers Active Storage image variant generation. When libvips processes the malicious file, it executes one of the unsafe, unfuzzed operations, allowing the attacker to retrieve and view arbitrary file contents stored on the host filesystem accessible to the web application process.

How File Read Escalates to Remote Code Execution

While CVE-2026-66066 is fundamentally an arbitrary file read flaw, its operational impact in a Ruby on Rails environment frequently reaches full remote code execution.

In Linux-based containerized and system deployments, an attacker capable of arbitrary file reads can target virtual filesystems such as /proc/self/environ to dump the live environment variables of the running Rails process. In modern cloud-native architectures, these environment variables regularly store critical secrets, including database connection strings, third-party API keys, AWS credentials, and the fundamental Rails application secret: secret_key_base.

In Ruby on Rails, secret_key_base acts as the root key for signing and encrypting session cookies, signed URLs, and encrypted message attributes. Once an attacker obtains secret_key_base, they can forge arbitrary administrative session cookies or inject forged serialized Ruby objects into application endpoints. In many Rails versions and configurations, possessing secret_key_base allows an attacker to construct a valid signed payload that triggers Ruby deserialization routines, turning file read access into complete, unauthenticated remote code execution. Furthermore, leaked cloud service keys or database strings contained within the same environment provide immediate paths for lateral movement across backend infrastructure.

Why Updating Rails Is Only Half the Patch

Addressing CVE-2026-66066 requires updating both the Rails application gems and the underlying host operating system dependencies.

Maintainers have released fixed versions of Active Storage across all active release trains:

  • Active Storage 7.2.3.2
  • Active Storage 8.0.5.1
  • Active Storage 8.1.3.1

However, simply updating the Gem dependencies in a project’s Gemfile is insufficient on its own. The underlying libvips C library must also be updated to at least version 8.13. Releases of libvips prior to version 8.13 lack the explicit programmatic flags required by Active Storage to disable unfuzzed operations during image parsing. If an application updates Active Storage but remains running on an outdated libvips system package, the application may remain exposed or fail to properly enforce safety boundaries.

Secret Exposure and Required Remediation

The Rails maintainers emphasized a critical caveat regarding post-patch recovery: updating the software stops future file read attempts, but it does nothing to neutralize secrets that may have already been exfiltrated prior to patching.

Organizations running affected configurations should execute a two-part response strategy immediately:

  1. Deploy Software Updates: Upgrade Active Storage to version 7.2.3.2, 8.0.5.1, or 8.1.3.1, and verify that the underlying host system or container image runs libvips version 8.13 or higher.
  2. Execute Complete Secret Rotation: Treat every environment variable, database credential, and configuration secret accessible to the application process as exposed. Rotate secret_key_base, invalidate all active user and admin session cookies, cycle database access credentials, and issue new API keys for all external services connected to the application.

Found something similar in your stack?

Let's find out before it becomes an incident.

Book an advisory call