# CVE-2026-66066: Action Pack: Possible arbitrary file read and remote code execution in Active Storage variant processing

> An unauthenticated attacker can read arbitrary files and potentially execute code via crafted image uploads in Rails Active Storage when libvips is enabled.

- **Severity:** Critical 9.5 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jul 2026
- **Updated:** 5 Aug 2026
- **Also known as:** DEBIAN-CVE-2026-66066, GHSA-xr9x-r78c-5hrm, MINI-7f33-vgrw-r7jw, MINI-gcm3-57wr-92c6, UBUNTU-CVE-2026-66066

## What is CVE-2026-66066?

CVE-2026-66066 is a critical path traversal vulnerability in rails, published on 30 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Action Pack is a framework for handling and responding to web requests. In versions prior to 7.2.3.2, 8.0.5.1 and 8.1.3.1, Active Storage does not disable libvips operations marked unsafe for untrusted content, allowing a crafted upload to invoke such an operation. Consuming applications are affected when configured to use libvips and accept image uploads from untrusted users. An unauthenticated attacker may exploit this behavior to read arbitrary files accessible to the Rails process, including environment variables and application secrets. Exposure of credentials such as secret_key_base or external-service tokens may enable remote code execution or lateral movement. This issue has been fixed in versions 7.2.3.2, 8.0.5.1 and 8.1.3.1.

Weakness: CWE-1188 (Initialization of a Resource with an Insecure Default)

## Which versions are affected by CVE-2026-66066?

6 open source packages ship an affected version, including activestorage.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `activestorage` | RubyGems | All versions | 7.2.3.2 |
| `activestorage` | RubyGems | All versions | 7.2.3.2 |
| `activestorage` | RubyGems | From 8.0.0.beta1 | 8.0.5.1 |
| `activestorage` | RubyGems | From 8.0.0.beta1 | 8.0.5.1 |
| `activestorage` | RubyGems | From 8.1.0.beta1 | 8.1.3.1 |
| `activestorage` | RubyGems | From 8.1.0.beta1 | 8.1.3.1 |

## How do I fix CVE-2026-66066?

Upgrade activestorage to a fixed version for your release line: 7.2.3.2, 8.0.5.1 or 8.1.3.1.

## Is CVE-2026-66066 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-66066 exists.

Public exploit code:

- https://github.com/rails/rails-forensics-CVE-2026-66066 (github_poc): https://github.com/rails/rails-forensics-CVE-2026-66066
- PoC for CVE-2026-66066 in Ruby on Rails (github_poc): https://github.com/Zer0SumGam3/CVE-2026-66066-POC
- CVE-2026-66066 + File Read, RCE, Scanner, Lab  (github_poc): https://github.com/0xsha/KindaRails2Shell
- CVE-2026-66066 (KindaRails2Shell) PoC - Rails Active Storage/libvips arbitrary file read to RCE; for authorized security testing (github_poc): https://github.com/HackSpeak/CVE-2026-66066
- CVE-2026-66066 (github_poc): https://github.com/0xredash/CVE-2026-66066
- CVE-2026-66066 — KindaRails2Shell: Rails Active Storage/libvips Arbitrary File Read → RCE. MATLAB/HDF5 dual-identity file → SECRET_KEY_BASE theft → forged variation. CVSS 9.5 | Rails < 8.1.3.1 (github_poc): https://github.com/shinthink/CVE-2026-66066

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-66066 and fix it if it is affected.

What it is: CVE-2026-66066 is a critical path traversal vulnerability in rails, published on 30 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-66066 exists.

Affected packages and fixed versions:
- activestorage (RubyGems): affected all versions; fixed in 7.2.3.2
- activestorage (RubyGems): affected all versions; fixed in 7.2.3.2
- activestorage (RubyGems): affected from 8.0.0.beta1; fixed in 8.0.5.1
- activestorage (RubyGems): affected from 8.0.0.beta1; fixed in 8.0.5.1
- activestorage (RubyGems): affected from 8.1.0.beta1; fixed in 8.1.3.1
- activestorage (RubyGems): affected from 8.1.0.beta1; fixed in 8.1.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-66066/ (Markdown: https://insights.sbomify.com/CVE-2026-66066/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-66066
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-66066
- OSV: https://osv.dev/vulnerability/CVE-2026-66066

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-66066/
Summaries are generated and may contain mistakes; the official description above is the record.
