CVE-2026-66066: Action Pack: Possible arbitrary file read and remote code execution in Active Storage variant processing
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 secretkeybase and often credentials for external systems, which may in turn allow escalation to remote code execution or lateral movement to those systems.
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.
Affected applications An application is affected if it meets all of these requirements: - Uses libvips for Active Storage image processing. This is config.activestorage.variantprocessor = :vips, which loaddefaults 7.0 set and no later default has changed. - Allows image uploads from untrusted users.
Generating variants is not a separate requirement.
Mitigation - Upgrade to a fixed version of activestorage. - The minimum version of libvips must be upgraded to >= 8.13. - Change secretkeybase 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.
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:
- secretkeybase - The master key, whether stored in config/master.key or supplied as RAILSMASTERKEY, 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 secretkeybase 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.
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 VIPSBLOCKUNTRUSTED environment variable, which libvips reads while initializing.
Applications also running ruby-vips >= 2.2.1 or later can instead call Vips.blockuntrusted(true) from an initializer.
Releases The fixed releases are available at the normal locations.
Versions affected
- activestorage < 7.2.3.2 - activestorage >= 8.0, < 8.0.5.1 - activestorage >= 8.1, < 8.1.3.1
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.
Credit This issue was responsibly reported by 0xacb, s3np41k1r1t0 and castilho from Ethiack, and RyotaK from GMO Flatt Security Inc..
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 - https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve - https://blog.flatt.tech/entry/kindarails2shellrails
Other sources
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 secretkeybase 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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rubygems/activestorageto a version that resolves this vulnerability.Fixed in 8.1.3.1 - Upgrade
Upgrade
rubygems/activestorageto a version that resolves this vulnerability.Fixed in 8.0.5.1 - Upgrade
Upgrade
rubygems/activestorageto a version that resolves this vulnerability.Fixed in 7.2.3.2 - Upgrade
Upgrade
activestorageto a version that resolves this vulnerability.Fixed in 7.2.3.2 - Upgrade
Upgrade
activestorageto a version that resolves this vulnerability.Fixed in 8.0.5.1 - Upgrade
Upgrade
activestorageto a version that resolves this vulnerability.Fixed in 8.1.3.1 - Upgrade
Upgrade
libvipsto a version that resolves this vulnerability.Fixed in 8.13 - Configuration
Ensure Active Storage image variants use the :vips variant processor as in `config.active_storage.variant_processor = :vips` (named config shown in the advisory).
Rails (Active Storage variant processing) config.active_storage.variant_processor = :vips - Configuration
If libvips >= 8.13 is present, disable “unfuzzed” operations for untrusted content by calling `Vips.block_untrusted(true)` from an initializer (advisory mentions this initializer mechanism).
libvips Vips.block_untrusted = true - Configuration
If you cannot upgrade Rails immediately, set the `VIPS_BLOCK_UNTRUSTED` environment variable to disable unfuzzed operations (the advisory states this as a workaround without upgrading Rails).
libvips VIPS_BLOCK_UNTRUSTED = true - Configuration
Change `secret_key_base` and expire any sessions impacted; the advisory notes changing it expires active sessions and requires users to log in again.
Rails secret management secret_key_base = changed - Compensating control
If applicable, remove `ruby-vips` from the Gemfile to avoid boot-time checks and to avoid libvips-based Active Storage image processing (advisory: removing `ruby-vips` can be a fallback/avoid dependency on libvips).
- Operational
Expire and change secrets accessible to the Rails application process (the advisory: “Change secret_key_base and change any secrets accessible in the application environment”), including credentials for the Active Storage service (e.g., S3/GCS/Azure keys), database credentials, the master key (`config/master.key` or `RAILS_MASTER_KEY`), and tokens/keys for any third-party services the application calls.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-66066?
CVE-2026-66066 has a critical severity level of 9.5.
What impacts does CVE-2026-66066 have?
CVE-2026-66066 allows an unauthenticated attacker to read arbitrary files, including sensitive environment data from the server.
How can I fix CVE-2026-66066?
To mitigate CVE-2026-66066, update your Rails application to the latest version where the vulnerability has been patched.
Who is affected by CVE-2026-66066?
CVE-2026-66066 affects Rails applications using Active Storage variant processing in their default configuration.
Can CVE-2026-66066 lead to remote code execution?
Yes, CVE-2026-66066 can potentially lead to remote code execution due to the ability to read sensitive files.