cve.bz

CVE-2019-6977 Out-of-bounds Write

8.8 highExploitEPSS 71%Fix available

High (8.8). EPSS 71% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.0

8.8 high
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
71% (unchanged from 71% a week ago; 71% 30 days ago) estimated probability of exploitation activity in the next 30 days; 99th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-787 Out-of-bounds Write
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2019-6977 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2019-6977?via=ask-ai-copy and https://cve.bz/cve/CVE-2019-6977?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2019-6977 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
libgd:libgd2.2.5
php:phpbefore 5.6.40
php:phpfrom 7.0.0 before 7.1.26
php:phpfrom 7.2.0 before 7.2.14
php:php7.3.0
debian:debian_linux8.0
debian:debian_linux9.0
canonical:ubuntu_linux14.04
canonical:ubuntu_linux16.04
canonical:ubuntu_linux18.04
canonical:ubuntu_linux18.10

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian8libgd22.1.0-5+deb8u12DLA-1651-1
Debian8php55.6.40+dfsg-0+deb8u1DLA-1679-1
Debian9libgd22.2.4-2+deb9u4DSA-4384-1
Debian12, 13, 14libgd22.2.5-5.1DEBIAN-CVE-2019-6977
Ubuntu14.04:LTSlibgd22.1.0-3ubuntu0.11UBUNTU-CVE-2019-6977 USN-3900-1
Ubuntu16.04:LTSlibgd22.1.1-4ubuntu0.16.04.11UBUNTU-CVE-2019-6977 USN-3900-1
Ubuntu18.04:LTSlibgd22.2.5-4ubuntu0.3UBUNTU-CVE-2019-6977 USN-3900-1
Red Hatenterprise_linux:8::appstreamgd, gd-devel, gd-debuginfo and 2 more0:2.2.5-7.el8RHSA-2020:4659
Red Hatrhel_software_collections:3::el7rh-php71-php, rh-php71-php-gd, rh-php71-php-cli and 27 more0:7.1.30-1.el7RHSA-2019:2519
Red Hatrhel_software_collections:3::el7rh-php72-php, rh-php72-php-gd, rh-php72-php-cli and 27 more0:7.2.24-1.el7RHSA-2019:3299
SUSELinux Enterprise Desktop 12 SP3, Linux Enterprise Desktop 12 SP4, Linux Enterprise Server 12 SP3 and 7 moregd2.1.0-24.12.1SUSE-SU-2019:0747-1
SUSELinux Enterprise Module for Basesystem 15, Linux Enterprise Module for Desktop Applications 15gd2.2.5-4.6.1SUSE-SU-2019:0771-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Software Development Kit 12 SP3, Linux Enterprise Software Development Kit 12 SP4php55.5.14-109.48.1SUSE-SU-2019:0449-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Software Development Kit 12 SP3, Linux Enterprise Software Development Kit 12 SP4php77.0.7-50.63.1SUSE-SU-2019:0333-1
SUSELinux Enterprise Server 11 SP4, Linux Enterprise Server for SAP Applications 11 SP4, Linux Enterprise Software Development Kit 11 SP4php535.3.17-112.53.1SUSE-SU-2019:13961-1
openSUSELeap 15.0gd2.2.5-lp150.8.1openSUSE-SU-2019:1148-1
openSUSETumbleweedgd2.3.3-1.1openSUSE-SU-2024:10777-1
openSUSETumbleweedperl-GD2.76-1.1openSUSE-SU-2024:11852-1
AlmaLinux8gd, gd-devel2.2.5-7.el8ALSA-2020:4659
Rocky Linux8gd0:2.2.5-7.el8RLSA-2020:4659
Alpinev3.6, v3.7, v3.8 and 16 moregd2.2.5-r2ALPINE-CVE-2019-6977
Alpinev3.7php77.1.29-r0ALPINE-CVE-2019-6977

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8gd-0:2.2.5-7.el8Fixed 2020-11-04RHSA-2020:4659
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-php71-php-0:7.1.30-1.el7Fixed 2019-08-19RHSA-2019:2519
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-php72-php-0:7.2.24-1.el7Fixed 2019-11-01RHSA-2019:3299
Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUSrh-php71-php-0:7.1.30-1.el7Fixed 2019-08-19RHSA-2019:2519
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUSrh-php71-php-0:7.1.30-1.el7Fixed 2019-08-19RHSA-2019:2519
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUSrh-php72-php-0:7.2.24-1.el7Fixed 2019-11-01RHSA-2019:3299
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUSrh-php71-php-0:7.1.30-1.el7Fixed 2019-08-19RHSA-2019:2519
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUSrh-php72-php-0:7.2.24-1.el7Fixed 2019-11-01RHSA-2019:3299
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-php72-php-0:7.2.24-1.el7Fixed 2019-11-01RHSA-2019:3299
Red Hat Enterprise Linux 5gdWill not fix
Red Hat Enterprise Linux 5phpWill not fix
Red Hat Enterprise Linux 5php53Will not fix
Red Hat Enterprise Linux 6gdWill not fix
Red Hat Enterprise Linux 6phpWill not fix
Red Hat Enterprise Linux 7gdNot affected
Red Hat Enterprise Linux 7phpWill not fix
Red Hat Enterprise Linux 8php:7.2/phpNot affected
Red Hat Software Collectionsrh-php70-phpWill not fix

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2019-6977.

Public exploits

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

References

Check your stackJSON