GitHub Advisoryadvisory · RubyGems

GHSA-xr9x-r78c-5hrm Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing

CRITICAL Published 2026-07-30 Modified 2026-07-30 Official page ↗
Aliases
CVE-2026-66066
Ecosystem
RubyGems
Packages
activestorage
Severity
Critical
CVSS 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
Weaknesses
CWE-1188
Reviewed
2026-07-30

Affected packages

• RubyGems activestorage: < 7.2.3.2 → fixed in 7.2.3.2 • RubyGems activestorage: >= 8.0.0.beta1, < 8.0.5.1 → fixed in 8.0.5.1 • RubyGems activestorage: >= 8.1.0.beta1, < 8.1.3.1 → fixed in 8.1.3.1

Description

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`, 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. 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` 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 = 8.0, = 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

Related

Alias · CVE (1)

  • CVE-2026-66066 Action Pack is a framework for handling and responding to web requests. vulnerability

Weakness · CWE (1)

  • CWE-1188 Initialization of a Resource with an Insecure Default weakness

References