Skip to main content
Public proof of conceptFix available

CVE-2019-6977

A public proof of concept exists; no exploitation attested.

  • Published2019-01-27
  • WeaknessCWE-787

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2019-01-2702:29CVE publishedNVD
  2. 2019-02-27Exploit-DB entryExploit-DB

Observed activity

isMalicious corpus · updated 2026-11-03 21:37 UTC
Indicators tagged with this CVE, per day0 indicators over 7 days
Block these indicators
  • Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2019-6977?format=txt
  • CSV export: https://api.ismalicious.com/edl/cve/CVE-2019-6977?format=csv
  • TAXII collection of exploited CVEs
  • The EDL and CSV take an API key on the Pro plan.

Versions per branch

NVD
Canonical ubuntu linux
BranchAffectedFixed in
14.4= 14.04no fix published
16.4= 16.04no fix published
18.4= 18.04no fix published
18.10= 18.10no fix published
PHP
BranchAffectedFixed in
7.2≥ 7.2.0, < 7.2.147.2.14
7.x≥ 7.0.0, < 7.1.267.1.26
5.6< 5.6.405.6.40
7.3= 7.3.0no fix published
Debian debian linux
BranchAffectedFixed in
8.0= 8.0no fix published
9.0= 9.0no fix published

2 more products in the sources.

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • gdSUSE:Linux Enterprise Workstation Extension 12 SP4all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Workstation Extension 12 SP3all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Software Development Kit 12 SP4all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Software Development Kit 12 SP3all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Server for SAP Applications 12 SP4all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Server for SAP Applications 12 SP3all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Server 12 SP4all versions · fixed in 2.1.0-24.12.1
  • gdSUSE:Linux Enterprise Server 12 SP3all versions · fixed in 2.1.0-24.12.1

53 more package ranges on OSV.dev

Vendor advisories

  • CVE-2019-6977 Red Hat Product Security876 products fixed · 92 known affected

    gd: Heap-based buffer overflow in gdImageColorMatch() in gd_color_match.c

    gd.src as a component of Red Hat Enterprise Linux 5 · php.src as a component of Red Hat Enterprise Linux 5 · php53.src as a component of Red Hat Enterprise Linux 5 · +89 more

  • RHSA-2020:4659 Red Hat Product Security26 products fixed

    Red Hat Security Advisory: gd security update

  • RHSA-2019:3299 Red Hat Product Security425 products fixed

    Red Hat Security Advisory: rh-php72-php security update

  • RHSA-2019:2519 Red Hat Product Security425 products fixed

    Red Hat Security Advisory: rh-php71-php security, bug fix, and enhancement update

Full record on NVD

Fix

  1. Vendor fix Red Hat Product Security RHSA-2020:4659 · 26 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
  2. Vendor fix Red Hat Product Security RHSA-2019:3299 · 486 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 After installing the updated packages, the httpd daemon must be restarted for the update to take effect.
  3. No fix planned, says the vendor Red Hat Product Security CVE-2019-6977 · 92 productsWill not fix

Advisories and patches

Detection

read 2026-11-02 22:42 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
EDB-46677
Exploit-DB
Proof-of-concept repositories
1 repository, unverifiedHORKimhab/CVE-2022-31626-CVE-2024-2961-CVE-2019-6977
PoC-in-GitHub
Metasploit modules
none listed
Metasploit Framework

Sources

  • NVDCVSS 3.08.8read 2026-10-23
  • NVDCVSS 2.06.8read 2026-10-23
  • NVDweakness (CWE)CWE-787read 2026-10-23
  • FIRST EPSSEPSS score71.5 %read 2026-11-02
  • PoC-in-GitHubproof of concept1read 2026-11-02
  • Exploit-DBdetectionread 2026-11-02
  • OSVaffected packages—

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Published
2019-01-27
Last Modified
2026-06-17
NVD status
Modified

Frequently asked questions

What is 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.

Is CVE-2019-6977 actively exploited?

Active exploitation of CVE-2019-6977 has not been confirmed. Its EPSS score was 71.5% on 2026-11-03, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2019-6977?

CVE-2019-6977 has a CVSS v3 base score of 8.8 (HIGH severity), with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

Running gd? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record