Heap-based Buffer Overflow in OpenJPEG

openjpeg Updated 02 Oct 2025

Summary

05/09/2017
N/A
Yes i
High
8.8

CVE-2017-14152: A mishandled zero case was discovered in opj_j2k_set_cinema_parameters in lib/openjp2/j2k.c in OpenJPEG 2.2.0. Affects openjpeg across 2 version ranges.

< 2.2.0-r2 < 4241ae6fbbf1de9658764a80944dc8108f2b4154

Fixed in 2.2.0-r2. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

OpenJPEG is an open-source library for handling JPEG 2000 image compression. It is widely used in various applications and systems for image processing and storage. However, a vulnerability has been discovered in OpenJPEG that can lead to a heap-based buffer overflow, potentially resulting in remote denial of service or remote code execution.

Vulnerability Detail

The vulnerability, identified as CVE-2017-14152, arises from a mishandled zero case in the opj_j2k_set_cinema_parameters function in the j2k.c file of OpenJPEG 2.2.0. This flaw triggers an out-of-bounds write, which can impact the opj_write_bytes_LE function in the cio.c file and the opj_j2k_write_sot function in the j2k.c file. The consequences of this vulnerability include remote denial of service and the possibility of remote code execution.

How To Fix

Minimum fixed version

2.2.0-r2

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 workaround, if updating the OpenJPEG package is not immediately feasible, it is advisable to restrict access to systems or applications that utilize OpenJPEG. By limiting exposure to potentially malicious inputs, the risk of exploitation can be mitigated.

Conclusion

The heap-based buffer overflow vulnerability in OpenJPEG can have severe consequences, including remote denial of service and remote code execution. It is crucial to update the OpenJPEG package to the recommended version or apply the provided workaround to mitigate the risk. For further assistance in addressing this vulnerability, please contact DevNack.com.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

OpenJPEG is an open-source library for JPEG 2000 image compression, widely used in image processing and storage applications.

The vulnerability can lead to remote denial of service or remote code execution.

Update the OpenJPEG package to version 2.2.0-r2 or later.

Restricting access to systems or applications that use OpenJPEG can help mitigate the risk.

You can get the updated package from the official OpenJPEG repository or through your package manager.

Related vulnerabilities

Recent vulnerabilities recorded for openjpeg.

How To Fix

Minimum fixed version

2.2.0-r2

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