Skip to content
Fencer Vulns
high 8.8

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 more
    affected: no fix planned “Will not fix”
  • Red Hat Enterprise Linux AppStream (v. 8) gd 2.2.5-7.el8
    fixed: 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 more
    fixed: 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 more
    fixed: 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 more
    fixed: 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 more
    not 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

  1. Published
  2. 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
Technology feeds

References

Sources

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.