


Perceptive Security
SOC/SIEM Consultancy

Critical Rails Flaw Could Let Unauthenticated Attackers Read Server Files via Image Uploads
Published:
29 juli 2026 om 20:10:00
Alert date:
29 juli 2026 om 21:00:49
Source:
thehackernews.com
Web Technologies, Zero-Day Vulnerabilities, Supply Chain & Dependencies, Data Breach & Exfiltration
A critical vulnerability tracked as CVE-2026-66066 (CVSS 9.5) has been discovered in Ruby on Rails' Active Storage component. The flaw allows unauthenticated attackers to read arbitrary files from application servers by uploading specially crafted images. Sensitive data exposed includes the Rails process environment, secret_key_base, Rails master key, database passwords, and cloud storage credentials. Ruby on Rails has released patches to address the vulnerability. The high CVSS score and unauthenticated attack vector make this a severe risk for any Rails application using Active Storage. Organizations running affected Rails versions are urged to apply fixes immediately to prevent potential data exposure and server compromise.
Technical details
CVE-2026-66066 is a critical vulnerability (CVSS 9.5) in Ruby on Rails' Active Storage component. The flaw exists at the trust boundary between Active Storage and libvips. libvips supports loaders, savers, and other operations, some backed by third-party libraries marked 'unfuzzed' or 'untrusted' because they are unsafe for hostile input. Active Storage failed to block these untrusted operations, allowing a crafted image upload to invoke one and disclose arbitrary files readable by the Rails worker process. Both the Vips analyzer and transformer passed untrusted attachments to the unsafe operations. A successful exploit gives an unauthenticated attacker an arbitrary file-read primitive, potentially exposing secret_key_base, Rails master key, database passwords, cloud storage credentials, and API tokens. These extracted secrets could further enable remote code execution (RCE) or lateral movement into connected systems. Generating image variants is not a prerequisite for exploitation. The fix calls Vips.block_untrusted(true) when Active Storage starts. No proof-of-concept was publicly available as of July 29, 2026 at 17:30 UTC, and no in-the-wild exploitation had been reported.
Mitigation steps:
1. Upgrade Ruby on Rails to patched versions: 7.2.3.2, 8.0.5.1, or 8.1.3.1. Applications on Rails 7.0 or 7.1 (end of life) must upgrade to 7.2.3.2 or later. 2. Upgrade libvips to version 8.13 or later. 3. If ruby-vips is installed, upgrade to version 2.2.1 or later. 4. As a temporary mitigation if immediate Rails upgrade is not possible: set the VIPS_BLOCK_UNTRUSTED environment variable when running libvips 8.13+, or call Vips.block_untrusted(true) with ruby-vips 2.2.1+. 5. If unable to upgrade libvips to 8.13+, remove libvips from the application entirely. 6. Rotate all secrets readable by the application process including: secret_key_base, Rails master key and decrypted credentials, database credentials, Active Storage service keys, and all third-party API tokens. Note: applying the patch does not invalidate credentials that may have already been stolen. 7. Applications using MiniMagick instead of Vips are not exposed to this specific attack path. 8. Monitor for signs of unauthorized file access or credential misuse.
Affected products:
Ruby on Rails 7.0.0 through 7.2.3.1 (with libvips/Active Storage)
Ruby on Rails 8.0.0 through 8.0.5 (with libvips/Active Storage)
Ruby on Rails 8.1.0 through 8.1.3 (with libvips/Active Storage)
Ruby on Rails 6.0.0 through 6.1.7.10 (only when Active Storage is configured to use Vips)
activestorage < 7.2.3.2
libvips < 8.13
ruby-vips < 2.2.1
Related links:
https://github.com/rails/rails/security/advisories/GHSA-xr9x-r78c-5hrm
https://github.com/rails/rails/commit/349e7a5d5b4b715af1e416db824f3c078a7d59e5
https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve-2026-66066
https://blog.flatt.tech/entry/kindarails2shell_rails
https://www.cisa.gov/known-exploited-vulnerabilities-catalog
Related CVE's:
Related threat actors:
IOC's:
This article was created with the assistance of AI technology by Perceptive.
