Heap-Buffer Overflow Vulnerability in OpenJPEG Package

openjpeg Updated 02 Oct 2025

Summary

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

ALPINE-CVE-2020-27814: A heap-buffer overflow was found in the way openjpeg2 handled certain PNG format files. Affects openjpeg versions < 2.3.1-r5. Fixed in 2.3.1-r5. 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

OpenJPEG is an open-source library that provides a comprehensive implementation of the JPEG 2000 image coding system. It is widely used for image processing and manipulation in various applications. The library supports encoding and decoding of JPEG 2000 images, making it a critical component for software that handles image data. However, OpenJPEG has been found to have a vulnerability that could lead to severe security issues if exploited.

Vulnerability Detail

A heap-buffer overflow was discovered in OpenJPEG, specifically in the way it processes certain PNG format files. This vulnerability allows an attacker to craft a malicious PNG file that, when processed by an application using OpenJPEG, could lead to an application crash or, in some cases, the execution of arbitrary code with the permissions of the user running the application. The vulnerability is classified with a CVSS score of 7.8, indicating a high severity level.

How To Fix

Minimum fixed version

2.3.1-r5

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 possible, consider avoiding the processing of untrusted PNG files until the vulnerability is resolved. Additionally, ensure that applications using OpenJPEG are run with the least privileges necessary to limit potential damage in case of an exploit.

Conclusion

The heap-buffer overflow vulnerability in the OpenJPEG package poses a significant risk to applications that process PNG files. It is crucial for users to update to the patched versions to safeguard against potential exploits. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

A heap-buffer overflow occurs when a program writes more data to a buffer located on the heap than it was allocated for, potentially leading to memory corruption and security vulnerabilities.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By uploading your manifest file, such as package-lock.json, you can check for vulnerabilities without needing to install any software.

Exploiting this vulnerability can lead to application crashes or arbitrary code execution, which could compromise the security of the system running the affected application.

Yes, you can mitigate the risk by avoiding the processing of untrusted PNG files and running applications with limited permissions.

Detailed information about this vulnerability can be found in the CVE-2020-27814 report and on the official OpenJPEG repository.

Related vulnerabilities

Recent vulnerabilities recorded for openjpeg.

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

2.3.1-r5

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