# CVE-2021-21240: Regular Expression Denial of Service in httplib2

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 3.67% (percentile 90, 2026-11-26)
- **CWE:** CWE-400
- **Aliases:** GHSA-93xj-8mrv-444m, PYSEC-2021-16
- **Published:** 2021-02-08T19:41:59.000Z
- **Modified:** 2026-09-10T03:49:14.200Z

## Who should check

- Projects that depend on PyPI package httplib2 (\< 0.19.0)
- Anyone running httplib2 \< 0.19.0

## Description

httplib2 is a comprehensive HTTP client library for Python. In httplib2 before version 0.19.0, a malicious server which responds with long series of "\\xa0" characters in the "www-authenticate" header may cause Denial of Service (CPU burn while parsing header) of the httplib2 client accessing said server. This is fixed in version 0.19.0 which contains a new implementation of auth headers parsing using the pyparsing library.

## Affected and fixed versions

- PyPI `httplib2`: affected \< 0.19.0; fixed 0.19.0 (osv)
- httplib2: \< 0.19.0 (cvelist)

## Mitigation

- Upgrade httplib2 to 0.19.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-21240. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-21240.md
Affected: httplib2 < 0.19.0
Fixed in: 0.19.0

Steps:
1. Search this machine and project for httplib2 (PyPI), httplib2: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-21240 being exploited?

There is no confirmed exploitation: CVE-2021-21240 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 3.67% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-21240?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2021-21240?

httplib2 \< 0.19.0.

### Is there a fix for CVE-2021-21240?

Yes. Fixed in 0.19.0. Upgrade httplib2 to 0.19.0 or later.

### How do I check if I'm affected by CVE-2021-21240?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/httplib2/httplib2/security/advisories/GHSA-93xj-8mrv-444m>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-21240>
- patch: <https://github.com/httplib2/httplib2/pull/182>
- patch: <https://github.com/httplib2/httplib2/commit/bd9ee252c8f099608019709e22c0d705e98d26bc>
- other: <https://pypi.org/project/httplib2>
- other: <https://github.com/httplib2/httplib2>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/httplib2/PYSEC-2021-16.yaml>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-21240>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-93xj-8mrv-444m> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2021-16> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-21240> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-21240>
