/

CVE-2026-56379

Severity:

HIGH RISK

(8.1)

Command Injection in SVG Decoder (CWE-78) ImageMagick

CVE-2026-56379

Modified

Vulnerability type

Category:

Command Injection

CWE:

CWE-116, CWE-78

Impact:

Arbitrary Command Execution during Image Rendering

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ImageMagick's SVG decoder incorrectly trusts embedded Magick Vector Graphics (MVG) commands, allowing crafted SVG files to inject arbitrary drawing commands into the rendering pipeline.

When untrusted SVG input is processed, an attacker may leverage these injected commands to perform command injection behaviors, potentially impacting the security of applications that rely on ImageMagick for image rendering.

Affected context

This vulnerability arises in environments where ImageMagick is used to render or transform SVG files, particularly when those files are supplied by or can be influenced by external users.

It is most relevant in web applications, document processing services, image transformation APIs, or desktop tools that automatically parse SVG content using ImageMagick without strict validation or sanitization.

The risk increases when rendered images are processed in privileged contexts or chained with other subsystems that might interpret or act upon MVG commands in unsafe ways.

Exploit preconditions

  • Attack surface: Any component or service that passes SVG files into ImageMagick for decoding or rendering.
  • Required access: The ability to upload, supply, or modify SVG content that will be processed (e.g., file upload endpoints, content management systems, email attachments rendered server-side).
  • Trigger point: Automatic or on-demand SVG rendering via ImageMagick, where the SVG decoder interprets embedded MVG drawing commands.
  • Why exploitation is possible: The SVG decoder insufficiently validates or sanitizes embedded content, allowing MVG instructions to be injected and trusted as part of the rendering flow, which aligns with command injection semantics (CWE-78) and improper input validation (CWE-116).

Why this happens

The core issue is improper handling of SVG input that can contain Magick Vector Graphics commands, which are treated as trusted instructions during decoding.

Instead of constraining or sanitizing embedded directives, the SVG decoder allows attacker-supplied MVG sequences to be interpreted as legitimate rendering commands.

This reflects the CWE-78: Improper Neutralization of Special Elements used in an OS Command, and CWE-116: Improper Encoding or Escaping of Output, where user-controlled data is not adequately filtered before being translated into command-like operations within the image processing engine.

Potential impact

  • Attackers may inject arbitrary MVG commands that alter rendered output in unexpected ways.
  • Malicious SVG files could be used to disrupt image processing workflows or cause denial of service.
  • Image rendering services can be manipulated to perform actions outside their intended scope when MVG commands gain command-like influence.
  • Downstream systems that rely on rendered outputs may be tricked into trusting manipulated images or metadata.

General mitigation guidance

Mitigation focuses on reducing trust in SVG content and constraining how embedded commands are handled during decoding.

Security patterns include:

  • Restricting or disabling support for MVG command interpretation when decoding untrusted SVG input.
  • Applying robust input validation and sanitization to SVG content before passing it to ImageMagick, limiting allowed elements and attributes.
  • Running image processing components with least-privilege policies and in isolated sandboxed environments, so that misbehavior cannot escalate.
  • Adopting secure-by-default configuration profiles for ImageMagick that minimize enabled decoders and special command features for user-supplied content.

How teams detect issues like this

Detection can leverage both static and dynamic analysis of systems integrating ImageMagick:

  • Reviewing application code and configuration for patterns where untrusted SVG data is sent directly to ImageMagick without validation.
  • Implementing security-focused configuration checks that flag permissive ImageMagick policies, such as unrestricted MVG handling for user input.
  • Using application security testing to process crafted SVG samples and observe unexpected behavior or deviations in rendering pipelines.
  • Employing automated policy enforcement or CI checks that ensure image processing services adhere to hardened configurations and sanitize user inputs.

Sources

SourceLink
github.comgithub.com/ImageMagick/ImageMagick/security/advisories/GHSA-xpg8-7m6m-jf56
vulncheck.comvulncheck.com/advisories/imagemagick-command-injection-via-svg-decoder
access.redhat.comaccess.redhat.com/errata/RHSA-2026:32961
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-56379
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2491700
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-56379.json

Frequently asked

questions

Yes, if a service accepts SVG files or SVG-like content over the network and passes them to ImageMagick for processing, an attacker can remotely supply malicious input that reaches the vulnerable decoder.

The attacker needs the ability to provide or modify SVG data that your application or service will render using ImageMagick, such as through file upload endpoints, embedded content fields, or document ingestion workflows.

The safest pattern is to treat all SVG input as untrusted, disable or strictly limit MVG command interpretation for user-supplied content, enforce strong validation and sanitization routines, and operate image processing in sandboxed environments with minimal privileges.

Prevention involves adopting a secure configuration baseline for third-party libraries like ImageMagick, enforcing strict input validation pipelines for all complex formats (SVG, PDF, etc.), reviewing integration points for injection risks, and incorporating security checks into development and deployment processes to catch unsafe decoder behavior early.

Find out what's already
exploitable in your codebase.