CVE-2021-21240
Python vulnerability analysis and mitigation

Overview

CVE-2021-21240 affects httplib2, a comprehensive HTTP client library for Python, in versions before 0.19.0. The vulnerability was discovered and disclosed on February 8, 2021. The issue affects the library's handling of WWW-Authenticate headers, specifically when parsing authentication information (NVD, Ubuntu).

Technical details

The vulnerability stems from a regular expression parsing issue in the WWW-Authenticate header handling. When a malicious server responds with a long series of '\xa0' characters in the 'www-authenticate' header, it triggers a CPU-intensive parsing operation due to cubic complexity of whitespace matching in the WWW_AUTH_RELAXED (default) regexp. The vulnerability has been assigned a CVSS v3.1 base score of 7.5 (High), with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (NVD, GitHub Advisory).

Impact

The vulnerability can lead to a Denial of Service condition through CPU resource exhaustion when parsing the malicious header. When exploited, it causes the httplib2 client to enter a CPU-intensive parsing operation, effectively creating a denial of service condition for the application using the library (GitHub Advisory).

Exploitability

The vulnerability can be exploited by a malicious server that responds with specifically crafted WWW-Authenticate headers containing long series of '\xa0' characters. The attack requires no special privileges or user interaction, making it relatively straightforward to exploit (GitHub Advisory).

Mitigation and workarounds

The vulnerability was fixed in httplib2 version 0.19.0 with a new implementation of auth headers parsing using the pyparsing library. For users unable to upgrade immediately, a workaround is available by enabling strict parsing mode with the setting 'httplib2.USE_WWW_AUTH_STRICT_PARSING = True' (GitHub PR, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-48039CRITICAL9.1
  • Python logoPython
  • meta-ads-mcp
NoYesAug 07, 2026
CVE-2026-48169HIGH8.8
  • Python logoPython
  • praisonai-platform
NoYesAug 07, 2026
GHSA-wvpp-8hx9-p66jHIGH8.8
  • Python logoPython
  • gitpython
NoYesAug 07, 2026
CVE-2026-71870MEDIUM4.8
  • Python logoPython
  • pypdf2
NoYesAug 07, 2026
CVE-2026-71852MEDIUM4.8
  • Python logoPython
  • pypdf
NoYesAug 07, 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