VYPR
Unrated severityNVD Advisory· Published Dec 31, 2021· Updated Aug 4, 2024

CVE-2021-45942

CVE-2021-45942

Description

OpenEXR 3.1.x before 3.1.4 has a heap-based buffer overflow in Imf_3_1::LineCompositeTask::execute (called from IlmThread_3_1::NullThreadPoolProvider::addTask and IlmThread_3_1::ThreadPool::addGlobalTask). NOTE: db217f2 may be inapplicable.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

11

Patches

Vulnerability mechanics

Root cause

"Missing integer-overflow checks for packedDataSize and unpackedDataSize in readSampleCountForLineBlock allow a heap-based buffer overflow."

Attack vector

An attacker crafts a malicious OpenEXR file with sample count table data, packed data, or unpacked data sizes exceeding `INT_MAX`. When the library reads the sample count table, the missing size checks allow a heap-based buffer overflow [CWE-122]. The overflow is triggered during file parsing without authentication, making it remotely exploitable via any application that opens the crafted file.

Affected code

The heap-based buffer overflow occurs in `Imf_3_1::LineCompositeTask::execute`, called from `IlmThread_3_1::NullThreadPoolProvider::addTask` and `IlmThread_3_1::ThreadPool::addGlobalTask`. The patch in `db217f2` addresses the root cause in `readSampleCountForLineBlock` by adding missing size checks for `packedDataSize` and `unpackedDataSize` against `compressorMaxDataSize` before reading sample count data.

What the fix does

The patch adds two additional size comparisons — `packedDataSize > compressorMaxDataSize` and `unpackedDataSize > compressorMaxDataSize` — alongside the existing `sampleCountTableDataSize` check. Previously only `sampleCountTableDataSize` was validated, allowing oversized packed/unpacked sizes to bypass the guard and cause a heap overflow when the data is later read into a buffer sized by `compressorMaxDataSize`. The fix also changes `compressorMaxDataSize` from `int` to `uint64_t` to avoid implicit truncation.

Preconditions

  • inputThe attacker must supply a crafted OpenEXR file with packed or unpacked data sizes exceeding INT_MAX.
  • authNo authentication or special privileges are required; the overflow occurs during file parsing.

Generated on May 30, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

13

News mentions

0

No linked articles in our index yet.