GHSA-F3W6-W445-FWH9
Vulnerability from github – Published: 2026-11-12 23:46 – Updated: 2026-11-12 23:46Impact
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_magickmust 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
gsdelegate and the coders it uses in the host'spolicy.xml. - An application that replaces
MiniMagick.cli_envafter boot, clears the environment withMiniMagick.cli_prefix, or installs its ownMiniMagick::Shelldoes 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_baseand every secret readable by the application process, including the master key and everythingconfig/credentials.yml.encholds, 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: - 8.1: https://github.com/rails/rails/commit/468aa9a93fc98f5476b6821770f4ccfcb7f7d328 - 8.0: https://github.com/rails/rails/commit/ea8c40121ce53a3d0255cd4eb6d13bfe3bc01776
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
- ImageMagick security policy
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "activestorage"
},
"ranges": [
{
"events": [
{
"introduced": "8.1.0.beta1"
},
{
"fixed": "8.1.4.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "RubyGems",
"name": "activestorage"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "8.0.5.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-122006"
],
"database_specific": {
"cwe_ids": [
"CWE-1188"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-12T23:46:51Z",
"nvd_published_at": "2026-11-10T21:19:26Z",
"severity": "CRITICAL"
},
"details": "### Impact\nA 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.\n\n### Details\nImageMagick 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\u0027s 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.\n\nThe 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\u0027s 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.\n\n### Affected applications\nAn application is affected if it meets all of these requirements:\n- 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.\n- Runs ImageMagick under a security policy that does not already deny the coders involved. The policies that Debian and Ubuntu package do not.\n- Allows file uploads from untrusted users.\n\n### Mitigation\n- Upgrade to a fixed version of `activestorage`.\n- An application whose variant processor is `:mini_magick` must use mini_magick `\u003e= 5.1`, which applying the policy requires. With an older mini_magick, such an application raises an exception during boot.\n- An application that renders PostScript or PDF through ImageMagick must re-allow the `gs` delegate and the coders it uses in the host\u0027s `policy.xml`.\n- 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\u0027s system policy. GraphicsMagick does not read ImageMagick policies.\n- 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.\n\n### Workarounds\nCopy the rules of the policy that the fixed versions ship, `activestorage/lib/active_storage/image_magick/policy.xml`, into ImageMagick\u0027s system policy, for example `/etc/ImageMagick-7/policy.xml`. At a minimum, deny the `MSL` coder, the Ghostscript coders, and the `gs` delegate:\n\n```xml\n\u003cpolicy domain=\"coder\" rights=\"none\" pattern=\"MSL\"/\u003e\n\u003cpolicy domain=\"delegate\" rights=\"none\" pattern=\"gs\"/\u003e\n\u003cpolicy domain=\"coder\" rights=\"none\" pattern=\"{PS,PS2,PS3,EPS,EPS2,EPS3,EPI,EPSF,EPSI,EPT,EPT2,EPT3,PDF,AI,EPDF,PDFA,POCKETMOD,XPS,PCL}\"/\u003e\n```\n\n### Releases\nThe fixed releases are available at the normal locations.\n\nPatches for those who cannot upgrade at once:\n- 8.1: https://github.com/rails/rails/commit/468aa9a93fc98f5476b6821770f4ccfcb7f7d328\n- 8.0: https://github.com/rails/rails/commit/ea8c40121ce53a3d0255cd4eb6d13bfe3bc01776\n\n### Versions affected\n- activestorage \u003c 8.0.5.2\n- activestorage \u003e= 8.1, \u003c 8.1.4.1\n\n### Credit\nThis issue was responsibly reported by HackerOne researcher [ryotak](https://hackerone.com/ryotak).\n\n### References\n- ImageMagick [security policy](https://imagemagick.org/security-policy/)",
"id": "GHSA-f3w6-w445-fwh9",
"modified": "2026-11-12T23:46:52Z",
"published": "2026-11-12T23:46:51Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/rails/rails/security/advisories/GHSA-f3w6-w445-fwh9"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-122006"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-126082"
},
{
"type": "WEB",
"url": "https://github.com/digitalocean/droplet-1-clicks/pull/488"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/pull/1300"
},
{
"type": "WEB",
"url": "https://github.com/rails/rails/commit/468aa9a93fc98f5476b6821770f4ccfcb7f7d328"
},
{
"type": "WEB",
"url": "https://github.com/rails/rails/commit/ea8c40121ce53a3d0255cd4eb6d13bfe3bc01776"
},
{
"type": "WEB",
"url": "https://github.com/alan-turing-institute/cyber-threat-observatory/blob/main/reports/2026-11-04/TIER_2_CVE-2026-122006.md"
},
{
"type": "PACKAGE",
"url": "https://github.com/rails/rails"
},
{
"type": "WEB",
"url": "https://github.com/rails/rails/releases/tag/v8.0.5.2"
},
{
"type": "WEB",
"url": "https://github.com/rails/rails/releases/tag/v8.1.4.1"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/GHSA-f3w6-w445-fwh9.yml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Active Storage: Possible arbitrary file write and read in image analysis"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.