Am I affected?
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 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.
Not in the CISA KEV catalog as of the last sync. That means no confirmed exploitation is listed there, not that it is safe.
Exploit probability (FIRST EPSS): 71.5% chance of exploitation activity in the next 30 days (top 1% of all scored CVEs), scored 2026-11-23. EPSS is a likelihood estimate, not proof of attacks.
Check your PHP version
Fixed versions by branch
| Branch | Affected (NVD) | Fixed in |
|---|---|---|
| PHP 7.3 | PHP 7.3 only, 7.3.0 exactly | not stated |
| PHP 7.2 | 7.2.0 (including) to 7.2.14 (excluding) | 7.2.14 |
| PHP 7.1 | 7.0.0 (including) to 7.1.26 (excluding) | 7.1.26 |
| PHP 5.6 | PHP 5.6 only, before 5.6.40 | 5.6.40 |
"Fixed in" is shown only when the source gives an exact upper bound. Any later patch in the same branch also has the fix. Linux distributions (Ubuntu, Debian, RHEL) often backport fixes without changing the PHP version number.
Related CVEs
Other PHP CVEs that NVD lists for the same branches.
- CVE-2019-9020 Critical 9.8 · PHP 7.3, 7.2, 7.1, 7.0, 5.6 · 2019-02-22
- CVE-2019-9021 Critical 9.8 · PHP 7.3, 7.2, 7.1, 7.0, 5.6 · 2019-02-22
- CVE-2019-9023 Critical 9.8 · PHP 7.3, 7.2, 7.1, 7.0, 5.6 · 2019-02-22
- CVE-2019-9024 High 7.5 · PHP 7.3, 7.2, 7.1, 7.0, 5.6 · 2019-02-22
- CVE-2026-109619 High 8.1 · PHP 7.3, 7.2, 7.1, 7.0, 5.6 · 2026-10-21
- CVE-2019-9022 High 7.5 · PHP 7.3, 7.2, 7.1, 7.0 · 2019-02-22
Questions
- Which PHP versions are affected by CVE-2019-6977?
- NVD lists these affected ranges: PHP 7.3 only, 7.3.0 exactly; 7.2.0 (including) to 7.2.14 (excluding); 7.0.0 (including) to 7.1.26 (excluding); PHP 5.6 only, before 5.6.40.
- Which PHP version fixes CVE-2019-6977?
- According to NVD, the fix is in PHP 7.2.14, 7.1.26, 5.6.40 (upgrade to that release or any later patch in the same branch).
- Does a version check prove my server is safe from CVE-2019-6977?
- No. The SAPI, web server, operating system, loaded extensions and configuration change whether a bug can be reached, and Linux distributions often backport fixes without changing the upstream version number.
Sources: CVE-2019-6977 on NIST NVD. NVD data synced 2026-11-24T03:47:46.548Z. See all PHP CVEs in the CVE explorer.