Critical Code Execution Vulnerability in SDL2_image Package

sdl2_image Updated 02 Oct 2025

Summary

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

ALPINE-CVE-2019-5060: An exploitable code execution vulnerability exists in the XPM image rendering function of 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 provides support for loading images in various formats, including XPM. It is commonly utilized in game development and multimedia applications to enhance graphical capabilities. However, versions prior to 2.0.5-r0 are vulnerable to a serious security flaw that can lead to code execution when processing specially crafted XPM images.

Vulnerability Detail

An exploitable code execution vulnerability exists in the XPM image rendering function of SDL2_image version 2.0.4. The issue arises from an integer overflow in the colorhash function, which leads to the allocation of an insufficiently sized buffer. This buffer overflow can be exploited by an attacker to execute arbitrary code. The vulnerability has a CVSS score of 8.8, indicating a high severity level, and can be triggered by displaying a specially crafted 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 →

Workaround

If immediate updating is not feasible, consider implementing input validation to restrict the types of images that can be processed by your application. This can help mitigate the risk of exploitation until the package is updated.

Conclusion

The SDL2_image package has a critical vulnerability that can lead to code execution through specially crafted XPM images. It is essential to update to version 2.0.5-r0 or later to mitigate this risk. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert, which can provide real-time alerts based on manifest files.

See every vulnerability recorded for sdl2_image →

Share this vulnerability

FAQ

The vulnerability is a code execution flaw that can be exploited through specially crafted XPM images, leading to potential arbitrary code execution.

Versions of SDL2_image prior to 2.0.5-r0 are affected by this vulnerability.

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

Implement input validation to restrict the types of images processed by your application as a temporary workaround.

The CVSS score of this vulnerability is 8.8, indicating a high severity level.

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