Exploit database

Vulnerability

CVE-2026-66066

Action Pack: Possible arbitrary file read and remote code execution in Active Storage variant processing

Vulnerability details

Score
9.5
Severity
critical

CVSS 4.0 · GitHub_M

Vector string

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

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.

CVE Program

Exploit source choices

7 sources
Ruby on Rails Active Storage Vips Arbitrary File Read and Remote Code Execution
MSF-multi--http--rails_activestorage_vips_rceMetasploitLinux,Ruby,Unix / remotePreferred

This module exploits CVE-2026-66066 in Ruby on Rails Active Storage when the application uses the Vips variant processor and accepts untrusted image uploads. A crafted MATLAB v7.3/HDF5 image uses external storage to read text files accessible to the Rails worker through a PNG representation response. The module recovers secret_key_base from the process environment, Rails local secrets, encrypted credentials, or the legacy secrets.yml(.enc) files. It then forges a serializer-compatible variation whose ImageProcessing apply step reaches Kernel#spawn with a command payload, or Kernel#eval with a native Ruby payload when the Ruby target is selected. Neither path requires a Marshal object gadget. The Ruby target's initial code execution does not require a Unix shell or a fetch utility on the target. The file-read stage needs a genuine signed Active Storage variation key. It can use VARIATION_KEY directly, reuse a representation URL from the application, or create one through an application upload form. Supplying SECRET_KEY_BASE skips the arbitrary file-read stage and lets the module construct the standard representation route itself. The file-read stage affects Rails 6.0 and 6.1, Rails 7.0 through 7.2.3.1, Rails 8.0.0 through 8.0.5, and Rails 8.1.0 through 8.1.3. It is fixed in Rails 7.2.3.2, 8.0.5.1, and 8.1.3.1. The RCE stage combines an incomplete Vips-side fix for CVE-2025-24293 with ImageProcessing 1.x method dispatch; ImageProcessing 2.x blocks this chain.

2026-07-29rails_activestorage_vips_rce.rb
rails/rails-forensics-cve-2026-66066
GH-0bf0461ee352d98af34ba79de7f55b74GitHubUnofficial GitHub source

rails/rails-forensics-cve-2026-66066 source repository

2026-07-3028 files · 30 stars
zer0sumgam3/cve-2026-66066-poc
GH-f0f54f9b2cb3b3c0c3fa8579bf72ca70GitHubUnofficial GitHub source

PoC for CVE-2026-66066 in Ruby on Rails

2026-07-2910 files · 24 stars
0xsha/kindarails2shell
GH-011ce26cb8990657315890da7bdbe4bcGitHubUnofficial GitHub source

CVE-2026-66066 + File Read, RCE, Scanner, Lab

2026-07-3117 files · 5 stars
hackspeak/cve-2026-66066
GH-908c996ea4eb087d92ba21d5b15edd23GitHubUnofficial GitHub source

CVE-2026-66066 (KindaRails2Shell) PoC - Rails Active Storage/libvips arbitrary file read to RCE; for authorized security testing

2026-08-033 files · 4 stars
shinthink/cve-2026-66066
GH-bcd3daf9ddbe3d4f766c6b95611392cfGitHubUnofficial GitHub source

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

2026-08-045 files · 1 stars