Skip to main content

Blog post · November 12, 2026 · kb.cert.org

CERT/CC reports ImageMagick file read and write flaws in applications

Summary

Multiple arbitrary file read and write vulnerabilities affect applications that run ImageMagick under insufficiently restrictive security policies. Collectively they are referred to as ImageTragick2. These issues arise when ImageMagick handles attacker-supplied SVG or PostScript content through dangerous coders or delegates that the default or application-supplied configuration permits. An attacker who can upload or trigger processing of crafted images may read or write files the ImageMagick process can reach, and these capabilities may be chained to arbitrary code execution in some deployments.

ImageMagick, an open-source image-processing suite, can process a crafted SVG element that invokes a dangerous coder through its xlink:href value, for example by referencing an MSL: resource. The referenced content may then be interpreted as a Magick Scripting Language script, which can call further image readers and direct attacker-controlled image data to selected filesystem paths, enabling unauthorized file access. Exploitation depends on the internal SVG coder and the required dangerous coders being available to the ImageMagick process.

In the second variant, ImageMagick may identify crafted input as PostScript and invoke Ghostscript, a separate interpreter it uses for PostScript, EPS, and PDF, even when the filename or declared type suggests another format. Although Ghostscript runs with -dSAFER, the observed configuration allows file access within /tmp, so a crafted PostScript file can read or write data there. This can affect applications using shared temporary storage for uploads, processing artifacts, sessions, or other sensitive data. The pwn.ai team independently found this variant and reported it to WordPress as CVE-2026-65640.

Crafted SVG or PostScript content processed by an affected application may allow reading or writing of files in locations accessible to the ImageMagick process. Arbitrary code execution is possible in some cases when file access is combined with writable executable content. AI-enabled services that use ImageMagick may face additional exposure because they process untrusted images. In container deployments, writable host mounts, shared volumes, credentials, or inference artifacts can substantially increase the impact of a successful exploit.

Product-specific updates and mitigations are listed under Vendor Information, which names one or more vendors and points to the full report. Users of products integrating ImageMagick, including Ruby on Rails, WordPress, MediaWiki, ownCloud Classic, and Redmine, should install vendor-provided updates when available, though updating ImageMagick alone may be insufficient if its policy still permits dangerous coders or delegates. Behavior a custom policy can restrict is treated as a configuration issue rather than an ImageMagick flaw, making applications and distributions responsible for deploying a suitable policy.

Use a custom policy.xml based on an allowlist, enabling only needed formats and operations and disabling unnecessary coders and delegates such as MSL, MVG, PS, EPS, and PDF. The bundled secure template may not suit every deployment, so verify the effective policy and confirm prohibited formats are rejected. Further measures include isolating untrusted image processing, including AI pipelines, in a minimally privileged environment with restricted filesystem access, verifying file content rather than filenames or media types, and monitoring for policy violations and unexpected file creation.

Our summary. The original keeps its own byline.

Read the original on kb.cert.org

Companies in this article