Bug 1939157 (CVE-2021-20304)

Summary: CVE-2021-20304 OpenEXR: Undefined-shift in Imf_2_5::hufDecode
Product: [Other] Security Response Reporter: Michael Kaplan <mkaplan>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: jeischma, jridky, kwizart, rdieter, rh-spice-bugs
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: OpenEXR 3.0.0-beta Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in OpenEXR's hufDecode functionality. This flaw allows an attacker who can pass a crafted file to be processed by OpenEXR, to trigger an undefined right shift error. The highest threat from this vulnerability is to system availability.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-02 23:21:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1939188, 1944917, 1944918, 1944919, 1944920    
Bug Blocks: 1929339    

Description Michael Kaplan 2021-03-15 17:27:24 UTC
Undefined-shift in Imf_2_5::hufDecode

Comment 1 Michael Kaplan 2021-03-15 17:27:28 UTC
External References:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26229

Comment 2 Michael Kaplan 2021-03-15 17:46:22 UTC
Created OpenEXR tracking bugs for this issue:

Affects: fedora-all [bug 1939188]

Comment 3 Todd Cullum 2021-03-30 22:54:13 UTC
Upstream patch: https://github.com/AcademySoftwareFoundation/openexr/commit/51a92d67f53c08230734e74564c807043cbfe41e

Flaw summary:

In hufDecode of IlmImf/ImfHuf.cpp, if lc < 0, the getCode macro function could perform an undefined bitwise right shift with unintended consequences upon execution of `unsigned char cs = (c >> lc);` lc is controllable via the input buffer. This could potentially lead to an impact on application availability when OpenEXR processes a crafted input file.