FR
live

CVE-2026-66066 breaks Rails Active Storage — one upload is all it takes to steal your master key and get RCE

On August 1, 2026, the Rails team patched CVE-2026-66066, a critical Active Storage vulnerability that allows unauthenticated arbitrary file read and RCE escalation via libvips. Akamai named the chain 'KindaRails2Shell' and confirmed full remote-code-execution potential.

A fractured ruby gemstone among a row of pristine gems, a yellow glint on the crack

August 1, 2026. The Rails team shipped a patch for CVE-2026-66066, a critical‑severity vulnerability in the Active Storage framework. An unauthenticated attacker can read any file on the server by uploading a crafted image — and, if the process environment contains the secret_key_base, escalate to remote code execution (RCE). Akamai named the chain “KindaRails2Shell.”

The blast radius is enormous. Active Storage is Rails’ built‑in file‑upload handler — enabled by default in the vast majority of Rails 7 and 8 projects. The flaw affects versions before 7.2.3.2, the 8.0.x branch before 8.0.5.1, and 8.1.x before 8.1.3.1. Rails 6.x is only affected if Active Storage was configured outside its defaults.

The vector: libvips, the default image processor

The vulnerability lives in the interaction between Active Storage and libvips, the image processing library used by default in the official Rails Docker images as well as most Debian and Ubuntu setups.

When a user uploads an image, Active Storage can generate thumbnails through libvips. CVE-2026-66066 lets an attacker submit a specially crafted image that tricks libvips into reading arbitrary files from the server. The exploitation prerequisites are minimal:

  • The application allows image uploads from unauthenticated users (contact forms with attachments, public avatars, sign‑up with a photo).
  • libvips is the image processor — which is the default.
  • The installed libvips is older than 8.13.

If all three conditions are met, the attacker can read the contents of the .env file, which typically holds the secret_key_base — the application’s cryptographic master key. According to Akamai, this key can forge session cookies, sign Global IDs, and manipulate serialised data, opening a direct path to full RCE on the underlying server.

No workaround for libvips < 8.13

The Rails team recommends three parallel actions:

  1. Upgrade Rails to the patched releases (7.2.3.2, 8.0.5.1, or 8.1.3.1).
  2. Upgrade libvips to 8.13 or later. For administrators already running libvips ≥ 8.13, a temporary mitigation exists: set the VIPS_BLOCK_UNTRUSTED environment variable or call Vips.block_untrusted(true) with ruby‑vips ≥ 2.2.1.
  3. Full secret rotation: secret_key_base, database credentials, Active Storage service keys, and every other secret accessible to the application process.

For applications using libvips before 8.13, there is no workaround. Upgrading libvips is mandatory.

ImageMagick users are not affected by this specific vector. However, libvips remains the default processor in the modern Rails ecosystem, so most production deployments are exposed.

Disclosure accelerated by public PoC

The Rails team had originally planned to publish full technical details on August 28, 2026 — a one‑month window for administrators to patch. That plan was upended when public proof‑of‑concept (PoC) exploits appeared within days of the patch release.

The maintainers then chose to publish the full technical breakdown along with a forensic investigation toolkit, reasoning that withholding details no longer offered meaningful protection.

The vulnerability was discovered and responsibly disclosed by researchers from Ethiack and GMO Flatt Security Inc. Akamai coordinated with Ethiack ahead of public disclosure to ship WAF protections for its customers.

WAF is a band‑aid, not a fix

Ethiack poured cold water on WAF‑based defences: an attacker armed with AI tooling can reconstruct the attack chain from the patch diff alone. The fix changes libvips’ behaviour inside Active Storage — analysing the diff is enough to infer the vector and build a working exploit.

The message is unambiguous: patching is the only durable defence. A WAF might buy you hours or days, nothing more.

Verdict

If your Rails application accepts file uploads — and almost every Rails app does, if only for avatars or attachments — apply the patch today. The gap between the fix release and public PoCs was measured in days. The gap until mass exploitation will be measured the same way.

Three priorities:

  1. Update Rails (bundle update rails) and libvips (≥ 8.13) immediately. If you use the official Docker image, rebuild with the latest tag.
  2. Rotate every secret after the update — a secret_key_base compromised before the patch remains valid afterwards if you do not change it.
  3. Audit your upload logs for the days leading up to August 1. Look for image uploads from unusual IP addresses or suspicious request patterns hitting Active Storage endpoints.

For applications that cannot be patched immediately, temporarily disable image uploads from unauthenticated users and place the endpoint behind strict authentication.

References

  • Rails Security Advisory, “CVE-2026-66066 — Arbitrary file read in Active Storage,” August 1, 2026
  • Akamai Security Research, “KindaRails2Shell: From File Read to RCE in Rails Active Storage,” August 2026
  • Ethiack, “Responsible Disclosure: Rails Active Storage RCE,” August 2026
  • BleepingComputer, “Rails patches critical Active Storage flaw with RCE potential,” August 1, 2026

The cyber brief, every Tuesday

The flaws that matter and the patches to apply, in a ten-minute read.

No spam. One-click unsubscribe.
read next

On the same topic

ChainDrop infects 1,300 npm packages and 2 billion monthly downloads

A self-propagating **supply-chain** attack named **ChainDrop** compromised over **1,300 packages** on the **npm** registry on **August 4, 2026**. The infected packages accounted for **2 billion monthly downloads** and reached organizations including **Deliveroo**, **Qlik**, and **ServiceTitan**. Audit your dependencies now.

← Back to the feed

Type at least two characters.

navigate open esc dismiss