gdImageColorMatch in gd_color_match.c in the GD Graphics Library (aka LibGD) 2.2.5, as…
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 7 fixed, 4 without a fix
Attack profile from CVSS 3.0 · NVD. Fix status from CNA and Red Hat. Impact type from CWE-787 and the CVSS impact.
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
CPE configurations NVD · 10
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:libgd:libgd:2.2.5:*:*:*:*:*:*:* | 2.2.5 | Vulnerable | Libgd |
| cpe:2.3:a:php:php:*:*:*:*:*:*:*:* | before 5.6.40; 7.0.0 to before 7.1.26; 7.2.0 to before 7.2.14 | Vulnerable | PHP |
| cpe:2.3:a:php:php:7.3.0:*:*:*:*:*:*:* | 7.3.0 | Vulnerable | PHP |
| cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:* | 8.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:* | 14.04 | Vulnerable | Canonical |
| cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:* | 16.04 | Vulnerable | Canonical |
| cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:* | 18.04 | Vulnerable | Canonical |
| cpe:2.3:o:canonical:ubuntu_linux:18.10:*:*:*:*:*:*:* | 18.10 | Vulnerable | Canonical |
| cpe:2.3:a:netapp:storage_automation_store:*:*:*:*:*:*:*:* | all versions | Vulnerable | NetApp |
- cpe:2.3:a:libgd:libgd:2.2.5:*:*:*:*:*:*:* Versions 2.2.5 Vulnerable ·Libgd
- cpe:2.3:a:php:php:*:*:*:*:*:*:*:* Versions before 5.6.40; 7.0.0 to before 7.1.26; 7.2.0 to before 7.2.14 Vulnerable ·PHP
- cpe:2.3:a:php:php:7.3.0:*:*:*:*:*:*:* Versions 7.3.0 Vulnerable ·PHP
- cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:* Versions 8.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:* Versions 14.04 Vulnerable ·Canonical
- cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:* Versions 16.04 Vulnerable ·Canonical
- cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:* Versions 18.04 Vulnerable ·Canonical
- cpe:2.3:o:canonical:ubuntu_linux:18.10:*:*:*:*:*:*:* Versions 18.10 Vulnerable ·Canonical
- cpe:2.3:a:netapp:storage_automation_store:*:*:*:*:*:*:*:* Versions all versions Vulnerable ·NetApp
Remediation
Red Hat 3 advisories
- RHSA-2020:4659 Released 2020-11-04 · Red Hat rating Moderategd security update
- Red Hat Enterprise Linux AppStream (v. 8) gd-2.2.5-7.el8, gd-devel-2.2.5-7.el8
- RHSA-2019:3299 Released 2019-11-01 · Red Hat rating Criticalrh-php72-php security update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-php72-php-7.2.24-1.el7, rh-php72-php-bcmath-7.2.24-1.el7, rh-php72-php-cli-7.2.24-1.el7 +26
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5) rh-php72-php-7.2.24-1.el7, rh-php72-php-bcmath-7.2.24-1.el7, rh-php72-php-cli-7.2.24-1.el7 +26
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.6) rh-php72-php-7.2.24-1.el7, rh-php72-php-bcmath-7.2.24-1.el7, rh-php72-php-cli-7.2.24-1.el7 +26
- 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-bcmath-7.2.24-1.el7, rh-php72-php-cli-7.2.24-1.el7 +26
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-php72-php-7.2.24-1.el7, rh-php72-php-bcmath-7.2.24-1.el7, rh-php72-php-cli-7.2.24-1.el7 +26
- RHSA-2019:2519 Released 2019-08-19 · Red Hat rating Moderaterh-php71-php security, bug fix, and enhancement update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-php71-php-7.1.30-1.el7, rh-php71-php-bcmath-7.1.30-1.el7, rh-php71-php-cli-7.1.30-1.el7 +26
- 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-bcmath-7.1.30-1.el7, rh-php71-php-cli-7.1.30-1.el7 +26
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5) rh-php71-php-7.1.30-1.el7, rh-php71-php-bcmath-7.1.30-1.el7, rh-php71-php-cli-7.1.30-1.el7 +26
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.6) rh-php71-php-7.1.30-1.el7, rh-php71-php-bcmath-7.1.30-1.el7, rh-php71-php-cli-7.1.30-1.el7 +26
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-php71-php-7.1.30-1.el7, rh-php71-php-bcmath-7.1.30-1.el7, rh-php71-php-cli-7.1.30-1.el7 +26
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 5 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Will not fix |
| Red Hat Software Collections | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2020:4659 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2019:2519, RHSA-2019:3299 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.4) | Fixed | RHSA-2019:2519 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5) | Fixed | RHSA-2019:2519, RHSA-2019:3299 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.6) | Fixed | RHSA-2019:2519, RHSA-2019:3299 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) | Fixed | RHSA-2019:3299 |
| Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2019:2519, RHSA-2019:3299 |
Not affected: 2 products
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
Timeline
- 2026-10-02 Threatist record created from CVE-2019-6977
- 2026-10-03 Alias added: GHSA-3jrx-xgc5-h2f9
References
Advisory 14
- http://php.net/ChangeLog-5.php
- http://php.net/ChangeLog-7.php
- USN-3900-1
- [debian-lts-announce] 20190130 [SECURITY] [DLA 1651-1] libgd2 security update
- DSA-4384
- GLSA-201903-18
- openSUSE-SU-2019:1148
- openSUSE-SU-2019:1140
- RHSA-2019:2519
- RHSA-2019:3299
- FEDORA-2019-ab7d22a466
- FEDORA-2019-d7f8995451
- FEDORA-2019-7a06c0e6b4
- FEDORA-2020-e795f92d79
Sources
- CVE-2019-6977 · CVE Program
- CVE-2019-6977 · NVD
- FIRST EPSS
- GHSA-3jrx-xgc5-h2f9 · GitHub Advisory Database · CC BY 4.0
- CVE-2019-6977 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences