/

CVE-2026-49218

Severity:

HIGH RISK

(7.5)

Input Validation Flaw (CWE-20) in ImageMagick DCM Decoder

CVE-2026-49218

Modified

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20, CWE-1284

Impact:

Denial of Service via application crash

Severity:

HIGH RISK

(7.5)

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

A missing input validation check in ImageMagick's DCM image decoder allows images with invalid dimensions to be processed.

When such malformed DICOM/DCM files are handled, subsequent image operations can crash, potentially enabling denial-of-service conditions in applications relying on ImageMagick.

Affected context

This vulnerability appears in environments where ImageMagick is used to decode DCM (DICOM) images, such as medical imaging workflows, document processing systems, or generic image conversion services.

It is most relevant when user-supplied or third-party DCM files are accepted and processed without prior sanitization.

The issue manifests when the decoder fails to reject images with invalid dimensions, allowing corrupted state that can propagate into later image operations and cause crashes.

Exploit preconditions

  • Attack surface: Any service, CLI tool, or backend that invokes ImageMagick to decode or transform DCM files.
  • Required access: Ability to upload, submit, or otherwise cause a crafted DCM image to be processed by ImageMagick.
  • Trigger point: Invocation of the DCM decoder followed by subsequent ImageMagick operations on the decoded image data.
  • Why exploitation is possible: The decoder does not fully validate image dimensions, so logically invalid metadata is treated as acceptable input, leading to unstable internal state and eventual crashes.

Why this happens

The root cause is incomplete input validation in the DCM decoder path, where image dimension fields are not rigorously checked for correctness and safe bounds before further processing.

This maps to CWE-20: Improper Input Validation, in which assumptions about input structure and size are trusted instead of being explicitly enforced.

As a result, internal image structures derived from invalid dimensions can be passed into later operations that are not designed to handle those edge cases, leading to faults and crashes.

Potential impact

  • Application or service crashes when processing malicious or malformed DCM images
  • Denial of service against image processing APIs or microservices
  • Disruption of workflows that rely on automated DCM conversion or thumbnail generation
  • Potential cascading failures in systems that synchronously depend on ImageMagick processing results

General mitigation guidance

Mitigations generally focus on tightening validation and isolating image processing components:

  • Enforce strict validation and sanity checks on image headers and dimensions before or during decoding.
  • Treat all externally supplied image files as untrusted and limit accepted formats and features where possible.
  • Run ImageMagick-driven components with least privilege and resource limits to contain the impact of crashes.
  • Use process isolation (e.g., worker processes, containers, or sandboxes) so that a failure in image decoding does not take down core application services.
  • Employ defensive coding patterns in image pipelines, such as bounding memory and dimension expectations and handling decoding errors gracefully.

How teams detect issues like this

Detection can rely on code-level and operational monitoring approaches:

  • Static analysis or manual code review to identify decoder paths that lack robust checks on image dimensions and metadata.
  • Security-focused review of parsers and decoders for assumptions about external input, especially in complex formats like DICOM.
  • Runtime monitoring and logging for repeated crashes or faults correlated with specific image inputs or formats.
  • Fuzzing and property-based testing of image decoding routines to surface crashes related to malformed dimensions or headers.
  • Integration of automated SAST/DAST tools into CI pipelines to flag risky parsing patterns and unexpected crash signatures.

Sources

SourceLink
github.comgithub.com/ImageMagick/ImageMagick/security/advisories/GHSA-8pj9-6897-74xc
access.redhat.comaccess.redhat.com/errata/RHSA-2026:32961
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-49218
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2487763
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-49218.json

Frequently asked

questions

It is primarily a denial-of-service issue: an attacker who can supply crafted DCM files can often trigger crashes in services that rely on ImageMagick for decoding or processing, but direct code execution is not implied by the vulnerability description.

Not necessarily. Any interface—authenticated or anonymous—that accepts and processes DCM images with ImageMagick can be a viable entry point. Public upload endpoints or API-based conversion services are common attack surfaces.

The safest pattern is to ensure strict input validation on all parsed image metadata, including dimensions and sizes, and to treat decoder errors as expected outcomes rather than exceptional conditions. Additionally, isolating image processing into a constrained, restartable component helps limit the impact of failures.

Preventive strategies include adopting a "zero trust" posture for all external files, incorporating fuzz testing into the development lifecycle of parsers, mandating bounds checks for all size-related fields, and regularly reviewing dependencies for known parsing and decoder issues.

Find out what's already
exploitable in your codebase.