Описание
OpenEXR: integer overflow to OOB write in uncompress_b44_impl()
Summary
The B44/B44A decoder in OpenEXR reconstructs row pointers into a scratch buffer using int. When the channel width (nx) is large enough, the product y * nx overflows int, causing the row pointer to wrap before the start of the scratch buffer. Subsequent memcpy() calls then write decoded pixel blocks to an invalid address, producing an active out-of-bounds write.
Root cause
- Variable declarations (internal_b44.c:535)
nx and ny are declared as plain int. They are assigned from curc->width and curc->height which are int32_t.
- Scratch buffer allocation (internal_b44:543)
The allocation path correctly promotes to uint64_t before multiplying. The scratch buffer is always large enough to hold the full channel.
- Row pointer reconstruction (internal_b44:560)
y and nx are both int. The product y * nx is computed in int. If this product exceeds INT_MAX (2,147,483,647), the result is signed integer overflow
- Out of Band write (internal_b44:592)
These four writes copy decoded B44 pixel blocks into row0–row3, which now point to memory before the scratch buffer. The same pattern is present in the encoder path (ht_apply_impl), lines 431–432, where row0–row3 are read rather than written, producing an out-of-bounds read.
PoC
The PoC generates a valid B44 scanline EXR file (268435456 × 9, single HALF channel) and immediately decodes it. During decompression, uncompress_b44_impl() computes row0 += y * nx, with y=8 and nx=268435456, the product exceeds INT_MAX, triggering a signed integer overflow that displaces row0 before the scratch buffer. The subsequent memcpy() writes to this invalid address, causing the crash. The generated file /tmp/poc_b44.exr can be replayed independently on any OpenEXR installation.
ASAN Trace
Impact
A crafted B44 or B44A EXR file can cause an out-of-bounds write in any application that decodes it via exr_decoding_run(). Consequences range from immediate crash (most likely) to corruption of adjacent heap allocations (layout-dependent).
Ссылки
- https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-h762-rhv3-h25v
- https://nvd.nist.gov/vuln/detail/CVE-2026-34544
- https://github.com/AcademySoftwareFoundation/openexr/commit/35e7aa35e22c1975606be86e859f31cc1fc598ee
- https://github.com/AcademySoftwareFoundation/openexr/releases/tag/v3.4.8
Пакеты
openexr
>= 3.4.0, <= 3.4.7
3.4.8
openexr
>= 3.3.0, <= 3.3.8
Отсутствует
openexr
>= 3.2.0, <= 3.2.6
Отсутствует
Связанные уязвимости
OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. From version 3.4.0 to before version 3.4.8, a crafted B44 or B44A EXR file can cause an out-of-bounds write in any application that decodes it via exr_decoding_run(). Consequences range from immediate crash (most likely) to corruption of adjacent heap allocations (layout-dependent). This issue has been patched in version 3.4.8.
OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. From version 3.4.0 to before version 3.4.8, a crafted B44 or B44A EXR file can cause an out-of-bounds write in any application that decodes it via exr_decoding_run(). Consequences range from immediate crash (most likely) to corruption of adjacent heap allocations (layout-dependent). This issue has been patched in version 3.4.8.
OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. From version 3.4.0 to before version 3.4.8, a crafted B44 or B44A EXR file can cause an out-of-bounds write in any application that decodes it via exr_decoding_run(). Consequences range from immediate crash (most likely) to corruption of adjacent heap allocations (layout-dependent). This issue has been patched in version 3.4.8.
OpenEXR provides the specification and reference implementation of the ...