Skip to content
Noroxi
CVE-2019-6977· NVD / CVE Program· CNA mitre

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.

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.

HighCVSS 8.8 · v3.0—Proof of concept Fix available
Published
Jan 26, 2019
Updated
Jun 16, 2026
EPSS
71.5% · 99th percentile
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

Action score

56

Plan

Add it to your regular patch cycle.

CVSS
35 / 40 · 8.8 / 10
CISA KEV
0 / 30 · Not listed
EPSS
21 / 30 · 71.5%

Affected systems

VendorProduct
libgdlibgd
phpphp
debiandebian linux
canonicalubuntu linux
netappstorage automation store

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • php phpbefore 5.6.40
  • php php7.0.0 and later · before 7.1.26
  • php php7.2.0 and later · before 7.2.14
  • php php7.3.0

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
AlmaLinux:8gdbefore 2.2.5-7.el82.2.5-7.el8
AlmaLinux:8gd-develbefore 2.2.5-7.el82.2.5-7.el8
Alpine:v3.10gdbefore 2.2.5-r22.2.5-r2
Debian:12libgd2before 2.2.5-5.12.2.5-5.1
Debian:8libgd2before 2.1.0-5+deb8u122.1.0-5+deb8u12
Debian:8php5before 5.6.40+dfsg-0+deb8u15.6.40+dfsg-0+deb8u1
Debian:9libgd2before 2.2.4-2+deb9u42.2.4-2+deb9u4
openSUSE:Leap 15.0gdbefore 2.2.5-lp150.8.12.2.5-lp150.8.1
openSUSE:Tumbleweedgdbefore 2.3.3-1.12.3.3-1.1
openSUSE:Tumbleweedperl-GDbefore 2.76-1.12.76-1.1
Red Hat:enterprise_linux:8::appstreamgdbefore 0:2.2.5-7.el80:2.2.5-7.el8
Red Hat:enterprise_linux:8::appstreamgd-debuginfobefore 0:2.2.5-7.el80:2.2.5-7.el8
Red Hat:enterprise_linux:8::appstreamgd-debugsourcebefore 0:2.2.5-7.el80:2.2.5-7.el8
Red Hat:enterprise_linux:8::appstreamgd-develbefore 0:2.2.5-7.el80:2.2.5-7.el8
Red Hat:enterprise_linux:8::appstreamgd-progs-debuginfobefore 0:2.2.5-7.el80:2.2.5-7.el8
Red Hat:rhel_software_collections:3::el7rh-php72-phpbefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-bcmathbefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-clibefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-commonbefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-dbabefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-dbgbefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-debuginfobefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-develbefore 0:7.2.24-1.el70:7.2.24-1.el7
Red Hat:rhel_software_collections:3::el7rh-php72-php-embeddedbefore 0:7.2.24-1.el70:7.2.24-1.el7

+27

Other highest-scoring records for the same primary product.

  • CVE-2016-3074Integer signedness error in GD Graphics Library 2.1.1 (aka libgd or libgd2) allows remote attackers to cause a denial of service (crash) or
    50Plan
  • CVE-2016-10166Integer underflow in the _gdContributionsAlloc function in gd_interpolation.c in the GD Graphics Library (aka libgd) before 2.2.4 allows rem
    42Plan
  • CVE-2016-7568Integer overflow in the gdImageWebpCtx function in gd_webp.c in the GD Graphics Library (aka libgd) through 2.2.3, as used in PHP through 7.
    41Plan
  • CVE-2019-6978The GD Graphics Library (aka LibGD) 2.2.5 has a double free in the gdImage*Ptr() functions in gd_gif_out.c, gd_jpeg.c, and gd_wbmp.c.
    40Plan
  • CVE-2016-6912Double free vulnerability in the gdImageWebPtr function in the GD Graphics Library (aka libgd) before 2.2.4 allows remote attackers to have
    40Plan
  • CVE-2016-8670Integer signedness error in the dynamicGetbuf function in gd_io_dp.c in the GD Graphics Library (aka libgd) through 2.2.3, as used in PHP be
    40Plan

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
almalinux:gd2.2.5-7.el8 · AlmaLinux:8Package registry (OSV)
almalinux:gd-devel2.2.5-7.el8 · AlmaLinux:8Package registry (OSV)
alpine:gd2.2.5-r2 · Alpine:v3.10Package registry (OSV)
debian:libgd22.2.5-5.1 · Debian:12Package registry (OSV)
debian:php55.6.40+dfsg-0+deb8u1 · Debian:8Package registry (OSV)
opensuse:gd2.2.5-lp150.8.1 · openSUSE:Leap 15.0Package registry (OSV)
opensuse:perl-GD2.76-1.1 · openSUSE:TumbleweedPackage registry (OSV)
red hat:rh-php72-php0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-bcmath0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-cli0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-common0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-dba0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-dbg0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-debuginfo0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-devel0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-embedded0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-enchant0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-fpm0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
red hat:rh-php72-php-gd0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7Package registry (OSV)
rocky linux:gd0:2.2.5-7.el8 · Rocky Linux:8Package registry (OSV)
suse:gd2.1.0-24.12.1 · SUSE:Linux Enterprise Desktop 12 SP3Package registry (OSV)
suse:php55.5.14-109.48.1 · SUSE:Linux Enterprise Module for Web and Scripting 12Package registry (OSV)
suse:php535.3.17-112.53.1 · SUSE:Linux Enterprise Software Development Kit 11 SP4Package registry (OSV)
suse:php77.0.7-50.63.1 · SUSE:Linux Enterprise Module for Web and Scripting 12Package registry (OSV)

Exploit status

Proof of concept available

A public proof of concept or detection signature exists. Exploit knowledge is out there; don't delay patching.

Evidence

  • Exploit-DB entry ×1
  • Proof-of-concept repository on GitHub ×1

Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.

Public exploit evidence
SourceKindDate
Exploit-DB entryremote2019-02-27
Proof-of-concept repository on GitHubstars:02026-08-06

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

  1. Published
  2. First PoC+31 d
  3. TodaySep 30, 2026+2804 d
EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

No commit or PR link among the references.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

No credits in the CNA record.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

No nightly-computed relations.

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

No known public program.

Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • A user must open a link or visit a page.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
high · data can be read
Integrity
high · data or configuration can be modified
Availability
high · the service can be disrupted
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality impact
High
Integrity impact
High
Availability impact
High

Weakness class (CWE)

CWE-787 · Out-of-bounds Write

CVSS vector

CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

nvd-primary

Attack context

MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.

MITRE has no CAPEC/ATT&CK mapping for this CWE.

Noroxi analysis

No Noroxi analysis for this record yet

We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.

We use this product, ask for help

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records