Developers using Ruby on Rails need to patch immediately. A severe flaw in Active Storage permits unauthenticated attackers to write arbitrary files to a server whenever file uploads are processed through ImageMagick. The vulnerability is fixed in Rails releases 8.1.4.1 and 8.0.5.2.
Flaw Details
The issue resides in Active Storage’s integration with ImageMagick. Because Active Storage does not restrict which coder an uploaded image may invoke, malicious uploads can exploit coders that act on external files—not just the image content itself. The default setting in many Rails apps, using MiniMagick under config.active_storage.variant_processor = :mini_magick, is specifically vulnerable if the server’s ImageMagick policy does not block dangerous coders.
As soon as a crafted file is attached to an app (no previews, variant generation, or analysis required), the vulnerability can be triggered. A specific example involved an SVG file invoking ImageMagick’s MSL coder via the analyzer, which can read and write files named by its embedded script. If Active Storage uses the Disk service, attackers can also read any file the app can read, including sensitive secrets and credentials. Rails gave this flaw a 9.8/10 CVSS score. Fixed versions are 8.1.4.1 and 8.0.5.2; older versions, especially before 8.0, are unsupported.
What Apps Are at Risk & How to Protect
An application is vulnerable only if all the following are true: it uses ImageMagick via MiniMagick for Active Storage image processing (particularly under default settings prior to Rails 7.0), it allows uploads from untrusted users, and its ImageMagick policy does not disallow the dangerous coders. Policies shipped with Debian or Ubuntu do not block them. If any of these are missing, risk is reduced but not eliminated.
To secure Rails apps, upgrade to version 8.1.4.1 or at least 8.0.5.2. Apps using MiniMagick must also run MiniMagick 5.1 or later. Rails adds a security policy for ImageMagick that blocks coders like MSL, prevents filename indirection, forbids Ghostscript coders under certain conditions, among others. For apps that can’t upgrade immediately, copying the new policy into the system-wide ImageMagick policy.xml or applying its rules is an interim measure.
If your app stores uploads with the Disk service, it’s critical to rotate all secrets that the app process can read—such as the secret_key_base, encrypted credentials, database credentials, and third-party tokens—because exposure could lead to remote code execution or further compromise.
This vulnerability is tracked as GHSA-f3w6-w445-fwh9, though it has not been assigned a CVE. It was reported via HackerOne, and Rails warns that other attack chains may exist beyond the one discovered.
Additionally, Rails recently patched another serious Active Storage issue (CVE-2026-66066) affecting apps using libvips. This current flaw is distinct and applies only to ImageMagick processing paths. Another flaw (GHSA-v924-7rp8-4mxh) had to do with how file uploads were handed off under temporary file names with original extensions—this too is addressed in the same release series.
To verify protection, check if your app loads the shipped policy using tools like rails runner with MiniMagick, review whether any server-level customizations override the new policy, and confirm that ImageMagick’s system policy doesn’t allow any unsafe coders. If GraphicsMagick is used instead, it’s not covered by the Rails policy and needs its own safeguards.
This release series is still maintained only until November 7, 2026, so upgrading is not just advisable—it’s urgent. Teams running older Rails versions face increasing risk without official support or fixes.
In the rapidly evolving security landscape, this vulnerability underscores a larger trend: image processing libraries like ImageMagick remain frequent attack vectors. It’s not enough to trust defaults. Developers must actively configure upload processors, enforce strict policies, and rotate secrets regularly. Watching how Rails and system packages handle these patches over time will tell whether this kind of flaw continues to be a recurring threat or whether ecosystems can finally get ahead of them.