Skip to content
Beveiligingsnieuws

Rails Critical Vulnerability: RCE Risk Patched

impliciet vertrouwen in Rails

This week, Ruby on Rails maintainers released patches for a Rails critical vulnerability that can have serious consequences in affected deployments. According to the advisory, the flaw is tied to how Rails processes image variants and uses the libvips library for Active Storage.

The concern is not only about data exposure. Under certain conditions, the disclosed information can be leveraged to escalate the attack toward remote code execution (RCE). If you run Rails applications that accept image uploads from untrusted users, this update deserves immediate attention.

What is the Rails critical vulnerability?

The vulnerability is tracked as CVE-2026-66066 and carries a CVSS score of 9.5, reflecting its high severity. The issue is described as an arbitrary file read that may reveal sensitive secrets stored in the application environment.

In the default configuration, a Rails application that shows image variants could be vulnerable to an unauthenticated attacker attempting to read files from the server. The advisory specifically notes that the process environment may be accessible in this scenario, which is where many applications keep credentials and other security-sensitive values.

How an attacker could reach remote code execution

The most damaging part of the chain comes from what an attacker can obtain after the file read. Once the environment is exposed, the advisory explains that attackers may find high-value items such as secret_key_base and credentials for external systems.

With those secrets, an attacker may be able to pivot to more advanced actions, including remote code execution or lateral movement to other systems. In other words, the initial weakness is a data disclosure problem, but it can become an execution problem depending on how the application is configured and how the secrets are used.

Which Rails setups are affected?

This issue impacts applications that use libvips for Active Storage image processing and that allow image uploads from users who cannot be fully trusted. In practical terms, if your app accepts images from the public (or any group you treat as untrusted) and then processes those images into variants, you should assume you are at risk until you patch.

The advisory highlights a specific technical detail: libvips marks some file read and write operations as “unfuzzed,” meaning they are not considered safe for untrusted content. If Active Storage does not disable these unfuzzed operations, the protection gap can be exploited.

Why crafted files matter

Because the unfuzzed operations were not disabled, an attacker could upload a crafted file designed to trigger one of those unsafe operations. Once the server processes the upload, the attacker may be able to disclose the contents of arbitrary files that the application process can access.

The advisory describes the mechanism in similar terms: by submitting a crafted upload, an attacker can cause disclosure of file contents available on the targeted application’s filesystem.

Patched versions and what to update

The Rails team states that CVE-2026-66066 was patched in specific Active Storage versions:

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

Users are advised to update their deployments as soon as possible. In addition, the advisory recommends updating libvips to at least version 8.13, because earlier releases do not provide support for disabling unfuzzed operations.

Put simply: patching Rails/Active Storage closes the reported vulnerability, but you should also align your library dependencies so the underlying unsafe behavior is properly mitigated.

Do you need to treat secrets as exposed?

Yes. Even if you patch quickly, the advisory is clear that updates do not “undo” any data that may have already been leaked.

Rails maintainers note that upgrading closes the vulnerability but does not reverse exfiltration that may have occurred before the patch. As a result, an affected application should treat every secret readable by the application process as potentially compromised. That means rotating credentials, updating keys, and reviewing any secrets accessible via environment variables or other readable sources.

Is there evidence of active exploitation?

As of July 30, cybersecurity firm Rapid7 reported that there is no evidence that this security defect has been exploited in the wild. While that is reassuring, it does not remove the need to patch.

High-severity issues like this are often targeted quickly once details become available. If your application matches the affected conditions—Active Storage with libvips and untrusted image uploads—patching now is the safest approach.

Practical next steps for teams running Rails

If you maintain Rails services, consider the following actions to reduce risk:

  • Verify your Active Storage version and upgrade to one of the patched releases listed in the advisory.
  • Update libvips to version 8.13 or newer to ensure unfuzzed operations can be disabled.
  • Review upload flows to confirm whether untrusted users can upload images that your app processes into variants.
  • Rotate secrets that the application process can access (especially items like secret_key_base and third-party credentials).
  • Monitor for suspicious activity around file access patterns, authentication attempts, and unusual outbound connections.

These steps help reduce the chance that the original weakness turns into a broader compromise.

Bottom line

The Rails critical vulnerability tracked as CVE-2026-66066 centers on arbitrary file read behavior in configurations involving Active Storage image processing. While it starts as a disclosure issue, exposed environment data such as secrets can enable escalation to remote code execution in certain scenarios.

Patch your deployments to the fixed Active Storage versions and update libvips to at least 8.13. Then assume secrets may be exposed until proven otherwise, rotating anything the application can read. By acting now, you can close the vulnerability and limit the blast radius if exploitation ever occurred.

Source: https://www.securityweek.com/ruby-on-rails-patches-critical-vulnerability/