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…
Noroxi assessment
Priority: Plan (action score 56/100)
- Public proof-of-concept code exists (Exploit-DB, GitHub); there is no record of exploitation in the wild.
- Probability of exploitation in the next 30 days: 71.4% (FIRST EPSS); higher than 99.4% of all records.
- 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.
- Fixed version: gd (AlmaLinux:8) 2.2.5-7.el8; gd-devel (AlmaLinux:8) 2.2.5-7.el8; gd (Alpine:v3.10) 2.2.5-r2.
Add it to your regular patch cycle. Upgrade to gd (AlmaLinux:8) 2.2.5-7.el8; gd-devel (AlmaLinux:8) 2.2.5-7.el8; gd (Alpine:v3.10) 2.2.5-r2 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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.
- Published
- Jan 26, 2019
- Updated
- Jun 16, 2026
- EPSS
- 71.4% · 99th percentile
- CWE
- CWE-787
Report tools
Action score
56
Add it to your regular patch cycle.
- CVSS
- 35 / 40 · 8.8 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 21 / 30 · 71.4%
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- Proof of concept exists, no weaponized module
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| libgd | libgd | cpe:2.3:a:libgd:libgd |
| php | php | cpe:2.3:a:php:php |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
| canonical | ubuntu linux | cpe:2.3:o:canonical:ubuntu_linux |
| netapp | storage automation store | cpe:2.3:a:netapp:storage_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.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | gd | before 2.2.5-7.el8 | 2.2.5-7.el8 |
| AlmaLinux:8 | gd-devel | before 2.2.5-7.el8 | 2.2.5-7.el8 |
| Alpine:v3.10 | gd | before 2.2.5-r2 | 2.2.5-r2 |
| Alpine:v3.7 | php7 | before 7.1.29-r0 | 7.1.29-r0 |
| Debian:12 | libgd2 | before 2.2.5-5.1 | 2.2.5-5.1 |
| Debian:8 | libgd2 | before 2.1.0-5+deb8u12 | 2.1.0-5+deb8u12 |
| Debian:8 | php5 | before 5.6.40+dfsg-0+deb8u1 | 5.6.40+dfsg-0+deb8u1 |
| Debian:9 | libgd2 | before 2.2.4-2+deb9u4 | 2.2.4-2+deb9u4 |
| openSUSE:Leap 15.0 | gd | before 2.2.5-lp150.8.1 | 2.2.5-lp150.8.1 |
| openSUSE:Tumbleweed | gd | before 2.3.3-1.1 | 2.3.3-1.1 |
| openSUSE:Tumbleweed | perl-GD | before 2.76-1.1 | 2.76-1.1 |
| Red Hat:enterprise_linux:8::appstream | gd | before 0:2.2.5-7.el8 | 0:2.2.5-7.el8 |
| Red Hat:enterprise_linux:8::appstream | gd-debuginfo | before 0:2.2.5-7.el8 | 0:2.2.5-7.el8 |
| Red Hat:enterprise_linux:8::appstream | gd-debugsource | before 0:2.2.5-7.el8 | 0:2.2.5-7.el8 |
| Red Hat:enterprise_linux:8::appstream | gd-devel | before 0:2.2.5-7.el8 | 0:2.2.5-7.el8 |
| Red Hat:enterprise_linux:8::appstream | gd-progs-debuginfo | before 0:2.2.5-7.el8 | 0:2.2.5-7.el8 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-bcmath | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-cli | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-common | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-dba | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-dbg | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-debuginfo | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
| Red Hat:rhel_software_collections:3::el7 | rh-php72-php-devel | before 0:7.2.24-1.el7 | 0:7.2.24-1.el7 |
+28
Same product
libgd: all recordsOther 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…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
Published before and after this one in the same product
- ← EarlierCVE-2017-6362Sep 7, 2017 · Double free vulnerability in the gdImagePngPtr function in libgd2 before 2.2.5 allows remote attackers to cause a denial of service via…32Monitor
- ← EarlierCVE-2018-1000222Aug 20, 2018 · Libgd version 2.2.5 contains a Double Free Vulnerability vulnerability in gdImageBmpPtr Function that can result in Remote Code Execution .36Monitor
- Later →CVE-2019-6978Jan 28, 2019 · The 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
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| almalinux:gd | 2.2.5-7.el8 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:gd-devel | 2.2.5-7.el8 · AlmaLinux:8 | Package registry (OSV) |
| alpine:gd | 2.2.5-r2 · Alpine:v3.10 | Package registry (OSV) |
| alpine:php7 | 7.1.29-r0 · Alpine:v3.7 | Package registry (OSV) |
| debian:libgd2 | 2.2.5-5.1 · Debian:12 | Package registry (OSV) |
| debian:php5 | 5.6.40+dfsg-0+deb8u1 · Debian:8 | Package registry (OSV) |
| opensuse:gd | 2.2.5-lp150.8.1 · openSUSE:Leap 15.0 | Package registry (OSV) |
| opensuse:perl-GD | 2.76-1.1 · openSUSE:Tumbleweed | Package registry (OSV) |
| red hat:rh-php72-php | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-bcmath | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-cli | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-common | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-dba | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-dbg | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-debuginfo | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-devel | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-embedded | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-enchant | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-fpm | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| red hat:rh-php72-php-gd | 0:7.2.24-1.el7 · Red Hat:rhel_software_collections:3::el7 | Package registry (OSV) |
| rocky linux:gd | 0:2.2.5-7.el8 · Rocky Linux:8 | Package registry (OSV) |
| suse:gd | 2.1.0-24.12.1 · SUSE:Linux Enterprise Desktop 12 SP3 | Package registry (OSV) |
| suse:php5 | 5.5.14-109.48.1 · SUSE:Linux Enterprise Module for Web and Scripting 12 | Package registry (OSV) |
| suse:php53 | 5.3.17-112.53.1 · SUSE:Linux Enterprise Software Development Kit 11 SP4 | Package registry (OSV) |
| suse:php7 | 7.0.7-50.63.1 · SUSE:Linux Enterprise Module for Web and Scripting 12 | Package 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.
| Source | Kind | Date |
|---|---|---|
| Exploit-DB entry | remote | 2019-02-27 |
| Proof-of-concept repository on GitHub | stars:0 | 2026-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.
- Published
- First PoC+31 d
- TodayNov 16, 2026+2850 d
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Not on record for this CVE: patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
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 WriteCVSS 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.
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (15 more)Show less
- lists.opensuse.org/opensuse-security-announce/2019-04/msg00031.html
- php.net/ChangeLog-5.php
- php.net/ChangeLog-7.php
- www.securityfocus.com/bid/106731
- access.redhat.com/errata/RHSA-2019:2519
- access.redhat.com/errata/RHSA-2019:3299
- lists.debian.org/debian-lts-announce/2019/01/msg00028.html
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3CZ2QADQTKRHTGB2AHD7J4QQNDLBEMM6/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3WRUPZVT2MWFUEMVGTRAGDOBHLNMGK5R/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TEYUUOW75YD3DENIPYMO263E6NL2NFHI/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TTXSLRZI5BCQT3H5KALG3DHUWUMNPDX2/
- security.gentoo.org/glsa/201903-18
- security.netapp.com/advisory/ntap-20190315-0003/
- usn.ubuntu.com/3900-1/
- www.debian.org/security/2019/dsa-4384
Vendor advisories and official records. Exploit/PoC links are deliberately left out.