A 9.8 Rails flaw fires when a file is attached, and patching does not undo a secret that already leaked
Rails 8.1.4.1 and 8.0.5.2 fix 21 security issues, led by a CVSS 9.8 Active Storage flaw reachable through an ordinary upload. Disk service apps must also rotate secrets, 8.0 support ends November 7, and GitHub's advisory database had no entry yet.
Rails shipped 8.1.4.1 and 8.0.5.2 on November 4 with fixes for 21 security issues, and the one that sets the priority is a CVSS 9.8 flaw that can turn an ordinary file upload into file access on the server. For apps that keep attachments on local disk, the upgrade is only the first step. A patch closes the hole, but it does nothing about what may already have been read through it.
Attaching the file is enough
The critical advisory, GHSA-f3w6-w445-fwh9 (CVE-2026-122006), comes down to how
ImageMagick reads files. It picks a coder from the file’s content, and some
coders act on files named inside the image rather than on the image itself.
Active Storage constrained none of those coders, and its image analyzer runs at
attach time. The Rails fix commit describes an uploaded SVG reaching MSL,
ImageMagick’s XML scripting coder, which reads and writes the files its script
names.
The advisory is explicit that “no variant, preview, or analyze call is
required.” It also says the reported chain may not be the only one. An app that
never resizes an image can still reach the vulnerable path, because the analysis
happens automatically, before any of the application’s own image code runs.
Which apps are exposed
Rails lists three conditions for the critical flaw:
- The app uses
config.active_storage.variant_processor = :mini_magick, the default onload_defaults 6.1or earlier. - ImageMagick runs under a policy that does not deny the coders involved. Rails says the policies Debian and Ubuntu package do not.
- The app accepts uploads from untrusted users.
Ostorlab’s review of Debian 12’s packaged policy shows why that second condition
is easy to meet: it denies the Ghostscript and URL coders, but has no MSL rule,
and its only MVG rule is commented out. Older apps that were upgraded without
moving their defaults look like the likeliest group to be exposed, though the
setting is worth checking rather than assuming. File write applies in general.
File read additionally requires the Disk service.
Teams outside that group still have a reason to move. GHSA-v924-7rp8-4mxh, rated
8.8, covers Active Storage keeping the uploaded file’s extension when it hands
the file to ffprobe, ffmpeg, and ImageMagick, which lets an uploader pick
the decoder. The worst path needs an FFmpeg built with AviSynth, which common
distribution packages do not enable but the GPL builds from ffmpeg.org do. Rails
warns that other decoders may be reachable without it, and Active Storage
analyzes video and audio on attach by default.
The upgrade has a second half
For apps on the Disk service, Rails asks for more than a version bump: change
secret_key_base, the master key, everything config/credentials.yml.enc
holds, storage and database credentials, and third-party tokens, with no exposed
secret kept as a fallback. Changing secret_key_base expires active sessions and
invalidates signed and encrypted cookies, signed global IDs, and Active Storage
URLs. The second advisory gives the same instruction to apps that meet its
AviSynth condition. That makes rotation a planned production event rather than a
config tweak.
The patch can also change behavior:
- On
:mini_magick, anything belowmini_magick5.1 raises at boot. - Apps that render PDF or PostScript through ImageMagick must re-allow the
gsdelegate and its coders in the host’spolicy.xml. - Apps that replace
MiniMagick.cli_envafter boot do not receive the shipped policy and need the rules in the system policy. - On 8.1,
ActionDispatch::RemoteIpnow raises whenForwardedandX-Forwarded-Fordisagree, which can surface inconsistent proxy setups.
Two clocks are running
Security support for the 8.0 series ends on November 7, three days after this release, and the maintenance policy lists 8.1 as the only series supported after that. Older series are already unsupported, and the advisory’s affected range has no lower bound. Teams still on 7.2 should not expect a new gem. The advisory’s workaround of copying the shipped rules into ImageMagick’s system policy addresses this flaw, but not the other 20.
The second clock is exposure. ThreatDefence reported no known exploitation and no public proof of concept as of November 5, and CISA’s catalog of known exploited vulnerabilities did not list the CVE in its November 4 update. The same report says proofs of concept appeared within two days of July’s critical Active Storage fix, which makes that quiet a weak reason to wait.
A clean dashboard is not an answer yet
The paperwork is lagging the patch. As of the morning of November 5, the page
for this advisory in GitHub’s public Advisory Database returned a 404, and the
newest activestorage entry there was July’s flaw. Dependabot alerts draw on
that database, so a quiet security tab says little about this release today. NVD
had received the CVE but not analyzed it. ruby-advisory-db, the source behind
bundler-audit, already carries the advisory, so bundle audit check --update
is a better check for now, and reading Gemfile.lock is the fastest one.
The release is a reminder that an upload pipeline is also a set of external parsers running with the application’s secrets in reach, and that a dependency bump only finishes the job when those secrets were never exposed.
- Rails Versions 8.0.5.2 and 8.1.4.1 have been released (Ruby on Rails) rubyonrails.org
- Possible arbitrary file write and read in Active Storage image analysis, GHSA-f3w6-w445-fwh9 (Rails advisory) github.com
- Possible arbitrary file read and remote code execution in Active Storage video previews, analysis and image processing, GHSA-v924-7rp8-4mxh (Rails advisory) github.com
- Ship an ImageMagick security policy for every MiniMagick process (Rails fix commit) github.com
- Maintenance Policy (Ruby on Rails) rubyonrails.org
- CVE-2026-122006 (NVD) nvd.nist.gov
- Rails Active Storage RCE, Fixed in 8.1.4.1 (Ostorlab) blog.ostorlab.co
- CVE-2026-122006 Rails Active Storage: Patching and Hunting (ThreatDefence) threatdefence.com