Overview
On 29 July 2026 a critical vulnerability (CVE‑2026‑66066, nicknamed “KindaRails2Shell”) was disclosed affecting Ruby on Rails’ Active Storage component. An attacker who can upload a crafted file may read arbitrary files on the server and achieve remote code execution (RCE).
Affected Components
- activestorage < 7.2.3.2
- activestorage 8.0 – 8.0.5.1 (pre‑8.0.5.1)
- activestorage 8.1 – 8.1.3.1 (pre‑8.1.3.1)
Conditions Required for Exploitation
- Active Storage is configured to process images with
libvips(variant processor set to:vips). - The application accepts image uploads from untrusted users (direct upload or regular upload endpoint).
- The libvips installation uses a third‑party loader that is classified as “unfuzzed” for untrusted content.
Rails 6.0.0‑6.1.7.10 may be vulnerable if Active Storage is set up with non‑default configurations (per Ethiack). Versions prior to Rails 6.0.0 are reported as not vulnerable (per GMO Flatt).
Exploit Availability
Public proof‑of‑concept (PoC) code and exploit scripts have been released (GitHub advisory GHSA‑xr9x‑r78c‑5hrm, Ethiack blog, Flatt Security blog). JPCERT confirms that exploit code is publicly available, raising the likelihood of active attacks.
Mitigation and Patch
Apply the latest Rails update that addresses the issue. When upgrading, note the following:
- If
libvipsis below 8.13 orruby‑vipsis below 2.2.1, Active Storage will raise an exception on startup. Upgradelibvipsto ≥ 8.13 andruby‑vipsto ≥ 2.2.1 before applying the Rails patch.
For environments that cannot patch immediately, the advisory recommends ensuring libvips ≥ 8.13 or ruby‑vips ≥ 2.2.1 as a temporary mitigation. WAF protection is considered limited and should not replace a proper patch.
Detection (Forensic Investigation)
The Rails team has published forensic tools and a guide (GitHub repository rails-forensics-CVE-2026-66066) to help identify compromise. Review the discussion thread on Ruby on Rails Discussions for detailed attack indicators.
References
- JPCERT‑AT advisory: https://www.jpcert.or.jp/at/2026/at260021.html
- OSV vulnerability record: https://osv.dev/vulnerability/CVE-2026-66066
- GitHub security advisory: GHSA‑xr9x‑r78c‑5hrm
- Ethiack research: https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve-2026-66066
- Flatt Security blog (Japanese): https://blog.flatt.tech/entry/kindarails2shell_rails