Miggo Logo

CVE-2025-48071: OpenEXR Heap-Based Buffer Overflow in Deep Scanline Parsing via Forged Unpacked Size

N/A

CVSS Score

Basic Information

EPSS Score
-
Published
7/31/2025
Updated
7/31/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
OpenEXRpip>= 3.3.0, < 3.3.33.3.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a classic heap-based buffer overflow within the OpenEXR library, specifically when handling ZIPS-compressed deep scanline EXR files. The core of the issue lies in the undo_zip_impl function located in src/lib/OpenEXRCore/internal_zip.c. An attacker can craft an EXR file with a forged chunk header, specifying a small unpacked_size. When the library processes this file, it allocates a buffer based on this small, untrusted size. However, the actual decompressed data is larger. The undo_zip_impl function, prior to the patch, failed to validate that the actual decompressed size (actual_out_bytes) did not exceed the allocated buffer size (uncompressed_size). This leads to internal_zip_reconstruct_bytes being called with a size parameter larger than the destination buffer, resulting in a heap overflow. The fix, as seen in commit 916cc729e24aa16b86d82813f6e136340ab2876f, introduces the necessary check. During exploitation, a profiler would show undo_zip_impl in the call stack, which then calls internal_zip_reconstruct_bytes where the memory corruption occurs.

Vulnerable functions

undo_zip_impl
src/lib/OpenEXRCore/internal_zip.c
This function is vulnerable because it fails to validate that the actual size of the decompressed data (`actual_out_bytes`) is not greater than the size specified in the file's chunk header (`uncompressed_size`). This oversight allows a maliciously crafted file to cause a heap buffer overflow in the `internal_zip_reconstruct_bytes` function, which is called by `undo_zip_impl`.
internal_zip_reconstruct_bytes
src/lib/OpenEXRCore/internal_zip.c
This function is responsible for reconstructing the bytes of the decompressed data. It is called by `undo_zip_impl` and is the function where the heap-based buffer overflow occurs when it's called with a size larger than the destination buffer.

WAF Protection Rules

WAF Rule

### Summ*ry T** Op*n*XR*or* *o** is vuln*r**l* to * ***p-**s** *u***r ov*r*low *urin* * writ* op*r*tion w**n ***ompr*ssin* ZIPS-p**k** ***p s**n-lin* *XR *il*s wit* * m*li*iously *or*** **unk *****r. ### **t*ils W**n p*rsin* `STOR***_***P_S**NLIN*`

Reasoning

T** vuln*r**ility is * *l*ssi* ***p-**s** *u***r ov*r*low wit*in t** Op*n*XR li*r*ry, sp**i*i**lly w**n **n*lin* ZIPS-*ompr*ss** ***p s**nlin* *XR *il*s. T** *or* o* t** issu* li*s in t** `un*o_zip_impl` *un*tion lo**t** in `sr*/li*/Op*n*XR*or*/int*r