CVE-2019-6977 in the critical feed json
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…
published 2019-01-27 7 y ago modified 2026-06-17 4 mo ago also EUVD-2019-16529
- cvss
- 8.8
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 71.5%
- EPSS 71.5% chance of exploitation in 30 days, percentile 99.4%
- public exploits
- 1
- Exploit-DB
Summary
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.
Patch / fix
- php php 5.6.40, 7.1.26, 7.2.14
- libgd2 Debian 14, Debian 13, Debian 12 2.2.5-5.1
debian advisories DEBIAN-CVE-2019-6977
- libgd2 Ubuntu 14.04 LTS 2.1.0-3ubuntu0.11
- libgd2 Ubuntu 16.04 LTS 2.1.1-4ubuntu0.16.04.11
- libgd2 Ubuntu 18.04 LTS 2.2.5-4ubuntu0.3
ubuntu advisories UBUNTU-CVE-2019-6977
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- gd RHEL 8 2.2.5-7.el8
- rh-php72-php RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
- rh-php72-php-gd RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
- rh-php72-php-cli RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
- rh-php72-php-dba RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
- rh-php72-php-dbg RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
- rh-php72-php-fpm RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
- rh-php72-php-gmp RHEL 3 SOFTWARE_COLLECTIONS 7.2.24-1.el7
red hat advisories RHSA-2020:4659RHSA-2019:3299RHSA-2019:2519
- gd SLE Module for Desktop Applications 15, SLE Module for Basesystem 15 2.2.5-4.6.1
- gd SLES for SAP 12 SP4, SLES for SAP 12 SP3, SLES 12 SP4 +7 more 2.1.0-24.12.1
- php5 SLE Software Development Kit 12 SP4, SLE Software Development Kit 12 SP3, SLE Module for Web and Scripting 12 5.5.14-109.48.1
- php53 SLES for SAP 11 SP4, SLES 11 SP4, SLE Software Development Kit 11 SP4 5.3.17-112.53.1
- php7 SLE Software Development Kit 12 SP4, SLE Software Development Kit 12 SP3, SLE Module for Web and Scripting 12 7.0.7-50.63.1
suse advisories SUSE-SU-2019:0771-1SUSE-SU-2019:0747-1SUSE-SU-2019:0449-1SUSE-SU-2019:13961-1SUSE-SU-2019:0333-1
- gd openSUSE Tumbleweed 2.3.3-1.1
- perl-GD openSUSE Tumbleweed 2.76-1.1
- gd openSUSE Leap 15.0 2.2.5-lp150.8.1
opensuse advisories openSUSE-SU-2024:10777-1openSUSE-SU-2024:11852-1openSUSE-SU-2019:1148-1
- gd AlmaLinux 8 2.2.5-7.el8
almalinux advisories ALSA-2020:4659
- gd Rocky Linux 8 2.2.5-7.el8
rocky linux advisories RLSA-2020:4659
- gd Alpine 3.24, Alpine 3.23, Alpine 3.22 +16 more 2.2.5-r2
- php7 Alpine 3.7 7.1.29-r0
alpine advisories ALPINE-CVE-2019-6977
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- gd Arch Linux 2.2.5-2
arch linux advisories AVG-865
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2019-6977 updated cvss 6.3
gd: Heap-based buffer overflow in gdImageColorMatch() in gd_color_match.c
-
Red Hat Enterprise Linux 5 gd, php, php53 Red Hat Enterprise Linux 6 gd, php, php-gd, php-cli, php-dba, php-fpm, +22 more Red Hat Enterprise Linux 7 php, php-gd, php-cli, php-dba, php-fpm, php-pdo, +18 more Red Hat Software Collections rh-php70-php, rh-php70-php-gd, rh-php70-php-cli, rh-php70-php-dba, rh-php70-php-dbg, rh-php70-php-fpm, +24 moreaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux AppStream (v. 8) gd 2.2.5-7.el8fixed: vendor fix RHSA-2020:4659
-
Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-php71-php 7.1.30-1.el7, rh-php72-php 7.2.24-1.el7, rh-php71-php-gd 7.1.30-1.el7, rh-php72-php-gd 7.2.24-1.el7, rh-php71-php-cli 7.1.30-1.el7, rh-php71-php-dba 7.1.30-1.el7, +50 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.4) rh-php71-php 7.1.30-1.el7, rh-php71-php-gd 7.1.30-1.el7, rh-php71-php-cli 7.1.30-1.el7, rh-php71-php-dba 7.1.30-1.el7, rh-php71-php-dbg 7.1.30-1.el7, rh-php71-php-fpm 7.1.30-1.el7, +22 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5) rh-php71-php 7.1.30-1.el7, rh-php72-php 7.2.24-1.el7, rh-php71-php-gd 7.1.30-1.el7, rh-php72-php-gd 7.2.24-1.el7, rh-php71-php-cli 7.1.30-1.el7, rh-php71-php-dba 7.1.30-1.el7, +50 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.6) rh-php71-php 7.1.30-1.el7, rh-php72-php 7.2.24-1.el7, rh-php71-php-gd 7.1.30-1.el7, rh-php72-php-gd 7.2.24-1.el7, rh-php71-php-cli 7.1.30-1.el7, rh-php71-php-dba 7.1.30-1.el7, +50 morefixed: vendor fix RHSA-2019:2519
-
Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-php72-php 7.2.24-1.el7, rh-php72-php-gd 7.2.24-1.el7, rh-php72-php-cli 7.2.24-1.el7, rh-php72-php-dba 7.2.24-1.el7, rh-php72-php-dbg 7.2.24-1.el7, rh-php72-php-fpm 7.2.24-1.el7, +22 morefixed: vendor fix RHSA-2019:3299
-
Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-php71-php 7.1.30-1.el7, rh-php72-php 7.2.24-1.el7, rh-php71-php-gd 7.1.30-1.el7, rh-php72-php-gd 7.2.24-1.el7, rh-php71-php-cli 7.1.30-1.el7, rh-php71-php-dba 7.1.30-1.el7, +50 morefixed: vendor fix RHSA-2019:2519
-
Red Hat Enterprise Linux 7 gd, gd-progs Red Hat Enterprise Linux 8 php, libzip, php-gd, php-cli, php-dba, php-dbg, +30 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Timeline
- Published
- First public exploit (EDB-46677)
Exploit prediction
71.50% chance of exploitation in the next 30 days, higher than 99.4% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- EDB-46677 PHP 7.2 - 'imagecolormatch()' Out of Band Heap Write remote, 2019-02-27
- bugs.php.net https://bugs.php.net/bug.php?id=77270 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.0 | 8.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.8 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
Classification
- Weakness
-
- CWE-787 Out-of-bounds Write
- Technology feeds
References
-
security.netapp.com
/advisory/ntap-20190315-0003/
patch, third-party-advisory
-
exploit-db.com
/exploits/46677/
exploit
-
bugs.php.net
/bug.php?id=77270
exploit, issue-tracking, mailing-list, vendor-advisory
-
usn.ubuntu.com
/3900-1/
vendor-advisory, third-party-advisory
-
debian.org
/security/2019/dsa-4384
vendor-advisory, third-party-advisory
-
security.gentoo.org
/glsa/201903-18
vendor-advisory, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-04/msg00025.html
vendor-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-04/msg00031.html
vendor-advisory
-
access.redhat.com
/errata/RHSA-2019:2519
vendor-advisory
-
access.redhat.com
/errata/RHSA-2019:3299
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/TEYUUOW75YD3DENIPYMO263E6NL2NFHI/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/3WRUPZVT2MWFUEMVGTRAGDOBHLNMGK5R/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/TTXSLRZI5BCQT3H5KALG3DHUWUMNPDX2/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/3CZ2QADQTKRHTGB2AHD7J4QQNDLBEMM6/
vendor-advisory
-
php.net
/ChangeLog-5.php
release-notes, vendor-advisory
-
php.net
/ChangeLog-7.php
release-notes, vendor-advisory
-
securityfocus.com
/bid/106731
vdb-entry, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2019/01/msg00028.html
mailing-list, third-party-advisory
- packetstormsecurity.com /files/152459/PHP-7.2-imagecolormatch-Out-Of-Band-Heap-Write.html
Sources
- CVE List CVE-2019-6977
- NVD CVE-2019-6977
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.