Integer Overflow Vulnerability in OpenJPEG Package Leading to Denial of Service

openjpeg Updated 02 Oct 2025

Summary

19/01/2018
N/A
Yes i
Medium
6.5

ALPINE-CVE-2018-5785: In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Affects openjpeg versions < 2.3.0-r3. Fixed in 2.3.0-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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

OpenJPEG is an open-source JPEG 2000 codec that provides a comprehensive set of features for encoding and decoding JPEG 2000 images. It is widely used in various applications due to its efficiency and support for advanced image processing. However, versions of OpenJPEG prior to 2.3.0-r3 are susceptible to a critical vulnerability that can be exploited by attackers.

Vulnerability Detail

In OpenJPEG version 2.3.0, an integer overflow occurs due to an out-of-bounds left shift in the opj_j2k_setup_encoder function located in openjp2/j2k.c. This vulnerability can be exploited by remote attackers using a specially crafted BMP file, potentially leading to a denial of service. The vulnerability has a CVSS score of 6.5, indicating a moderate risk level, and it allows attackers to disrupt service without requiring authentication.

How To Fix

Minimum fixed version

2.3.0-r3

This is the first release that contains the fix.

sudo apk add --upgrade openjpeg

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 restricting access to the application that utilizes OpenJPEG to trusted users only, thereby minimizing the risk of exploitation until the package can be updated.

Conclusion

The OpenJPEG package has a critical vulnerability that can be exploited to cause a denial of service. Users are strongly advised to update to the patched version 2.3.0-r3 or later to mitigate the risk. For those unable to update immediately, restricting access to the application can serve as a temporary workaround.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

The vulnerability is an integer overflow that can lead to a denial of service when processing specially crafted BMP files.

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 CVSS score of this vulnerability is 6.5, indicating a moderate risk level.

Exploitation of this vulnerability can lead to a denial of service, disrupting the functionality of applications that rely on OpenJPEG.

Yes, you can restrict access to the application that uses OpenJPEG to trusted users only until you can apply the necessary updates.

Related vulnerabilities

Recent vulnerabilities recorded for openjpeg.

How To Fix

Minimum fixed version

2.3.0-r3

This is the first release that contains the fix.

sudo apk add --upgrade openjpeg

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