Critical Loop Vulnerability in libjpeg-turbo: CVE-2018-11813

libjpeg-turbo Updated 02 Oct 2025

Summary

06/06/2018
N/A
Yes i
High
7.5

ALPINE-CVE-2018-11813: libjpeg 9c has a large loop because read_pixel in rdtarga.c mishandles EOF. Affects libjpeg-turbo versions < 1.5.3-r3. Fixed in 1.5.3-r3. 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

libjpeg-turbo is a widely used library for handling JPEG images, providing high-speed image processing capabilities. It is designed to be a drop-in replacement for libjpeg, offering improved performance and reduced memory usage. However, it is susceptible to vulnerabilities that can lead to severe security risks, particularly when handling malformed image files.

Vulnerability Detail

The vulnerability identified as CVE-2018-11813 arises from a large loop in the read_pixel function within the rdtarga.c file of libjpeg-turbo. This mishandling of the End Of File (EOF) condition can lead to excessive resource consumption, potentially resulting in denial of service (DoS) attacks. Attackers can exploit this flaw by crafting specific JPEG files that, when processed, can cause the application to hang or crash, thereby affecting the availability of the service.

How To Fix

Minimum fixed version

1.5.3-r3

This is the first release that contains the fix.

sudo apk add --upgrade libjpeg-turbo

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

Workaround

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

Conclusion

The CVE-2018-11813 vulnerability in libjpeg-turbo poses a significant risk to applications that process JPEG images. It is crucial to update to the patched version to mitigate potential denial of service attacks. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for libjpeg-turbo →

Share this vulnerability

FAQ

CVE-2018-11813 is a vulnerability in the libjpeg-turbo library that can lead to denial of service due to a large loop in the read_pixel function.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.

The vulnerability can lead to denial of service attacks, causing applications to hang or crash when processing specially crafted JPEG files.

Yes, the patched version of libjpeg-turbo is 1.5.3-r3. Updating to this version will resolve the vulnerability.

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

Related vulnerabilities

Recent vulnerabilities recorded for libjpeg-turbo.

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

1.5.3-r3

This is the first release that contains the fix.

sudo apk add --upgrade libjpeg-turbo

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