Skip to main content

CVE-2025-54874: CWE-457: Use of Uninitialized Variable in uclouvain openjpeg

Medium
VulnerabilityCVE-2025-54874cvecve-2025-54874cwe-457
Published: Tue Aug 05 2025 (08/05/2025, 14:33:17 UTC)
Source: CVE Database V5
Vendor/Project: uclouvain
Product: openjpeg

Description

OpenJPEG is an open-source JPEG 2000 codec. In OpenJPEG from 2.5.1 through 2.5.3, a call to opj_jp2_read_header may lead to OOB heap memory write when the data stream p_stream is too short and p_image is not initialized.

AI-Powered Analysis

AILast updated: 09/27/2025, 00:22:41 UTC

Technical Analysis

CVE-2025-54874 is a medium-severity vulnerability identified in the open-source JPEG 2000 codec library OpenJPEG, specifically versions 2.5.1 through 2.5.3. The vulnerability arises from the use of an uninitialized variable within the function opj_jp2_read_header. When this function processes a JPEG 2000 data stream (p_stream) that is too short, and the image structure (p_image) is not properly initialized, it can lead to an out-of-bounds (OOB) heap memory write. This memory corruption occurs because the code attempts to write data beyond the allocated buffer boundaries, potentially overwriting adjacent memory. The vulnerability is classified under CWE-457, which pertains to the use of uninitialized variables, a common programming error that can lead to unpredictable behavior and security issues. The CVSS 4.0 base score is 6.6, indicating a medium severity level. The vector details show that the attack vector is local (AV:L), requiring low attack complexity (AC:L), no privileges (PR:N), and no user interaction (UI:N). However, the attack requires physical or logical local access to the vulnerable system (local vector), and the exploitability is partial (E:P). The vulnerability impacts confidentiality, integrity, and availability at a high level (VC:H, VI:H, VA:H), meaning successful exploitation could lead to significant compromise of the system. No known exploits are currently reported in the wild, and no patches are linked yet. The vulnerability affects the uclouvain OpenJPEG project, a widely used library for encoding and decoding JPEG 2000 images, which is integrated into various software products and systems that handle image processing, including document viewers, medical imaging software, and digital asset management systems.

Potential Impact

For European organizations, the impact of CVE-2025-54874 can be significant, especially those relying on software that incorporates the vulnerable OpenJPEG versions for image processing tasks. This includes sectors such as healthcare (medical imaging), digital media, publishing, and government agencies that handle large volumes of JPEG 2000 images. Exploitation of this vulnerability could allow an attacker with local access to cause memory corruption, potentially leading to arbitrary code execution, system crashes, or data corruption. This could compromise the confidentiality and integrity of sensitive data, disrupt critical services, and lead to denial of service conditions. Given the local attack vector, the threat is more pronounced in environments where untrusted users have local or network-level access to systems processing JPEG 2000 images. The high impact on confidentiality, integrity, and availability means that successful exploitation could facilitate further lateral movement or privilege escalation within organizational networks. Although no exploits are currently known in the wild, the presence of this vulnerability in a widely used open-source library necessitates proactive risk management to prevent future exploitation.

Mitigation Recommendations

European organizations should take the following specific and practical steps to mitigate the risk posed by CVE-2025-54874: 1) Inventory and identify all software and systems that utilize OpenJPEG versions 2.5.1 through 2.5.3, including embedded applications and third-party products. 2) Monitor the uclouvain OpenJPEG project and related security advisories for the release of patches or updated versions that address this vulnerability, and prioritize timely patching once available. 3) In the interim, implement strict access controls to limit local access to systems processing JPEG 2000 images, reducing the risk of local exploitation. 4) Employ application whitelisting and runtime protections such as memory safety tools (e.g., AddressSanitizer, Control Flow Integrity) to detect and prevent exploitation attempts. 5) Conduct code reviews and testing for custom integrations of OpenJPEG to ensure proper initialization of image structures and validate input stream lengths to prevent malformed data from triggering the vulnerability. 6) Enhance monitoring and logging on affected systems to detect anomalous behaviors indicative of exploitation attempts, such as crashes or unexpected memory errors. 7) Educate system administrators and security teams about the vulnerability and its local attack vector to ensure awareness and readiness to respond to incidents.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-07-31T17:23:33.473Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 68921990ad5a09ad00e9cbb9

Added to database: 8/5/2025, 2:47:44 PM

Last enriched: 9/27/2025, 12:22:41 AM

Last updated: 10/1/2025, 5:39:54 AM

Views: 61

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats