CVE-2026-66066 — Vulnerability in activestorage — CVE Details
Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (2.87%). Schedule for your next planned update.
Does your project use an affected activestorage version?
Paste your Gemfile.lock to check it for CVE-2026-66066 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
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.active_storage.variant_processor = :vips, whichload_defaults 7.0set 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
secret_key_baseand 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:
secret_key_base- The master key, whether stored in
config/master.keyor supplied asRAILS_MASTER_KEY, along with everything inconfig/credentials.yml.encthat 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.
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.
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/kindarails2shell_rails
Advisory Timeline
- First published July 30, 2026 (119 days ago).
- Last revised September 10, 2026 — 41 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install activestorage -v 7.2.3.2
gem install activestorage -v 8.1.3.1
gem install activestorage -v 8.0.5.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| activestorage RubyGems · Affected: 0.1, 5.2.0, 5.2.0.beta1, 5.2.0.beta2 (+158 more) | 7.2.3.2 |
| activestorage RubyGems · Affected: 8.1.0, 8.1.0.beta1, 8.1.0.rc1, 8.1.1 (+3 more) | 8.1.3.1 |
| activestorage RubyGems · Affected: 8.0.0, 8.0.0.1, 8.0.0.beta1, 8.0.0.rc1 (+8 more) | 8.0.5.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-1188
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 10.0 score means for each attack dimension.
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
References
- https://github.com/rails/rails/security/advisories/GHSA-xr9x-r78c-5hrmWEB
- https://github.com/rails/rails/commit/1c01bb587206ee6eb0e1179c2cef96a6a47acb1eWEB
- https://github.com/rails/rails/commit/349e7a5d5b4b715af1e416db824f3c078a7d59e5WEB
- https://github.com/rails/rails/commit/d79b7f4aa17dec8ce4960fef05733c8c0c7ef49aWEB
- https://github.com/rails/railsPACKAGE
- https://github.com/rails/rails/releases/tag/v7.2.3.2WEB
- https://github.com/rails/rails/releases/tag/v8.0.5.1WEB
- https://github.com/rails/rails/releases/tag/v8.1.3.1WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/CVE-2026-66066.ymlWEB
- https://thehackernews.com/2026/07/critical-rails-flaw-could-let.htmlWEB
- https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-66066WEB
Frequently Asked Questions
- What is CVE-2026-66066?
- Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 10.0/10).
- How do I check if my project is affected by CVE-2026-66066?
- CVE-2026-66066 affects activestorage. It has a 2.9% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-66066 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top quartile of EPSS-scored vulnerabilities — 87.5% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-122006CRITICAL
Active Storage: Possible arbitrary file write and read in image analysis
- CVE-2026-33195HIGH
Rails Active Storage has possible Path Traversal in DiskService
- CVE-2026-126084MEDIUM
Active Storage: Unsigned Content-Type in GCS direct uploads with cache_control
- CVE-2026-126071MEDIUM
Active Storage: Possible DoS vulnerability in Active Storage proxy mode via storage errors during streaming
- CVE-2026-33202MEDIUM
Rails Active Storage has possible glob injection in its DiskService
- CVE-2018-16477MEDIUM
Exposure of Sensitive Information to an Unauthorized Actor in activestorage
- CVE-2024-26144MEDIUM
Rails has possible Sensitive Session Information Leak in Active Storage
- CVE-2026-126085MEDIUM
Active Storage: Possible circumvention of file size limits in Active Storage direct uploads to Google Cloud Storage