VYPR
Unrated severityNVD Advisory· Published May 8, 2018· Updated Aug 5, 2024

CVE-2018-10805

CVE-2018-10805

Description

ImageMagick 7.0.7-28 has a memory leak in ReadYCBCRImage that can be triggered by a crafted YCbCr image.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

ImageMagick 7.0.7-28 has a memory leak in ReadYCBCRImage that can be triggered by a crafted YCbCr image.

Vulnerability

ImageMagick version 7.0.7-28 contains a memory leak in the ReadYCBCRImage function in coders/ycbcr.c. When processing a YCbCr image, the function allocates a canvas_image via CloneImage and then attempts to acquire quantum information via AcquireQuantumInfo. If AcquireQuantumInfo fails (returns NULL), the function throws an exception but does not free the previously allocated canvas_image, resulting in a memory leak [1].

Exploitation

An attacker can trigger this memory leak by providing a crafted YCbCr image that causes AcquireQuantumInfo to fail. No special privileges are required; the attacker only needs to submit the malicious image to an application using the vulnerable ImageMagick library. The leak occurs during the decoding process, and repeated processing of such images can lead to memory exhaustion.

Impact

Successful exploitation leads to a memory leak, which can cause memory exhaustion and denial of service (DoS) for the application processing the image. The vulnerability does not allow code execution or information disclosure; it is a resource exhaustion issue.

Mitigation

The issue was reported in the ImageMagick issue tracker [1], but no specific fixed version is mentioned in the reference. Users should upgrade to a version of ImageMagick newer than 7.0.7-28 that includes a fix for this memory leak. If an upgrade is not immediately possible, avoid processing untrusted YCbCr images as a workaround.

AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

14

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"Missing free of canvas_image on the AcquireQuantumInfo failure path in ReadYCBCRImage leads to a memory leak."

Attack vector

An attacker can trigger the memory leak by providing a crafted YCbCr image that causes `AcquireQuantumInfo` to fail (return NULL) after `canvas_image` has already been allocated. The missing free on the error path means repeated processing of such images will exhaust memory resources. No special privileges are required beyond the ability to supply an image file to ImageMagick [ref_id=1].

Affected code

The vulnerability is in the `ReadYCBCRImage` function in `coders/ycbcr.c`. At approximately line 170, `CloneImage` allocates memory for `canvas_image`. If the subsequent `AcquireQuantumInfo` call at line 178 fails, the function returns without freeing `canvas_image`, causing a memory leak [ref_id=1].

What the fix does

No patch is included in the bundle. The advisory [ref_id=1] identifies the root cause: when `AcquireQuantumInfo` fails at line 178, the previously allocated `canvas_image` is not freed before the `ThrowReaderException` return. The remediation would be to add a `DestroyImage(canvas_image)` call on that error path, ensuring the allocation is released before the function exits.

Preconditions

  • inputAttacker must supply a crafted YCbCr image file that causes AcquireQuantumInfo to fail after CloneImage succeeds.
  • configThe target system must be running ImageMagick version 7.0.7-28.

Generated on May 25, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

2

News mentions

0

No linked articles in our index yet.