CVE-2019-6977

HIGH

GD Graphics Library <2.2.5 - Buffer Overflow

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2019-6977. PoCs published by cfreal.

AI-analyzed exploit summary This exploit leverages an out-of-bounds heap write vulnerability in PHP's imagecolormatch() function (CVE-2019-6977) to achieve arbitrary memory manipulation and remote code execution. It uses a combination of memory spraying, address leakage, and manipulation of internal PHP structures to execute arbitrary commands.

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.

Exploits (1)

exploitdb WORKING POC
by cfreal · phpremotephp
https://www.exploit-db.com/exploits/46677

This exploit leverages an out-of-bounds heap write vulnerability in PHP's imagecolormatch() function (CVE-2019-6977) to achieve arbitrary memory manipulation and remote code execution. It uses a combination of memory spraying, address leakage, and manipulation of internal PHP structures to execute arbitrary commands.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Complex
Reliability
Reliable
Target: PHP 7.2.x (tested on 7.2.12)
No auth needed
Prerequisites: PHP 7.2.x with GD library enabled · Ability to execute arbitrary PHP code on the target system
devstral-2 · analyzed Feb 16, 2026 Full analysis →

References (19)

Core 19
Core References
Third Party Advisory, VDB Entry vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/106731
Patch, Third Party Advisory x_refsource_confirm
https://security.netapp.com/advisory/ntap-20190315-0003/
Release Notes, Vendor Advisory x_refsource_misc
http://php.net/ChangeLog-5.php
Release Notes, Vendor Advisory x_refsource_misc
http://php.net/ChangeLog-7.php
Third Party Advisory vendor-advisory x_refsource_ubuntu
https://usn.ubuntu.com/3900-1/
Mailing List, Third Party Advisory mailing-list x_refsource_mlist
https://lists.debian.org/debian-lts-announce/2019/01/msg00028.html
Exploit, Issue Tracking, Mailing List, Vendor Advisory x_refsource_misc
https://bugs.php.net/bug.php?id=77270
Third Party Advisory vendor-advisory x_refsource_debian
https://www.debian.org/security/2019/dsa-4384
Third Party Advisory vendor-advisory x_refsource_gentoo
https://security.gentoo.org/glsa/201903-18
Exploit, Third Party Advisory exploit x_refsource_exploit-db
https://www.exploit-db.com/exploits/46677/
Vendor Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2019:2519
Vendor Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2019:3299

Scores

CVSS v3 8.8
EPSS 0.6512
EPSS Percentile 99.2%
Attack Vector NETWORK
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Details

CWE
CWE-787
Status published
Products (10)
canonical/ubuntu_linux 14.04
canonical/ubuntu_linux 16.04
canonical/ubuntu_linux 18.04
canonical/ubuntu_linux 18.10
debian/debian_linux 8.0
debian/debian_linux 9.0
libgd/libgd 2.2.5
netapp/storage_automation_store
php/php 7.3.0
php/php < 5.6.40
Published Jan 27, 2019
Tracked Since Feb 18, 2026