VYPR
Unrated severityNVD Advisory· Published Mar 25, 2018· Updated Aug 5, 2024

CVE-2018-9018

CVE-2018-9018

Description

GraphicsMagick 1.3.28 contains a divide-by-zero in ReadMNGImage (coders/png.c) that can be triggered by a crafted MNG file, causing a crash and denial of service.

AI Insight

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

GraphicsMagick 1.3.28 contains a divide-by-zero in ReadMNGImage (coders/png.c) that can be triggered by a crafted MNG file, causing a crash and denial of service.

Vulnerability

In GraphicsMagick 1.3.28, the ReadMNGImage function in coders/png.c contains a divide-by-zero error at line 4638. This occurs when processing a specially crafted MNG file, leading to a floating-point exception (FPE) and program crash. The vulnerability is reachable through any operation that triggers MNG decoding, such as gm identify or gm convert.

Exploitation

An attacker can exploit this vulnerability by providing a malicious MNG file to a target using GraphicsMagick 1.3.28. No authentication or special privileges are required; the attacker only needs to convince the victim (or an automated service) to process the file using GraphicsMagick. The crash is triggered immediately upon parsing the malformed MNG data, as demonstrated by the AddressSanitizer stack trace in the bug report [1].

Impact

Successful exploitation results in a denial of service (DoS) due to the program aborting with a floating-point exception. The crash terminates the GraphicsMagick process, potentially disrupting image processing workflows. No code execution or data disclosure has been reported for this vulnerability.

Mitigation

As of the available references, no official patch has been explicitly announced. Users are advised to upgrade to a version of GraphicsMagick later than 1.3.28, as the issue was likely fixed in subsequent releases. Until an update is applied, avoid processing untrusted MNG files with GraphicsMagick.

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

11

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"A divide-by-zero error occurs in the ReadMNGImage function when processing a crafted MNG file."

Attack vector

Remote attackers can trigger this vulnerability by providing a specially crafted MNG file to the GraphicsMagick software. The vulnerability lies within the `ReadMNGImage` function in `coders/png.c`. When this function attempts to process the malicious file, it results in a division by zero error, leading to a program crash and denial of service [ref_id=1].

Affected code

The vulnerability exists in the `ReadMNGImage` function located in the file `coders/png.c` [ref_id=1]. The stack trace points to line 4638:61 within this function as the location of the divide-by-zero error [ref_id=1].

What the fix does

The advisory indicates a divide-by-zero error in the `ReadMNGImage` function of `coders/png.c` [ref_id=1]. While a specific patch is not provided in the bundle, the vulnerability is described as being fixed in later versions. The fix likely involves adding checks to prevent division by zero when processing MNG image data.

Preconditions

  • inputA crafted MNG file.

Reproduction

To reproduce the issue, build GraphicsMagick with ASAN and run: ./gm identify $POC. [ref_id=1]

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

References

7

News mentions

0

No linked articles in our index yet.