Denial of Service Vulnerability in GD Graphics Library (gd) - CVE-2016-6132

gd Updated 02 Oct 2025

Summary

12/08/2016
N/A
Yes i
Medium
6.5

ALPINE-CVE-2016-6132: 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. Affects gd versions < 2.2.3-r0. Fixed in 2.2.3-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The GD Graphics Library, commonly referred to as libgd, is a widely used open-source library for the dynamic creation of images by programmers. It supports various image formats, including PNG, JPEG, and GIF, and is often utilized in web applications for generating graphics on-the-fly. However, prior to version 2.2.3, the library was susceptible to a vulnerability that could be exploited through specially crafted TGA files, leading to potential denial of service.

Vulnerability Detail

The vulnerability identified as CVE-2016-6132 exists in the gdImageCreateFromTgaCtx function of the GD Graphics Library before version 2.2.3. This flaw allows remote attackers to exploit the library by sending a maliciously crafted TGA file, which can trigger an out-of-bounds read. The consequences of this vulnerability can lead to application crashes or unexpected behavior, effectively causing a denial of service. The vulnerability has a CVSS score of 6.5, indicating a moderate level of risk.

How To Fix

Minimum fixed version

2.2.3-r0

This is the first release that contains the fix.

sudo apk add --upgrade gd

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate updating is not feasible, consider implementing input validation to reject any TGA files that do not conform to expected formats. This can help mitigate the risk of exploitation until the library is updated.

Conclusion

CVE-2016-6132 represents a significant vulnerability in the GD Graphics Library that can lead to denial of service through the exploitation of crafted TGA files. It is crucial for users of the library to update to the patched version to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for gd →

Share this vulnerability

FAQ

CVE-2016-6132 is a vulnerability in the GD Graphics Library that allows remote attackers to cause a denial of service via a crafted TGA file.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The primary risk is denial of service, where the application may crash or behave unexpectedly when processing malicious TGA files.

Yes, the vulnerability is patched in version 2.2.3 of the GD Graphics Library. It is recommended to update to this version or later.

The CVSS score of CVE-2016-6132 is 6.5, indicating a moderate level of risk.

Related vulnerabilities

Recent vulnerabilities recorded for gd.

How To Fix

Minimum fixed version

2.2.3-r0

This is the first release that contains the fix.

sudo apk add --upgrade gd

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback