CVE-2021-45960
Tenable Nessus vulnerability analysis and mitigation

Overview

In Expat (aka libexpat) before 2.4.3, a left shift by 29 (or more) places in the storeAtts function in xmlparse.c can lead to realloc misbehavior (e.g., allocating too few bytes, or only freeing memory). The vulnerability was discovered in late 2021 and assigned CVE-2021-45960 (CVE, NVD).

Technical details

The vulnerability exists in the storeAtts function in xmlparse.c where a left shift operation by 29 or more bits can cause memory allocation issues. The issue occurs when processing XML documents with a large number of prefixed attributes on a single tag. To trigger the vulnerability, approximately 2^27+1 prefixed attributes are needed on a single XML tag when using XML_ParserCreateNS to create the parser (Expat Issue).

Impact

The vulnerability can lead to denial of service (DoS) or potentially more severe consequences. On 32-bit systems, it can cause realloc to allocate too few bytes or act as a free operation, while on 64-bit systems it may lead to undefined behavior when the shift exceeds 31 bits (Expat Issue).

Mitigation and workarounds

The vulnerability was fixed in Expat version 2.4.3. The fix includes detecting and preventing left shifts by sizeof(int) 8 - 1 or more bits, and preventing integer overflow on nsAttsSize sizeof(NS_ATT) calculations. Users should upgrade to Expat version 2.4.3 or later (Expat PR).

Community reactions

Multiple vendors and distributions have released security advisories and patches for this vulnerability, including Debian, NetApp, and Tenable. Debian released security updates for both oldstable (buster) and stable (bullseye) distributions (Debian, NetApp, Tenable).

Additional resources


SourceThis report was generated using AI

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