Critical Out-of-Bounds Write Vulnerability in OpenJPEG Package

openjpeg Updated 02 Oct 2025

Summary

05/01/2021
N/A
Yes i
High
7.8

ALPINE-CVE-2020-27844: A flaw was found in openjpeg's src/lib/openjp2/t2.c in versions prior to 2.4.0. Affects openjpeg versions < 2.4.0-r0. Fixed in 2.4.0-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 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 functionalities for encoding and decoding images in the JPEG 2000 format. It is widely used in various applications due to its efficiency and support for high-quality image processing. However, versions prior to 2.4.0 contain a critical vulnerability that exposes systems to potential attacks through crafted input during conversion and encoding processes.

Vulnerability Detail

A flaw was identified in OpenJPEG's source code, specifically in the file src/lib/openjp2/t2.c, affecting all versions prior to 2.4.0. This vulnerability allows an attacker to exploit the software by providing specially crafted input, leading to an out-of-bounds write. The consequences of this vulnerability can severely impact confidentiality, integrity, and availability of the system, making it a high-risk issue for users of the affected versions.

How To Fix

Minimum fixed version

2.4.0-r0

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

As a temporary workaround, users can avoid using OpenJPEG for processing untrusted or potentially malicious input until the package is updated to the fixed version. Additionally, implementing input validation can help mitigate the risk of exploitation.

Conclusion

The OpenJPEG package has a critical vulnerability that allows for out-of-bounds writes, posing significant risks to systems using affected versions. Users are strongly advised to update to version 2.4.0 or later to mitigate these risks. For ongoing monitoring of vulnerabilities, tools like Vulert can be beneficial.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

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

All versions of OpenJPEG prior to 2.4.0 are affected by this vulnerability.

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

The vulnerability can lead to out-of-bounds writes, which may compromise the confidentiality, integrity, and availability of the system.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for openjpeg.

How To Fix

Minimum fixed version

2.4.0-r0

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