Integer Overflow Vulnerability in SDL2_image Package Leading to Potential Code Execution

sdl2_image Updated 02 Oct 2025

Summary

03/07/2019
N/A
Yes i
High
8.8

ALPINE-CVE-2019-5052: An exploitable integer overflow vulnerability exists when loading a PCX file in SDL2_image 2.0.4. Affects sdl2_image versions < 2.0.5-r0. Fixed in 2.0.5-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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

SDL2_image is a widely used library that facilitates the loading of various image formats in applications built with the SDL (Simple DirectMedia Layer) framework. It supports multiple image formats and is essential for rendering images in games and multimedia applications. However, a critical vulnerability has been identified in versions prior to 2.0.5-r0, which exposes users to security risks when handling specially crafted image files.

Vulnerability Detail

An exploitable integer overflow vulnerability exists in SDL2_image version 2.0.4 when loading a PCX file. This flaw arises from improper handling of image file data, allowing an attacker to craft a malicious file that triggers an integer overflow. The result is insufficient memory allocation, leading to a buffer overflow that can be exploited for arbitrary code execution. This vulnerability has a CVSS score of 8.8, indicating a high severity level, and can potentially compromise the integrity and confidentiality of the affected systems.

How To Fix

Minimum fixed version

2.0.5-r0

This is the first release that contains the fix.

sudo apk add --upgrade sdl2_image

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 validating and sanitizing all image files before processing them to mitigate the risk of exploitation. Additionally, avoid loading untrusted image files from unknown sources.

Conclusion

The integer overflow vulnerability in the SDL2_image package poses a significant risk to applications that utilize this library for image processing. It is crucial to update to the patched version to safeguard against potential exploits. Additionally, utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for sdl2_image →

Share this vulnerability

FAQ

The vulnerability is an integer overflow that can lead to a buffer overflow and potential code execution when processing specially crafted PCX files.

You can use Vulert, which monitors open-source vulnerabilities in your software using a manifest file like package-lock.json. Visit Vulert Scanner to check your application without any signup.

Failure to address this vulnerability may allow attackers to execute arbitrary code on your system, potentially leading to data breaches or system compromise.

Yes, version 2.0.5-r0 and later are safe as they contain the necessary patches to address this vulnerability.

Implement input validation and avoid processing untrusted image files as a temporary measure until you can update the package.

Related vulnerabilities

Recent vulnerabilities recorded for sdl2_image.

How To Fix

Minimum fixed version

2.0.5-r0

This is the first release that contains the fix.

sudo apk add --upgrade sdl2_image

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