CVE-2021-20304
NixOS vulnerability analysis and mitigation

Overview

A flaw was discovered in OpenEXR's hufDecode functionality (CVE-2021-20304) that allows an attacker who can pass a crafted file to trigger an undefined right shift error. The vulnerability affects OpenEXR versions up to and including 2.5.7 (NVD).

Technical details

The vulnerability exists in the hufDecode function of IlmImf/ImfHuf.cpp, where if lc < 0, the getCode macro function could perform an undefined bitwise right shift. The lc value is controllable via the input buffer. The vulnerability has been assigned a CVSS v3.1 base score of 7.5 (HIGH) with vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (NVD, Bugzilla).

Impact

The highest threat from this vulnerability is to system availability. When OpenEXR processes a crafted input file, the undefined shift behavior could potentially lead to an impact on application availability (NVD, Bugzilla).

Mitigation and workarounds

The vulnerability was fixed in OpenEXR 3.0.0-beta with a patch that adds validation checks for Huf code lengths. The fix involves checking for negative lc values before performing the shift operation (GitHub Patch). Users are advised to upgrade to a version that includes this fix.

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-20807MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20806MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20805MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20804MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20803MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management