[CVE-2026-66066] Possible arbitrary file read and remote code execution in Active Storage variant processing

discuss.rubyonrails.org · 2026-08-01 · by Long Nguyen ·generic
See Possible arbitrary file read and remote code execution in Active Storage variant processing · Advisory · rails/rails · GitHub Impact In its default configuration, a Rails application that displays image variants may…

[CVE-2026-66066] Possible arbitrary file read and remote code execution in Active Storage variant processing

[\[CVE-2026-66066\] Possible arbitrary file read and remote code execution in Active Storage variant processing](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432)

Security Announcements

announcement, security

rafaelfranca(Rafael França) July 29, 2026, 3:37pm 1

See Possible arbitrary file read and remote code execution in Active Storage variant processing · Advisory · rails/rails · GitHub

[](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-impact-1)Impact

In its default configuration, a Rails application that displays image variants may allow an unauthenticated attacker to read arbitrary files from the server, including the process environment. That environment typically holds `secret_key_base` and often credentials for external systems, which may in turn allow escalation to remote code execution or lateral movement to those systems.

[](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-details-2)Details

libvips reads and writes file formats through “loaders” and “savers” (or more generally “operations”), many of which are backed by third-party libraries. It marks some of these operations as “unfuzzed”, meaning they are unsafe for untrusted content, and several handle formats unrelated to web images. Active Storage did not disable the unfuzzed operations, so an attacker who can upload a crafted file and cause a variant to be generated from it may be able to invoke one.

We are aware of a mechanism by which an attacker, by uploading a crafted file, is able to cause disclosure of the contents of arbitrary files accessible on the filesystem of the targeted application. One specific attack chain has been reported to us (see “Disclosure” below), but we do not assume it is the only one that exists.

[](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-affected-applications-3)Affected applications

An application is affected if it meets all of these requirements:

  • Uses libvips for Active Storage image processing. This is `config.active_storage.variant_processor = :vips`, which `load_defaults 7.0` set and no later default has changed.
  • Allows image uploads from untrusted users.
  • Generating variants is not a separate requirement.

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-mitigation-4)Mitigation

  • Upgrade to a fixed version of `activestorage`.
  • The minimum version of libvips must be upgraded to `>= 8.13`.
  • Change `secret_key_base` and change any secrets accessible in the application environment (see “Expire and change secrets” below)
  • Earlier versions of libvips (`< 8.13`) cannot disable unfuzzed operations at all, and Active Storage will raise an exception during boot in such an unsecurable environment.

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-expire-and-change-secrets-5)Expire and change secrets

    Upgrading closes the vulnerability but does not undo an exfiltrated secret if that already occurred. An affected application should treat every secret readable by the application process as potentially exposed and change it, including:

  • `secret_key_base`
  • The master key, whether stored in `config/master.key` or supplied as `RAILS_MASTER_KEY`, along with everything in `config/credentials.yml.enc` that it decrypts
  • Credentials for the Active Storage service, such as S3, GCS, or Azure keys
  • Database credentials
  • Tokens and keys for any third-party service the application calls
  • Changing `secret_key_base` expires active sessions and requires users to log in again. Encrypted cookies, signed cookies, signed global IDs, and Active Storage URLs are also affected.

    Rotation should only be used as an intermediate step if necessary. Do not retain an exposed secret as a fallback.

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-workarounds-6)Workarounds

    If libvips `< 8.13` is being used, there are no workarounds available other than removing the dependency on libvips from the application. Some applications may have `ruby-vips` declared as a dependency only for image analysis, and those applications may be able to simply remove `ruby-vips`from the Gemfile to remove libvips from the application. Applications that do not use Active Storage can remove `ruby-vips` from the Gemfile to avoid the boot-time checks.

    If libvips `>= 8.13` is present on the system, applications can disable the unfuzzed operations without upgrading Rails by setting the `VIPS_BLOCK_UNTRUSTED` environment variable, which libvips reads while initializing.

    Applications also running ruby-vips `>= 2.2.1` or later can instead call `Vips.block_untrusted(true)` from an initializer.

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-releases-7)Releases

    The fixed releases are available at the normal locations.

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-versions-affected-8)Versions affected

  • activestorage < 7.2.3.2
  • activestorage >= 8.0, < 8.0.5.1
  • activestorage >= 8.1, < 8.1.3.1
  • [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-disclosure-9)Disclosure

    Technical details of the attack chain are intentionally omitted from this advisory. They would add nothing to an administrator’s decision to upgrade, while making it substantially easier to attack applications that have not yet done so.

    Details will be disclosed no later than 2026-08-28, via the Rails Security Announcements forum.

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-credit-10)Credit

    This issue was responsibly reported by 0xacb, s3np41k1r1t0 and castilho from Ethiack, and RyotaK from GMO Flatt Security Inc..

    [](https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432#p-267668-references-11)References

  • libvips 8.13 release notes, blocking of unfuzzed loaders
  • W.A. Arbaugh, W.L. Fithen, and J. McHugh, “Windows of Vulnerability: A Case Study Analysis”, IEEE Computer 33(12), December 2000
  • KindaRails2Shell - Critical RCE in Rails via Active Storage (CVE-2026-66066) | Ethiack — Autonomous Ethical Hacking for continuous security
  • 深刻度「緊急」のRails脆弱性「KindaRails2Shell」(CVE-2026-66066)の概要と対応指針 - GMO Flatt Security Blog

9 Likes

Related topics

| Topic | | Replies | Views | Activity | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -- | ------- | ----------------- | -------- | | [\[CVE-2022-21831\] Possible code injection vulnerability in Rails / Active Storage](https://discuss.rubyonrails.org/t/cve-2022-21831-possible-code-injection-vulnerability-in-rails-active-storage/80199) Security Announcements | 0 | 10684 | March 8, 2022 | | | Make Vips the recommended/default variant processor for Active Storage rubyonrails-core | 23 | 12801 | June 13, 2022 | | | [\[CVE-2025-24293\] Active Storage allowed transformation methods potentially unsafe](https://discuss.rubyonrails.org/t/cve-2025-24293-active-storage-allowed-transformation-methods-potentially-unsafe/89670) Security Announcements announcement, security | 0 | 1926 | August 13, 2025 | | | Active Storage in production: lessons learned and in-depth look at how it works rubyonrails-talk activestorage | 34 | 27459 | April 26, 2025 | | | Possible Sensitive Session Information Leak in Active Storage Security Announcements announcement, patch | 0 | 5556 | February 21, 2024 | |

Comments (0)

No comments yet