KindaRails2Shell

Disclosed Jul 29, 2026

Updated Dec 2, 2026

*2ShellCVSS 9.5ExploitedConditional RCE

A critical Ruby on Rails Active Storage vulnerability caused by failing to disable untrusted libvips image loaders, enabling unauthenticated arbitrary file read of secrets such as secret_key_base and escalation to remote code execution.

Component

Rails Active Storage Variant Processing (libvips Untrusted Operations)

Attack Vector & Class

Conditional RCE

Exploit Chain

Exploitation Status

Exploited in the wild

Public PoC available

CVSS & Ecosystems

9.5 (v4.0)

Ruby, Rails

Affected Versions

  • Ruby on Rails Active Storage 7.0.0–7.2.3.1, 8.0.0–8.0.5, and 8.1.0–8.1.3 (default libvips processor when untrusted uploads are accepted)
  • Ruby on Rails 6.0.0–6.1.7.10 when non-default libvips Active Storage processing is configured

Fixed / Recommended Versions

  • Ruby on Rails / Active Storage 7.2.3.2+, 8.0.5.1+, or 8.1.3.1+ (paired with libvips 8.13+ and ruby-vips 2.2.1+)

Technical Root Cause

Independently reported by Ethiack and GMO Flatt Security, CVE-2026-66066 occurs because Active Storage initialized libvips without blocking operations marked unsafe for untrusted input (CWE-1188). An attacker uploading a polyglot MATLAB/HDF5 file via Active Storage direct-upload endpoints can abuse libmatio's External File List to read arbitrary server files rendered into image pixels—stealing secret_key_base, Rails master keys, and cloud credentials—and then forge signed ImageProcessing variations to achieve RCE. Public PoCs and a Metasploit module followed disclosure, and VulnCheck observed active exploitation in the wild by late August 2026.

Vector: 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

Remediation & Hardening

  1. 1Upgrade Rails / Active Storage to 7.2.3.2, 8.0.5.1, or 8.1.3.1 AND verify system libvips is 8.13+ (and ruby-vips 2.2.1+); upgrading Rails alone is insufficient on older libvips.
  2. 2As an interim mitigation on libvips 8.13+, set the VIPS_BLOCK_UNTRUSTED environment variable or call Vips.block_untrusted(true) in an initializer.
  3. 3Run Rails' forensic checks on Active Storage blobs and rotate secret_key_base, Rails master keys, and application credentials if exposed before patching.