Skip to content
nulltapE-reader edition

← All e-reader articles

4 min read

ImageMagick Image Uploads Expose Files Across Web Applications

CERT/CC describes SVG and PostScript paths from untrusted image processing to file access. Inspect each converter’s effective policy and filesystem permissions.

Read on the standard site

An image-processing tray opens into a file drawer beneath it, showing how handling an image can reach stored files.

A thumbnail job can reach files outside the image it was asked to resize. In a November 12 vulnerability note, CERT/CC describes two ways attacker-controlled SVG or PostScript content can make ImageMagick-based applications read or write files under the converter’s permissions. The exposure extends across upload handlers, content-management systems, and image pipelines fed by URLs or automated agents. CERT/CC calls the related issues ImageTragick2.

The affected unit is the image worker and its policy, whether a web app receives the image directly or an agent sends it downstream. CERT/CC lists the Kiteworks platform and ownCloud Classic as affected on the basis of Kiteworks’ own assessment. Kiteworks says fixes are in development and reports “no indication of exploitation.”

Two routes out of image processing

In the SVG route, a crafted SVG image element can cause ImageMagick’s internal SVG coder to invoke the MSL coder through an xlink:href reference. ImageMagick then treats the referenced material as a Magick Scripting Language script; subsequent image reads and writes can reach locations accessible to the process. The route depends on the internal SVG coder and the required dangerous coders being available.

The other route starts with format detection. ImageMagick recognizes PostScript from the contents of a crafted file and hands it to the Ghostscript interpreter, including when the filename suggests another image format. CERT/CC says Ghostscript runs with -dSAFER, yet the observed configuration still permits reads or writes inside /tmp. Applications that place uploads, processing artifacts, sessions, or other sensitive data in shared temporary storage have a direct reason to examine that directory. The pwn.ai team independently reported this second variant to WordPress as CVE-2026-65640. The CVE record scopes that WordPress path to an Author-level user or higher with upload_files, Imagick, and Ghostscript; WordPress released 7.0.4 and backported its fix to branches back to 4.7.

Both routes depend on what the converter is allowed to invoke and what its process can reach on disk. Writing executable application content can lead to code execution in some deployments. In containers, shared volumes, mounted host paths, credentials, and inference artifacts can enlarge the impact. Prioritize any worker that shares those resources with the application it serves.

Check the worker behind each upload

Start with the service that actually runs image conversion. Include thumbnail jobs, remote-image imports, and AI preprocessing or post-processing when they pass untrusted input to ImageMagick. Inventory the effective policy.xml, the available coders and delegates, and the filesystem permissions of that worker. The server receiving an upload may hand conversion to another process or container; inspect that worker’s policy and mounts.

A filename or client-supplied media type is a poor indicator of the format ImageMagick will process. For recognition, watch the converter’s policy-violation messages, unexpected coder or delegate activity, unusual processing failures, and unexpected files in directories the worker can write. In the PostScript route, include shared /tmp in that review. Those observations can guide incident triage; compare them with the application’s upload and job history to identify the input that reached the worker.

Rails’ advisory says an upload alone triggers analysis in affected Active Storage installations using :mini_magick; nobody needs to request a preview. The affected ranges are activestorage < 8.0.5.2 and >= 8.1, < 8.1.4.1, with 8.0.5.2 and 8.1.4.1 as first fixes. Rails says exposure also requires untrusted uploads and a policy that permits the relevant coders. Its fixed releases prepend a bundled policy directory to MAGICK_CONFIGURE_PATH through MiniMagick.cli_env. Applications replacing that environment after boot or installing their own MiniMagick shell must carry the rules in the system policy. Rails also requires mini_magick >= 5.1 for applications using :mini_magick to apply the shipped policy.

CERT/CC lists MediaWiki as not affected in its coordination table. For other deployments, inspect the application’s processing route and the converter’s effective policy. Rails users with the Disk attachment service should follow the maintainers’ secret-rotation guidance for secret_key_base, the master key, storage and database credentials, and third-party tokens readable by the application process.

Restrict coders and test rejection

Install product-specific fixes where available. For converters that still process untrusted content, apply an application-specific allowlist policy.xml: allow required image formats and operations; deny unnecessary coders and delegates, including MSL, MVG, PS, EPS, and PDF where the workflow does not need them. CERT/CC warns that updating ImageMagick alone can leave permissive policy in place, and even its bundled secure template needs checking against the application’s actual requirements. Rails’ policy additionally denies the gs delegate and PostScript-family coders; changes that re-allow those formats to support document rendering restore that processing path and need separate isolation.

Run untrusted image conversion in a dedicated, minimally privileged worker with restricted filesystem access, especially where uploads and model outputs share a container or volume with secrets. Check file content before processing rather than trusting extensions. Then verify the effective policy in that same worker with benign, prohibited format samples: ImageMagick should reject the disabled format, record a policy violation, and leave the intended image formats working. Keep the converter’s policy output and the worker’s accessible mounts with the deployment record; those are the facts the next upload job will actually run under.

Primary sources