CVE-2025-54874

9.8 CRITICAL

📋 TL;DR

This vulnerability in OpenJPEG allows an attacker to write data beyond allocated heap memory boundaries when processing specially crafted JPEG 2000 files. This can lead to remote code execution, denial of service, or information disclosure. Any application using vulnerable OpenJPEG versions to process untrusted JPEG 2000 files is affected.

💻 Affected Systems

Products:
  • OpenJPEG
  • Applications using OpenJPEG library (e.g., OpenCV, image processing tools)
Versions: 2.5.1 through 2.5.3
Operating Systems: All platforms running affected OpenJPEG versions
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when processing malformed JPEG 2000 files; default configurations are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the application processing the malicious file, potentially leading to complete system compromise.

🟠

Likely Case

Application crash (denial of service) or memory corruption leading to unpredictable behavior.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing prevent malicious file processing.

🌐 Internet-Facing: HIGH - Any service accepting JPEG 2000 uploads could be exploited remotely.
🏢 Internal Only: MEDIUM - Internal applications processing untrusted files remain vulnerable.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting a malformed JPEG 2000 file; no public exploit code is currently available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.5.4 or later

Vendor Advisory: https://github.com/uclouvain/openjpeg/commit/f809b80c67717c152a5ad30bf06774f00da4fd2d

Restart Required: Yes

Instructions:

1. Update OpenJPEG to version 2.5.4 or later. 2. Rebuild any applications linked against OpenJPEG. 3. Restart affected services.

🔧 Temporary Workarounds

Disable JPEG 2000 processing

all

Configure applications to reject or not process JPEG 2000 files.

Input validation

all

Implement strict file validation before passing to OpenJPEG.

🧯 If You Can't Patch

  • Isolate systems processing JPEG 2000 files in restricted network segments.
  • Implement application sandboxing to limit potential damage from exploitation.

🔍 How to Verify

Check if Vulnerable:

Check OpenJPEG version with 'opj_decompress -v' or examine library version in linked applications.

Check Version:

opj_decompress -v 2>&1 | grep Version

Verify Fix Applied:

Confirm OpenJPEG version is 2.5.4 or later and test with known malformed JPEG 2000 files.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with segmentation faults
  • Memory corruption errors in logs

Network Indicators:

  • Unusual JPEG 2000 file uploads to vulnerable services

SIEM Query:

source="application.log" AND ("segmentation fault" OR "heap corruption") AND process="*openjpeg*"

🔗 References

📤 Share & Export