CVE-2016-6132
Medium · 6.5CVSS
6.5
EPSS
3.3%
Published
Aug 12, 2016
CISA due date
—
Cloudanix analysis
A flaw in an image processing library lets attackers crash programs by sending a specially made picture file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Out-of-bounds read in gdImageCreateFromTgaCtx during TGA file parsing leads to denial of service.
Why it matters to the business
Services that process user-supplied images may crash unexpectedly, causing downtime and degraded availability for image-handling applications.
How an attack unfolds
An attacker crafts a malicious TGA file and delivers it to any application or service that uses the vulnerable libgd library to decode the image, triggering the out-of-bounds read.
How to fix it
Upgrade libgd to version 2.2.3 or later. Rebuild and redeploy any dependent applications after the library update.
How to confirm the fix worked
Confirm the installed libgd version is 2.2.3 or newer. Test image processing pipelines with known-good and boundary TGA files to verify stability.
Typical attack path
- Identify a target application or service that accepts TGA images and uses libgd.
- Generate or obtain a specially crafted TGA file that triggers the parsing flaw.
- Deliver the file via upload, email attachment, or network request.
- Trigger image processing to cause the out-of-bounds read and crash.
How to detect it
Review application logs for crashes or segmentation faults during TGA image processing. Monitor process termination events correlated with image upload or conversion activity.
What your security team should do
- Prioritize patching libgd on all systems that handle untrusted images.
- Inventory software and containers that statically or dynamically link libgd.
- Add file-type validation and sandboxing for image processing workflows until patches are applied.
The record
The gdImageCreateFromTgaCtx function 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 file.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.4 | gd | 0 | 2.2.3-r0 |
| Debian:11 | libgd2 | 0 | 2.2.2-29-g3c2b605-1 |
| Debian:12 | libgd2 | 0 | 2.2.2-29-g3c2b605-1 |
| Debian:13 | libgd2 | 0 | 2.2.2-29-g3c2b605-1 |
| Debian:8 | libgd2 | 0 | 2.1.0-5+deb8u4 |
| Mageia:5 | libgd | 0 | 2.2.3-1.1.mga5 |
| SUSE:Linux Enterprise Desktop 12 SP1 | gd | 0 | 2.1.0-12.1 |
| SUSE:Linux Enterprise Server 12 SP1 | gd | 0 | 2.1.0-12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | gd | 0 | 2.1.0-12.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | gd | 0 | 2.1.0-12.1 |
| SUSE:Linux Enterprise Workstation Extension 12 SP1 | gd | 0 | 2.1.0-12.1 |
| Ubuntu:14.04:LTS | libgd2 | 0 | 2.1.0-3ubuntu0.3 |
| Ubuntu:16.04:LTS | libgd2 | 0 | 2.1.1-4ubuntu0.16.04.3 |
| openSUSE:Tumbleweed | gd | 0 | 2.2.3-2.1 |
Related vulnerabilities
- CVE-2017-6362 Double free vulnerability in the gdImagePngPtr function in libgd2 before 2.2.5 allows… Also affects gd
- CVE-2017-7890 The GIF decoding function gdImageCreateFromGifCtx in gd_gif_in.c in the GD Graphics… Also affects gd
- CVE-2016-10166 Integer underflow in the _gdContributionsAlloc function in gd_interpolation.c in the GD… Also affects gd
- CVE-2016-3074 Integer signedness error in GD Graphics Library 2.1.1 (aka libgd or libgd2) allows remote… Also affects gd
- CVE-2016-6911 The dynamicGetbuf function in the GD Graphics Library (aka libgd) before 2.2.4 allows… Also affects libgd2
- CVE-2013-7456 gd_interpolation.c in the GD Graphics Library (aka libgd) before 2.1.1, as used in PHP… Also affects libgd2
- CVE-2014-9709 The GetCode_ function in gd_gif_in.c in GD 2.1.1 and earlier, as used in PHP before… Also affects libgd2
- CVE-2014-2497 The gdImageCreateFromXpm function in gdxpm.c in libgd, as used in PHP 5.4.26 and earlier… Also affects libgd2