CVE-2019-6977: gdImageColorMatch in gd_color_match.c in the GD Graphics Library (aka LibGD) 2.2.5, as used in the imagecolormatch function in PHP before…

CVE-2019-6977 affects 105 listed versions of PHP in the Dawnsentry catalogue.

8.8CVSS high
None knownexploitation
71%EPSS (next 30 days)
27 January 2019published

Affected products and versions

The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.

PHP

105 of 250 listed versions are affected. Fixed in 7.1.26, 5.6.40. The newest release, 8.6.0, is not affected.

7.1.25 7.1.24 7.1.23 7.1.22 7.1.21 7.1.20 7.1.19 7.0.33 7.0.32 7.0.31 7.0.30 7.0.29 7.0.28 7.0.27 7.0.26 7.0.25 7.0.24 7.0.23 7.0.22 7.0.21 7.0.20 7.0.19 5.6.39 5.6.38 5.6.37 5.6.36 5.6.35 5.6.34 5.6.33 5.6.32 5.6.31 5.6.30 5.6.29 5.6.28 5.6.27 5.6.26 5.5.38 5.5.37 5.5.36 5.5.35 5.5.34 5.5.33 5.5.32 5.5.31 5.5.30 5.5.29 5.5.28 5.5.27 5.5.26 5.5.25 5.5.24 5.4.45 5.4.44 5.4.43 5.4.42 5.4.41 5.4.40 5.4.39 5.4.38 5.4.37 and 45 more

What it is

gdImageColorMatch in gd_color_match.c in the GD Graphics Library (aka LibGD) 2.2.5, as used in the imagecolormatch function in PHP before 5.6.40, 7.x before 7.1.26, 7.2.x before 7.2.14, and 7.3.x before 7.3.1, has a heap-based buffer overflow. This can be exploited by an attacker who is able to trigger imagecolormatch calls with crafted image data.

CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (NVD)

Published by MITRE on 27 January 2019. Last changed 17 June 2026.

Sources

Check one version you run: look CVE-2019-6977 up, or pick a product and version in the quick lookup.

Updated 1 December 2026.