Vulnerability in libgd2 - Heap Overflow via Compressed gd2 Data

libgd2 Updated 02 Oct 2025

Summary

24/04/2016
N/A
Yes i
Unrated
Not published

DSA-3556-1: libgd2 - security update. Affects libgd2 versions < 2.0.36~rc1~dfsg-6.1+deb7u2. Fixed in 2.0.36~rc1~dfsg-6.1+deb7u2. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

libgd2 is a library used for programmatic graphics creation and manipulation. It provides functions for creating and manipulating images, as well as drawing lines, shapes, and text. The library is commonly used in various applications to generate and modify images. However, a signedness vulnerability has been discovered in libgd2 that can lead to a heap overflow when processing specially crafted compressed gd2 data. This vulnerability can be exploited by a remote attacker to crash an application using libgd2 or potentially execute arbitrary code with the privileges of the user running the application.

Vulnerability Detail

The vulnerability in libgd2 arises from a signedness issue when processing compressed gd2 data. By providing specially crafted data, an attacker can trigger a heap overflow, potentially leading to a crash or arbitrary code execution. This vulnerability poses a significant risk to applications that utilize libgd2 for image manipulation. Attackers can exploit this vulnerability remotely, without requiring any authentication. It is crucial to address this vulnerability promptly to prevent potential security breaches.

How To Fix

Minimum fixed version

2.0.36~rc1~dfsg-6.1+deb7u2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libgd2

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

Conclusion

The vulnerability in libgd2 can be exploited by a remote attacker to cause a crash or execute arbitrary code. To mitigate this risk, it is crucial to upgrade the libgd2 package to the fixed versions. Failure to address this vulnerability may result in security breaches and compromise the integrity of applications using libgd2. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libgd2 →

Share this vulnerability

FAQ

libgd2 is a library for programmatic graphics creation and manipulation. It provides functions for generating and modifying images, as well as drawing lines, shapes, and text.

This vulnerability in libgd2 can result in a heap overflow, potentially leading to a crash or arbitrary code execution. Attackers can exploit this remotely without authentication, posing a significant risk to applications using libgd2.

By providing specially crafted compressed gd2 data, an attacker can trigger a heap overflow in libgd2, potentially leading to a crash or arbitrary code execution.

The vulnerability affects libgd2 versions prior to 2.0.36~rc1~dfsg-6.1+deb7u2 for the oldstable distribution (wheezy), and versions prior to 2.1.0-5+deb8u1 for the stable distribution (jessie).

To fix this vulnerability, upgrade the libgd2 package to the fixed versions: 2.0.36~rc1~dfsg-6.1+deb7u2 for wheezy, 2.1.0-5+deb8u1 for jessie, and 2.1.1-4.1 for sid.

Related vulnerabilities

Recent vulnerabilities recorded for libgd2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.0.36~rc1~dfsg-6.1+deb7u2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libgd2

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