What’s Vulnerable › Vulnerabilities
CVE-2019-6977
- Severity: high (CVSS 8.8 v3.0)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 71.5% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2019-01-27 · updated 2026-06-17
- Weakness: CWE-787
Description
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.
Affected products
- Canonical Ubuntu Linux: 14.04, 16.04, 18.04, 18.10
- Debian Linux: 8.0, 9.0
- Libgd: 2.2.5
- NetApp Storage Automation Store: all versions
- PHP: before 5.6.40; from 7.0.0 before 7.1.26; from 7.2.0 before 7.2.14; 7.3.0 — fixed in 5.6.40, 7.1.26, 7.2.14
How to fix
Upgrade to a fixed version: PHP 5.6.40, 7.1.26, 7.2.14. Check the vendor advisory for mitigations.
References
- http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00025.html
- http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00031.html
- http://packetstormsecurity.com/files/152459/PHP-7.2-imagecolormatch-Out-Of-Band-Heap-Write.html
- http://php.net/ChangeLog-5.php
- http://php.net/ChangeLog-7.php
- http://www.securityfocus.com/bid/106731
- https://access.redhat.com/errata/RHSA-2019:2519
- https://access.redhat.com/errata/RHSA-2019:3299
- https://bugs.php.net/bug.php?id=77270
- https://lists.debian.org/debian-lts-announce/2019/01/msg00028.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3CZ2QADQTKRHTGB2AHD7J4QQNDLBEMM6/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3WRUPZVT2MWFUEMVGTRAGDOBHLNMGK5R/
Get alerted when CVE-2019-6977 or the next vulnerability affects your stack