VYPR
Unrated severityNVD Advisory· Published Jul 5, 2019· Updated Aug 4, 2024

CVE-2019-13297

CVE-2019-13297

Description

ImageMagick 7.0.8-50 Q16 has a heap-buffer-over-read in AdaptiveThresholdImage when a height of zero is not handled, leading to crash or potential info disclosure.

AI Insight

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

ImageMagick 7.0.8-50 Q16 has a heap-buffer-over-read in AdaptiveThresholdImage when a height of zero is not handled, leading to crash or potential info disclosure.

Vulnerability

In ImageMagick 7.0.8-50 Q16, the AdaptiveThresholdImage function in MagickCore/threshold.c is vulnerable to a heap-based buffer over-read. The issue occurs because the function checks for a width of zero but neglects to validate whether the height is zero. When an image with a zero height is processed, the code proceeds to read beyond the allocated heap buffer, causing a crash or potential information disclosure. Affected versions include ImageMagick 7.0.8-50 and earlier versions that do not include the fix. The problem was reported in [1] and fixed in commit [3] for version 7 and commit [2] for version 6.

Exploitation

An attacker can trigger the vulnerability by providing a crafted image file that causes the AdaptiveThresholdImage function to be called with a height of zero. The proof-of-concept command from [1] is: `` magick -seed 0 -dispose Background "(" magick:netscape -lat 514x0-41 ")" "(" magick:granite -charcoal 3 -level 0%,125,0.328 ")" -combine -print "" tmp ``

No authentication or special privileges are required; the attacker only needs to convince a user or automated process to process the crafted image with ImageMagick.

Impact

Successful exploitation results in a heap-buffer-over-read, which can lead to a denial of service (crash) or potentially the disclosure of sensitive memory contents. The AddressSanitizer log from [1] shows a READ of size 4 at a wild pointer, indicating that adjacent heap data could be read. The privilege level is that of the process running ImageMagick, which may be a user's application or a server-side image processor.

Mitigation

The vulnerability is fixed in ImageMagick version 7.0.8-51 and later, as well as in ImageMagick 6 with commit [2]. Users should upgrade to a patched version immediately. The fix adds a check for both width and height being zero, returning early if either is zero. No workaround is available if an upgrade is not possible. The CVE is not listed in CISA's Known Exploited Vulnerabilities catalog.

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

13

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"Mishandling of a height of zero in AdaptiveThresholdImage leads to a heap-based buffer over-read."

Attack vector

An attacker provides a crafted image with a zero height parameter to the `-lat` (local adaptive threshold) operator, e.g. `-lat 514x0-41` [ref_id=1]. When ImageMagick processes this image via the `AdaptiveThresholdImage` function in `MagickCore/threshold.c`, the zero height causes an out-of-bounds read at line 328 [ref_id=1]. The attack is triggered through the command-line interface with no special privileges beyond the ability to invoke ImageMagick on a malicious input [ref_id=1].

Affected code

The heap-buffer-overflow occurs in `AdaptiveThresholdImage` at `MagickCore/threshold.c:328:11` [ref_id=1]. The function is called when the `-lat` (local adaptive threshold) operator is used via the CLI, as shown in the call chain through `CLISimpleOperatorImage` and `CLIOption` [ref_id=1].

What the fix does

No patch is included in the bundle. The advisory [ref_id=1] identifies the bug as a heap-buffer-overflow at `MagickCore/threshold.c:328:11` in `AdaptiveThresholdImage` caused by a height of zero being mishandled. A proper fix would need to validate that the height parameter is greater than zero before proceeding with the adaptive threshold computation, preventing the out-of-bounds memory access.

Preconditions

  • inputAttacker must supply an image and a `-lat` geometry string with a zero height (e.g., `514x0-41`).
  • networkNo network precondition; the attack is local command-line invocation.

Reproduction

Run the following command with a vulnerable ImageMagick 7.0.8-50 build (compiled with ASAN for detection): `magick -seed 0 -dispose Background "(" magick:netscape -lat 514x0-41 ")" "(" magick:granite -charcoal 3 -level 0%,125,0.328 ")" -combine -print "" tmp` [ref_id=1].

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

References

8

News mentions

0

No linked articles in our index yet.