VYPR
Unrated severityNVD Advisory· Published Dec 3, 2020· Updated Aug 4, 2024

CVE-2020-27760

CVE-2020-27760

Description

A divide-by-zero in ImageMagick's GammaImage() function allows denial of service via a crafted image file.

AI Insight

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

A divide-by-zero in ImageMagick's GammaImage() function allows denial of service via a crafted image file.

Vulnerability

In GammaImage() in /MagickCore/enhance.c, when a crafted input file is processed, the gamma value can cause a division-by-zero. This occurs in ImageMagick versions prior to 7.0.8-68 [1]. The patch uses PerceptibleReciprocal() to prevent the division-by-zero from occurring [1].

Exploitation

An attacker must supply a crafted image file with a specific gamma value that triggers the divide-by-zero condition. No authentication or special network position is required, as the vulnerability can be triggered by processing the malicious file [1].

Impact

Successful exploitation causes an application crash, leading to denial of service. The impact is limited to availability [1].

Mitigation

The fix is included in ImageMagick version 7.0.8-68, released November 2020. Users should upgrade to this version or later [1]. Red Hat Enterprise Linux 5, 6, and 7 are out of support scope; for RHEL 8, the package may be updated. If patching is not possible, avoid processing untrusted image files with vulnerable versions [1].

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

43

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"Missing guard against division by zero in GammaImage() when processing a crafted gamma value."

Attack vector

An attacker crafts a malicious image file with a specific `gamma` value that, when processed by ImageMagick's `GammaImage()` function, causes a division by zero. The attack requires no authentication and can be delivered over the network (e.g., via a web application that processes user-uploaded images). This results in a denial-of-service condition affecting application availability [ref_id=1].

Affected code

The vulnerability resides in `GammaImage()` in `/MagickCore/enhance.c`. A crafted input file can trigger a divide-by-zero condition depending on the `gamma` value passed to this function.

What the fix does

The patch replaces the direct division with `PerceptibleReciprocal()`, which safely handles the case where the divisor would be zero. This prevents the divide-by-zero crash while preserving the intended gamma-correction logic. The fix ensures that even a crafted `gamma` value cannot cause a floating-point exception [ref_id=1].

Preconditions

  • inputThe attacker must supply a crafted image file with a specific gamma value that triggers the division by zero.
  • configThe victim must process the crafted file using a vulnerable version of ImageMagick (prior to 7.0.8-68).
  • networkNo authentication is required; the attack can be delivered over the network.

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

References

3

News mentions

0

No linked articles in our index yet.