CVE-2025-54874CWE-457

OpenJPEG allows OOB heap memory write in opj_jp2_read_header

Medium · published August 5, 2025

CVSS v4.0
6.6
EPSS
1%
Percentile
49.4
In the wild
Unconfirmed
What it is

⚠️ A missing initialization could lead to some unpleasant surprises! In OpenJPEG versions 2.5.1 to 2.5.3, a short data stream during header reading may cause an out-of-bounds heap memory write. 🤯 Think of it like a restaurant serving a dish without checking the ingredients first — a recipe that needs specific items might just leave the chef scrambling when the wrong mix hits the pan! An attacker could potentially manipulate the memory layout, leading to unexpected behaviors or crashes. While it’s not a direct path to catastrophic failure, it can still create significant headaches for applications relying on OpenJPEG. Just imagine troubleshooting a broken image processing pipeline!

Put simply

Think of it like a restaurant serving a dish without checking the ingredients first — a recipe that needs specific items might just leave the chef scrambling when the wrong mix hits the pan! This vulnerability arises when the function opj_jp2_read_header is called with a stream that is shorter than expected, and the image structure is not correctly initialized, allowing for out-of-bounds writes to the heap.

What to do

An attacker could potentially manipulate the memory layout, leading to unexpected behaviors or crashes. While it’s not a direct path to catastrophic failure, it can still create significant headaches for applications relying on OpenJPEG. Just imagine troubleshooting a broken image processing pipeline! Update OpenJPEG to version 2.5.4 or later to mitigate this issue. Additionally, verify that all streams and images are properly initialized before use. Regular code reviews can help catch these kinds of problems in the future! You've got this! By following these steps, you'll ensure your application stays solid and secure. 🛡️

The record
Technical detail
CVSS v4.0
6.6 · MEDIUM
Vector
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P
EPSS
0.00626 · 49.4th percentile
Weakness
CWE-457 · Use of Uninitialized Variable
Published
2025-08-05T14:33Z
EPSS history
Timeline
  • 05 AUG 14:33Z
    OpenJPEG allows OOB heap memory write in opj_jp2_read_header
    cvelistv5