Description of problem: PHP 5.2.3 release: http://www.php.net/releases/523.php
Fixed possible infinite loop in imagecreatefrompng. (by Xavier Roche, CVE-2007-2756)
The gdImageCreate function in the GD Graphics Library (aka libgd) before 2.2.4 allows remote attackers to cause a denial of service (system hang) via an oversized image.
Fixed bug (Integer Overflow in gd2GetHeader() resulting in heap overflow). (CVE-2016-5766)
It was found that libgd did not properly handle invalid color index, which could lead to a denial of service against applications using the libgd library.
Upstream patches:
https://github.com/libgd/libgd/compare/3fe0a7128bac5000fdcfab888bd2a75ec0c9447d...fd623025505e87bba7ec8555eeb72dae4fb0afd
CVE assignment:
http://seclists.org/oss-sec/2016/q2/627
An unsigned integer overflow vulnerability was found in gdContributionsAlloc function.
Upstream patch:
https://github.com/libgd/libgd/commit/60bfb401ad5a4a8ae995dcd36372fe15c71e1a35
CVE assignment:
http://www.openwall.com/lists/oss-security/2017/01/28/6
A signedness vulnerability was found in libgd 2.1.1 which may result into heap overflow when processing maliciously crafted .gd2 files.
Fixed bug (Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow). (CVE-2016-5767)
The readimagetga function in gdtga.c in the GD Graphics Library (aka libgd) before 2.2.4 allows remote attackers to cause a denial of service (out-of-bounds read) via a crafted TGA file, related to the decompression buffer.
Possible buffer read overflow was fixed upstream [1]. This was also reported against PHP: https://bugs.php.net/bug.php?id=68601 (bug is private, fixed in PHP 5.6.5)
[1]: https://bitbucket.org/libgd/gd-libgd/commits/47eb44b2e90ca88a08dca9f9a1aa9041e9587f43
Double free vulnerability in the gdImageWebPtr function in the GD Graphics Library (aka libgd) before 2.2.4 allows remote attackers to have unspecified impact via large width and height values.
Fixed bug (imagecolormatch Out Of Bounds Write on Heap). (CVE-2019-6977)
A vulnerability was found in the GD Graphics Library before 2.2.0, as used in PHP before 5.6.12. The gdImageScaleTwoPass function in gdinterpolation.c uses inconsistent allocate and free approaches, which allows remote attackers to cause a denial of service (memory consumption) via a crafted call, as demonstrated by a call to the PHP imagescale function.
Upstream bugs:
https://bugs.php.net/bug.php?id=70064 https://github.com/libgd/libgd/issues/173
Fixed bug (Uninitialized read in gdImageCreateFromXbm) (CVE-2019-11038).
DISPUTED gdImageGd2Ptr in gdgd2.c in the GD Graphics Library (aka LibGD) through 2.3.2 has a double free. NOTE: the vendor's position is "The GD2 image format is a proprietary image format of libgd. It has to be regarded as being obsolete, and should only be used for development and testing purposes."
readheadertga in gdtga.c in the GD Graphics Library (aka LibGD) through 2.3.2 allows remote attackers to cause a denial of service (out-of-bounds read) via a crafted TGA file.
Last updated 25 August 2025
A flaw was found in gd as shipped with Fedora. Cloning a image with style "attached", triggers a NULL pointer dereference in 'gdImageClone' leading to denial of service.
Affected versions: gd-2.2.5 gd-2.2.4 gd-2.2.3 gd-2.2.2 gd-2.2.1 gd-2.2.0 gd-2.1.1 gd-2.1.0 gd-2.1.0-rc2
References:
https://bugzilla.redhat.com/showbug.cgi?id=1599032
Last updated 25 August 2025
DISPUTED In the GD Graphics Library (aka LibGD) through 2.2.5, there is a heap-based buffer over-read in tiffWriter in gdtiff.c. NOTE: the vendor says "In my opinion this issue should not have a CVE, since the GD and GD2 formats are documented to be 'obsolete, and should only be used for development and testing purposes.'"
A flaw was found in libgd. Processing a specially crafted GIF file allows a remote attacker to trigger a buffer overflow, resulting in an application crash and a denial of service. Arbitrary code execution is possible in theory, but considered highly unlikely because standard image decompression and pixel manipulation generally destroy the exploit payload.
Last updated 15 November 2024
Fixed bug (imagefilltoborder stackoverflow on truecolor images). (CVE-2016-9933)
An integer overflow vulnerability was found in gdContributionsAlloc() function in gdinterpolation.c that can lead to out-of-bounds write.
PHP bug:
https://bugs.php.net/bug.php?id=72558
PHP fix:
https://git.php.net/?p=php-src.git;a=commit;h=8fa9d1ce28f3a894b104979df30d0b65e0f21107
An integer overflow in gdio.c was found.
Upstream patch:
https://github.com/libgd/libgd/commit/69d2fd2c597ffc0c217de1238b9bf4d4bceba8e6
PHP bug:
https://bugs.php.net/bug.php?id=73869
CVE assignment:
http://www.openwall.com/lists/oss-security/2017/01/28/6
Fixed bug (DOS vulnerability in gdImageCreateFromGd2Ctx()). (CVE-2016-10167)
An out-of-bounds read in imagescale function was found that can cause crash of application.
Upstream bug (php):
https://bugs.php.net/bug.php?id=72227
Upstream patch:
libgd: https://github.com/libgd/libgd/commit/4f65a3e4eedaffa1efcf9ee1eb08f0b504fbc31a php: https://git.php.net/?p=php-src.git;a=commit;h=7a1aac3343af85b4af4df5f8844946eaa27394ab
CVE assignment:
http://seclists.org/oss-sec/2016/q2/412
The dynamicGetbuf function in the GD Graphics Library (aka libgd) before 2.2.4 allows remote attackers to cause a denial of service (out-of-bounds read) via a crafted TIFF image.
Integer signedness error in the dynamicGetbuf function in gdiodp.c in the GD Graphics Library (aka libgd) through 2.2.3, as used in PHP before 5.6.28 and 7.x before 7.0.13, allows remote attackers to cause a denial of service (stack-based buffer overflow) or possibly have unspecified other impact via a crafted imagecreatefromstring call.
Integer overflow in the gdImageWebpCtx function in gdwebp.c in the GD Graphics Library (aka libgd) through 2.2.3, as used in PHP through 7.0.11, allows remote attackers to cause a denial of service (heap-based buffer overflow) or possibly have unspecified other impact via crafted imagewebp and imagedestroy calls.
The readimagetga function in gdtga.c in the GD Graphics Library (aka libgd) before 2.2.3 allows remote attackers to cause a denial of service (out-of-bounds read) via a crafted TGA image.