CVE-2016-5116
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x...
CVE-2016-5116 is a critical vulnerability (CVSS 9.1) in Libgd, published May 30, 2016. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.81%, the 90th percentile. Fixed in gd 2.2.1-r2.
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.1
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
CVE-2016-5116- CVSS 3.0
- 9.1 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H - CVSS 2.0
- 6.4 Medium
AV:N/AC:L/Au:N/C:P/I:N/A:P - Weakness
- CWE-119
- Updated
- 2026-11-02
CVE List No score
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
CVE-2016-5116- Updated
- 2026-11-02
EUVDEUVD-2016-6067 No score
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
EUVD-2016-6067- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-mvgw-h4r7-8g56
9.1
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x...
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
GHSA-mvgw-h4r7-8g56- CVSS 3.0
- 9.1 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H - Weakness
- CWE-119
- Updated
- 2026-11-02
OSVALPINE-CVE-2016-5116
9.1
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
ALPINE-CVE-2016-5116- CVSS 3.0
- 9.1 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H - Updated
- 2026-11-02
OSV
9.1
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
CVE-2016-5116- CVSS 3.0
- 9.1 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H - Updated
- 2026-11-02
Show 6 moreShow less
OSVDEBIAN-CVE-2016-5116
9.1
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
DEBIAN-CVE-2016-5116- CVSS 3.0
- 9.1 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2016-5116
9.1
gd_xbm.c in the GD Graphics Library (aka libgd) before 2.2.0, as used in certain custom PHP 5.5.x configurations, allows context-dependent attackers to obtain sensitive information from process memory or cause a denial of service (stack-based buffer under-read and application crash) via a long name.
- Record
UBUNTU-CVE-2016-5116- CVSS 3.0
- 9.1 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2016-0215 No score
Updated libgd packages fix security vulnerabilities
Updated libgd packages fix security vulnerabilities:
The gdImageScaleTwoPass function in gd_interpolation.c in libgd before 2.2.0 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 (CVE-2015-8877).
While creating an XBM image (imagexbm) with an user supplied name, libgd before 2.2.0 did not check the vsnprintf return value, so an application might trust this length and read more memory than it should, causing a read-out-of boundaries, leaking stack memory (CVE-2016-5116).
- Record
MGASA-2016-0215- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:10062-1 No score
gd-2.2.3-2.1 on GA media
These are all security issues fixed in the gd-2.2.3-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:10062-1- Updated
- 2026-11-02
OSVSUSE-SU-2016:2303-1 No score
Security update for gd
This update for gd fixes the following issues:
- CVE-2016-6214: Buffer over-read issue when parsing crafted TGA file [bsc#991436]
- CVE-2016-6132: read out-of-bands was found in the parsing of TGA files using libgd [bsc#987577]
- CVE-2016-6128: Invalid color index not properly handled [bsc#991710]
- CVE-2016-6207: Integer overflow error within _gdContributionsAlloc() [bsc#991622]
- CVE-2016-6161: global out of bounds read when encoding gif from malformed input withgd2togif [bsc#988032]
- CVE-2016-5116: avoid stack overflow (read) with large names [bsc#982176]
- CVE-2016-6905: Out-of-bounds read in function read_image_tga in gd_tga.c [bsc#995034]
- Record
SUSE-SU-2016:2303-1- Updated
- 2026-11-02
OSVUSN-3030-1 No score
libgd2 vulnerabilities
It was discovered that the GD library incorrectly handled memory when using gdImageScaleTwoPass(). A remote attacker could possibly use this issue to cause a denial of service. This issue only affected Ubuntu 14.04 LTS. (CVE-2013-7456)
It was discovered that the GD library incorrectly handled certain malformed XBM images. If a user or automated system were tricked into processing a specially crafted XBM image, an attacker could cause a denial of service. This issue only affected Ubuntu 14.04 LTS, Ubuntu 15.10 and Ubuntu 16.04 LTS. (CVE-2016-5116)
It was discovered that the GD library incorrectly handled memory when using _gd2GetHeader(). A remote attacker could possibly use this issue to cause a denial of service or possibly execute arbitrary code. (CVE-2016-5766)
It was discovered that the GD library incorrectly handled certain color indexes. A remote attacker could possibly use this issue to cause a denial of service. This issue only affected Ubuntu 14.04 LTS, Ubuntu 15.10 and Ubuntu 16.04 LTS. (CVE-2016-6128)
It was discovered that the GD library incorrectly handled memory when encoding a GIF image. A remote attacker could possibly use this issue to cause a denial of service. (CVE-2016-6161)
- Record
USN-3030-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
gdAlpine:v3.2 |
before 2.2.1-r2 | 2.2.1-r2 |
gdAlpine:v3.3 |
before 2.2.1-r2 | 2.2.1-r2 |
libgd2Debian:12 |
before 2.2.1-1 | 2.2.1-1 |
libgd2Debian:13 |
before 2.2.1-1 | 2.2.1-1 |
libgd2Debian:14 |
before 2.2.1-1 | 2.2.1-1 |
libgd2Debian:8 |
before 2.1.0-5+deb8u4, plus listed versions 2.1.0-52.1.0-5+deb8u12.1.0-5+deb8u22.1.0-5+deb8u3 |
2.1.0-5+deb8u4 |
libgdMageia:5 |
before 2.2.1-1.2.mga5 | 2.2.1-1.2.mga5 |
gdSUSE:Linux Enterprise Desktop 12 SP1 |
before 2.1.0-12.1 | 2.1.0-12.1 |
gdSUSE:Linux Enterprise Software Development Kit 12 SP1 |
before 2.1.0-12.1 | 2.1.0-12.1 |
gdSUSE:Linux Enterprise Server 12 SP1 |
before 2.1.0-12.1 | 2.1.0-12.1 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
gdSUSE:Linux Enterprise Server for SAP Applications 12 SP1 |
before 2.1.0-12.1 | 2.1.0-12.1 |
gdSUSE:Linux Enterprise Workstation Extension 12 SP1 |
before 2.1.0-12.1 | 2.1.0-12.1 |
libgd2Ubuntu:14.04:LTS |
before 2.1.0-3ubuntu0.2, plus listed versions 2.1.0-22.1.0-32.1.0-3ubuntu0.1 |
2.1.0-3ubuntu0.2 |
libgd2Ubuntu:16.04:LTS |
before 2.1.1-4ubuntu0.16.04.2, plus listed versions 2.1.1-4build12.1.1-4build22.1.1-4ubuntu0.16.04.1 |
2.1.1-4ubuntu0.16.04.2 |
gdopenSUSE:Tumbleweed |
before 2.2.3-2.1 | 2.2.3-2.1 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-03 | aliases | EUVD |
| 2026-11-02 | created | CVE List, GitHub Advisories, NVD, OSV |
References
lists.opensuse.org/opensuse-updates/2016-09/msg00078.html
github.com/libgd/libgd/issues/211
openwall.com/lists/oss-security/2016/05/29/5
debian.org/security/2016/dsa-3619
ubuntu.com/usn/USN-3030-1
github.com/libgd/libgd/commit/4dc1a2d7931017d3625f2d7cff70a17ce58b53b4
Show 32 moreShow less
nvd.nist.gov/vuln/detail/CVE-2016-5116
github.com/advisories/GHSA-mvgw-h4r7-8g56
security.alpinelinux.org/vuln/CVE-2016-5116
security-tracker.debian.org/tracker/CVE-2016-5116
advisories.mageia.org/MGASA-2016-0215.html
bugs.mageia.org/show_bug.cgi?id=18562
debian.org/security/2016/dsa-3587
suse.com/support/update/announcement/2016/suse-su-20162303-1
bugzilla.suse.com/982176
bugzilla.suse.com/987577
bugzilla.suse.com/988032
bugzilla.suse.com/991436
bugzilla.suse.com/991622
bugzilla.suse.com/991710
bugzilla.suse.com/995034
suse.com/security/cve/CVE-2016-5116
suse.com/security/cve/CVE-2016-6128
suse.com/security/cve/CVE-2016-6132
suse.com/security/cve/CVE-2016-6161
suse.com/security/cve/CVE-2016-6207
suse.com/security/cve/CVE-2016-6214
suse.com/security/cve/CVE-2016-6905
ubuntu.com/security/CVE-2016-5116
openwall.com/lists/oss-security/2016/05/29/3
ubuntu.com/security/notices/USN-3030-1
cve.org/CVERecord?id=CVE-2016-5116
ubuntu.com/security/CVE-2013-7456
ubuntu.com/security/CVE-2016-5766
ubuntu.com/security/CVE-2016-6128
ubuntu.com/security/CVE-2016-6161
suse.com/security/cve/CVE-2014-2497
suse.com/security/cve/CVE-2016-5766