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

Source: https://junglewise.ai/threats/cve-2021-21240-regular-expression-denial-of-service-redos-in-httplib2  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-02-08  
License: CC BY 4.0 with a link back

CVE-2021-21240 · Severity: low · CVSS 3.1 · Published 2021-02-08

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.

Technologies: [httplib2 (PyPI)](https://junglewise.ai/threats/technologies/pypi-httplib2). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2021-21240 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-21240 being exploited in the wild.

**How severe is CVE-2021-21240?** Low severity, with a CVSS score of 3.1, published 8 February 2021.

**Which products and versions are affected?** httplib2 (PyPI) ECOSYSTEM:introduced=0,fixed=0.19.0, GIT:introduced=0,fixed=bd9ee252c8f099608019709e22c0d705e98d26bc|ECOSYSTEM:introduced=0,fixed=0.19.0.

**Is there a fix for CVE-2021-21240?** Yes. httplib2 (PyPI): upgrade to 0.19.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2021-21240?** Check whether you run httplib2 (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- httplib2 (PyPI): upgrade to 0.19.0 or later

  ```sh
  pip install "httplib2>=0.19.0"
  ```


## Affected products

- httplib2 (PyPI) ECOSYSTEM:introduced=0,fixed=0.19.0, GIT:introduced=0,fixed=bd9ee252c8f099608019709e22c0d705e98d26bc|ECOSYSTEM:introduced=0,fixed=0.19.0

## Identifiers

- CVE-2021-21240
- GHSA-93xj-8mrv-444m
- PYSEC-2021-16

## Related threats

- [httplib2 unbounded decompression denial of service](https://junglewise.ai/threats/cve-2026-59939-httplib2-unbounded-decompression-denial-of-service)
- [CRLF injection in httplib2](https://junglewise.ai/threats/cve-2020-11078-crlf-injection-in-httplib2)
- [httplib2 incorrectly checks SSL certificate](https://junglewise.ai/threats/cve-2013-2037-httplib2-incorrectly-checks-ssl-certificate)
