Skip to main content

CVE-2026-122006 — Vulnerability in activestorage — CVE Details

CRITICAL

Active Storage: Possible arbitrary file write and read in image analysis

Published November 12, 2026Updated November 17, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.72%). Schedule for your next planned update.

Does your project use an affected activestorage version?

Paste your Gemfile.lock to check it for CVE-2026-122006 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.

Check my Gemfile.lock

Summary

Impact

A Rails application that processes attachments with ImageMagick may allow an unauthenticated attacker to write arbitrary files on the server and, when attachments are stored with the Disk service, to read arbitrary files readable by the application process. Those files typically include secret_key_base and credentials for external systems, which may in turn allow escalation to remote code execution or lateral movement to those systems.

Details

ImageMagick selects a coder from the content of the file it is given, and some coders act on files named inside the image rather than on the image itself. Active Storage constrained none of ImageMagick's coders, and the ImageMagick analyzer runs when a file is attached, so an attacker who can upload a crafted file may be able to invoke one. Attaching the upload is sufficient; no variant, preview, or analyze call is required. One specific attack chain has been reported to us, but we do not assume it is the only one that exists.

The fixed versions ship an ImageMagick security policy and prepend its directory to MAGICK_CONFIGURE_PATH through MiniMagick.cli_env, so every ImageMagick process that MiniMagick spawns applies it. The policy denies the MSL scripting coder, the coders that read or delete files other than the image, fetch remote or local references, or display to a screen, every coder backed by Ghostscript together with the gs delegate, and @filename indirection. ImageMagick applies every policy.xml on its search path, so the shipped policy adds to the host's policy rather than replacing it. The policy applies to every ImageMagick command that MiniMagick runs, not only those of Active Storage. See the activestorage CHANGELOG and "ImageMagick Security Policy" in the Active Storage guide.

Affected applications

An application is affected if it meets all of these requirements:

  • Uses ImageMagick for Active Storage image processing. This is config.active_storage.variant_processor = :mini_magick, which is the default for applications on load_defaults 6.1 or earlier.
  • Runs ImageMagick under a security policy that does not already deny the coders involved. The policies that Debian and Ubuntu package do not.
  • Allows file uploads from untrusted users.

Mitigation

  • Upgrade to a fixed version of activestorage.
  • An application whose variant processor is :mini_magick must use mini_magick >= 5.1, which applying the policy requires. With an older mini_magick, such an application raises an exception during boot.
  • An application that renders PostScript or PDF through ImageMagick must re-allow the gs delegate and the coders it uses in the host's policy.xml.
  • An application that replaces MiniMagick.cli_env after boot, clears the environment with MiniMagick.cli_prefix, or installs its own MiniMagick::Shell does not receive the shipped policy and must carry its rules in ImageMagick's system policy. GraphicsMagick does not read ImageMagick policies.
  • If attachments are stored with the Disk service, change secret_key_base and every secret readable by the application process, including the master key and everything config/credentials.yml.enc holds, storage and database credentials, and third-party tokens. Do not retain an exposed secret as a fallback.

Workarounds

Copy the rules of the policy that the fixed versions ship, activestorage/lib/active_storage/image_magick/policy.xml, into ImageMagick's system policy, for example /etc/ImageMagick-7/policy.xml. At a minimum, deny the MSL coder, the Ghostscript coders, and the gs delegate:

<policy domain="coder" rights="none" pattern="MSL"/>
<policy domain="delegate" rights="none" pattern="gs"/>
<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPS2,EPS3,EPI,EPSF,EPSI,EPT,EPT2,EPT3,PDF,AI,EPDF,PDFA,POCKETMOD,XPS,PCL}"/>

Releases

The fixed releases are available at the normal locations.

Patches for those who cannot upgrade at once:

Versions affected

  • activestorage < 8.0.5.2
  • activestorage >= 8.1, < 8.1.4.1

Credit

This issue was responsibly reported by HackerOne researcher ryotak.

References

Advisory Timeline

  • First published November 12, 2026 (13 days ago).
  • Last revised November 17, 2026 — 4 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update activestorage to 8.1.4.1 or later
gem install activestorage -v 8.1.4.1
Bundler
Update activestorage to 8.0.5.2 or later
gem install activestorage -v 8.0.5.2

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: RubyGems (1).

PackageFixed In
activestorage RubyGems · Affected: 8.1.0, 8.1.0.beta1, 8.1.0.rc1, 8.1.1 (+5 more)8.1.4.1
activestorage RubyGems · Affected: 0.1, 5.2.0, 5.2.0.beta1, 5.2.0.beta2 (+173 more)8.0.5.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-122006?
Active Storage: Possible arbitrary file write and read in image analysis. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2026-122006?
CVE-2026-122006 affects activestorage. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-122006 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.72%
EPSS percentile: 49.8

This is a below-median EPSS score — only 49.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-f3w6-w445-fwh9

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock