Critical Buffer Overflow Vulnerability in OpenJPEG Package

openjpeg Updated 02 Oct 2025

Summary

30/08/2017
N/A
Yes i
High
8.8

ALPINE-CVE-2017-14041: A stack-based buffer overflow was discovered in the pgxtoimage function in bin/jp2/convert.c in OpenJPEG 2.2.0. Affects openjpeg versions < 2.2.0-r2. 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 Penetration testing for web, API and mobile 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 that implements the JPEG 2000 image coding system. It is widely used for encoding and decoding images in various applications due to its efficient compression capabilities and support for high-quality images. However, OpenJPEG versions prior to 2.2.0-r2 are vulnerable to a critical buffer overflow that can lead to severe security risks.

Vulnerability Detail

A stack-based buffer overflow was discovered in the pgxtoimage function in bin/jp2/convert.c in OpenJPEG 2.2.0. This vulnerability allows for an out-of-bounds write, which may lead to remote denial of service or potentially remote code execution. The vulnerability is classified with a CVSS score of 8.8, indicating a high severity level. Attackers could exploit this vulnerability to execute arbitrary code on affected systems, posing significant risks to data integrity and system security.

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

If you are unable to update the package immediately, consider disabling any features that rely on OpenJPEG until the update can be applied. Additionally, ensure that your systems are behind firewalls and that access is restricted to trusted users only.

Conclusion

The OpenJPEG package has a critical vulnerability that can lead to severe security risks, including remote code execution. It is essential to update to the patched version (2.2.0-r2 or later) to mitigate these risks. Users should also consider using tools like Vulert to monitor for vulnerabilities in their applications.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

The vulnerability is a stack-based buffer overflow that can lead to out-of-bounds writes, potentially allowing remote code execution.

All versions of OpenJPEG prior to 2.2.0-r2 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.

If an immediate update is not possible, consider disabling features that rely on OpenJPEG and restrict access to your systems.

Exploitation of this vulnerability could lead to remote denial of service or remote code execution, compromising system security and data integrity.

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