Denial of Service Vulnerability in OpenJPEG Package: CVE-2017-12982

openjpeg Updated 02 Oct 2025

Summary

21/08/2017
N/A
Yes i
Medium
5.5

ALPINE-CVE-2017-12982: The bmp_read_info_header function in bin/jp2/convertbmp.c in OpenJPEG 2.2.0 does not reject headers with a zero biBitCount, which allows remote attackers to cause a denial of service (memory allocation failure) in the op... Affects openjpeg versions < 2.2.0-r1. Fixed in 2.2.0-r1. 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 JPEG 2000 codec that provides functionalities for encoding and decoding images in the JPEG 2000 format. It is widely used in various applications for its efficient compression and high-quality image representation. However, it has been found to be vulnerable to a denial of service attack due to improper handling of BMP headers, specifically when the biBitCount is set to zero.

Vulnerability Detail

The vulnerability arises from the bmp_read_info_header function in OpenJPEG version 2.2.0, which fails to reject BMP headers with a zero biBitCount. This oversight allows remote attackers to exploit the vulnerability, leading to a denial of service condition. The attack can cause memory allocation failures in the opj_image_create function, which is critical for image processing. This vulnerability can be exploited without authentication, making it a significant risk for applications utilizing OpenJPEG.

How To Fix

Minimum fixed version

2.2.0-r1

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, ensure that any BMP files processed by OpenJPEG are validated to confirm that the biBitCount is not zero before processing. This can be done through custom validation scripts that check the BMP header before passing it to OpenJPEG functions.

Conclusion

The OpenJPEG package has a critical vulnerability (CVE-2017-12982) that can lead to denial of service attacks due to improper handling of BMP headers. It is essential to update to the patched version to mitigate risks. For those unable to update immediately, implementing validation checks on BMP files is advised.

See every vulnerability recorded for openjpeg →

Share this vulnerability

FAQ

CVE-2017-12982 is a vulnerability in the OpenJPEG package that allows remote attackers to cause a denial of service due to improper handling of BMP headers.

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

The CVSS score for CVE-2017-12982 is 5.5, indicating a moderate severity level.

If an immediate update is not possible, implement validation checks on BMP files to ensure they do not have a zero biBitCount before processing.

More information about OpenJPEG can be found on its official website or its GitHub repository, where you can also find documentation and updates.

Related vulnerabilities

Recent vulnerabilities recorded for openjpeg.

How To Fix

Minimum fixed version

2.2.0-r1

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