OpenJPEG Vulnerability: Use-After-Free in Decompressor

openjpeg Updated 02 Oct 2025

Summary

29/06/2020
N/A
Yes i
Medium
6.5

ALPINE-CVE-2020-15389: jp2/opj_decompress.c in OpenJPEG through 2.3.1 has a use-after-free that can be triggered if there is a mix of valid and invalid files in a directory operated on by the decompressor. Affects openjpeg versions < 2.3.1-r4. Fixed in 2.3.1-r4. 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 allows for encoding and decoding of JPEG 2000 images. It is widely used in various applications for its ability to handle high-quality image compression. However, OpenJPEG versions prior to 2.3.1 are susceptible to a critical vulnerability that can compromise the integrity of the decompression process.

Vulnerability Detail

The vulnerability identified in OpenJPEG is a use-after-free issue located in the jp2/opj_decompress.c file. This flaw can be triggered when the decompressor processes a mix of valid and invalid files within a directory, potentially leading to a double-free scenario. The consequences of this vulnerability include memory corruption, which could be exploited to execute arbitrary code or crash the application. The vulnerability has been assigned the CVE identifier CVE-2020-15389 and has a CVSS score of 6.5, indicating a medium severity level.

How To Fix

Minimum fixed version

2.3.1-r4

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 processing directories that contain a mix of valid and invalid JPEG 2000 files until the package is updated to a secure version.

Conclusion

The OpenJPEG vulnerability CVE-2020-15389 poses a significant risk due to a use-after-free flaw in the decompressor. Users are advised to update to the latest patched versions to mitigate potential exploitation. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

The vulnerability is a use-after-free issue that can lead to memory corruption during the decompression of JPEG 2000 files.

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

Exploiting this vulnerability may allow an attacker to execute arbitrary code or crash the application, leading to potential data loss or system compromise.

Yes, patches are available in versions 2.3.1-r4 and 2.3.1-r5 for various Alpine versions.

The CVSS score of this vulnerability is 6.5, indicating a medium severity level.

Related vulnerabilities

Recent vulnerabilities recorded for openjpeg.

How To Fix

Minimum fixed version

2.3.1-r4

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