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- OpenEXR/OpenEXRdescription
- osv-coords9 versionspkg:rpm/opensuse/cobbler&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/openexr&distro=openSUSE%20Leap%2015.3pkg:rpm/suse/cobbler&distro=SUSE%20Package%20Hub%2015%20SP3pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP3pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP2pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Workstation%20Extension%2012%20SP5
< 3.1.2-bp153.2.3.1+ 8 more
- (no CPE)range: < 3.1.2-bp153.2.3.1
- (no CPE)range: < 2.2.1-3.41.1
- (no CPE)range: < 3.1.2-bp153.2.3.1
- (no CPE)range: < 2.2.1-3.41.1
- (no CPE)range: < 2.2.1-3.41.1
- (no CPE)range: < 2.1.0-6.45.1
- (no CPE)range: < 2.1.0-6.45.1
- (no CPE)range: < 2.1.0-6.45.1
- (no CPE)range: < 2.1.0-6.45.1
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- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6TEZDE2S2DB4BF4LZSSV4W3DNW7DSRHJ/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HJ5PW4WNXBKCRFGDZGAQOSVH2BKZKL4X/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XJUK7WIQV5EKWTCZBRXFN6INHG6MLS5O/mitrevendor-advisory
- security.gentoo.org/glsa/202210-31mitrevendor-advisory
- www.debian.org/security/2022/dsa-5299mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2022/12/msg00022.htmlmitremailing-list
- bugs.chromium.org/p/oss-fuzz/issues/detailmitre
- github.com/AcademySoftwareFoundation/openexr/blob/v3.1.4/CHANGES.mdmitre
- github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937emitre
- github.com/AcademySoftwareFoundation/openexr/commit/db217f29dfb24f6b4b5100c24ac5e7490e1c57d0mitre
- github.com/AcademySoftwareFoundation/openexr/pull/1209mitre
- github.com/AcademySoftwareFoundation/openexr/releases/tag/v3.1.4mitre
- github.com/google/oss-fuzz-vulns/blob/main/vulns/openexr/OSV-2021-1627.yamlmitre
News mentions
0No linked articles in our index yet.