CVE-2025-54874 OpenJPEG allows OOB heap memory write in opj_jp2_read_header

Medium 6.6 Published Updated

OpenJPEG library allows out-of-bounds heap memory write during header parsing, potentially enabling code execution or denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-54874?

CVE-2025-54874 is a medium-severity memory corruption vulnerability in Uclouvain Openjpeg, published on 5 Aug 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-457

Which versions are affected by CVE-2025-54874?

It affects 1 product.

Linux distribution packages (12)
openjpeg2 AlmaLinux:10All versions2.5.2-4.el10_0.1
openjpeg2-devel AlmaLinux:10All versions2.5.2-4.el10_0.1
openjpeg2-tools AlmaLinux:10All versions2.5.2-4.el10_0.1
openjpeg2 Red Hat:enterprise_linux:10.0All versions0:2.5.2-4.el10_0.1
openjpeg2-debuginfo Red Hat:enterprise_linux:10.0All versions0:2.5.2-4.el10_0.1
openjpeg2-debugsource Red Hat:enterprise_linux:10.0All versions0:2.5.2-4.el10_0.1
openjpeg2-devel Red Hat:enterprise_linux:10.0All versions0:2.5.2-4.el10_0.1
openjpeg2-tools Red Hat:enterprise_linux:10.0All versions0:2.5.2-4.el10_0.1
openjpeg2-tools-debuginfo Red Hat:enterprise_linux:10.0All versions0:2.5.2-4.el10_0.1
openjpeg2 Rocky Linux:10All versions0:2.5.2-4.el10_0.1
openjpeg2 SUSE:Linux Enterprise Server 16.0All versions2.5.3-160000.4.1
openjpeg2 SUSE:Linux Enterprise Server for SAP applications 16.0All versions2.5.3-160000.4.1

Products include Uclouvain Openjpeg.

How do I fix CVE-2025-54874?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2025-54874 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54874 exists.

Public exploit code: 1 proofs of concept on GitHub.

All Uclouvain Openjpeg vulnerabilities

Sources

Also known as ALPINE-CVE-2025-54874, ALSA-2025:13944, AZL-66090, AZL-66114, BELL-CVE-2025-54874, DEBIAN-CVE-2025-54874 and 7 more.

Is CVE-2025-54874 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free