Описание
OpenEXR Heap-Based Buffer Overflow in Deep Scanline Parsing via Forged Unpacked Size
Summary
The OpenEXRCore code is vulnerable to a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header.
Details
When parsing STORAGE_DEEP_SCANLINE
chunks from an EXR file, the following code (from src/lib/OpenEXRCore/chunk.c
) is used to extract the chunk information:
By storing this information, the code that will later decompress and reconstruct the chunk bytes, will know how much space the uncompressed data will occupy.
This size is carried along in the chain of decoding/decompression until the undo_zip_impl
function in src/lib/OpenEXRCore/internal_zip.c
:
The uncompressed_size
comes from the unpacked_size
extracted earlier, and the uncompressed_data
is a buffer allocated by making space for the size "advertised" in the chunk information.
However, scratch_data
and actual_out_bytes
will contain, after decompression, the uncompressed data and its size, respectively.
The vulnerability lies in the fact that the undo_zip_impl
function lacks code to check whether actual_out_bytes
is greater than uncompressed_size
.
The effect is that, by setting the unpacked_size
in the chunk header smaller than the actual chunk decompressed data, it is possible - in the internal_zip_reconstruct_bytes
function - to overflow past the boundaries of a heap chunk.
PoC
NOTE: you can download the heap_overflow.exr
file from this link:
https://github.com/ShielderSec/poc/tree/main/CVE-2025-48071
- Compile the
exrcheck
binary in a macOS or GNU/Linux machine with ASAN. - Open the
heap_overflow.exr
file with the following command:
- Notice that
exrcheck
crashes with an ASAN stack-trace.
Impact
An attacker might exploit this vulnerability by feeding a maliciously crafted file to a program that uses the OpenEXR libraries, thus gaining the capability to write an arbitrary amount of bytes in the heap. This could potentially result in code execution in the process.
Ссылки
- https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-h45x-qhg2-q375
- https://nvd.nist.gov/vuln/detail/CVE-2025-48071
- https://github.com/AcademySoftwareFoundation/openexr/commit/916cc729e24aa16b86d82813f6e136340ab2876f
- https://github.com/AcademySoftwareFoundation/openexr/releases/tag/v3.3.3
- https://github.com/ShielderSec/poc/tree/main/CVE-2025-48071
Пакеты
OpenEXR
>= 3.3.0, < 3.3.3
3.3.3
Связанные уязвимости
OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. In versions 3.3.2 through 3.3.0, there is a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header. This is fixed in version 3.3.3.
OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. In versions 3.3.2 through 3.3.0, there is a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header. This is fixed in version 3.3.3.
OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. In versions 3.3.2 through 3.3.0, there is a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header. This is fixed in version 3.3.3.
OpenEXR provides the specification and reference implementation of the ...