CVE-2021-33503: urllib3 ReDoS in URL authority parser

CVE-2021-33503 · Severity: high · CVSS 7.5 · Published 2021-06-01

urllib3 is a widely used Python library for making web requests. A flaw in how it processes web addresses (URLs) allows an attacker to crash or significantly slow down an application by providing a specially crafted URL. This can lead to a denial-of-service, making the affected application or service unavailable to legitimate users.

Technologies: urllib3 (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2021-33503 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-33503 being exploited in the wild.
How severe is CVE-2021-33503?
High severity, with a CVSS score of 7.5, published 1 June 2021.
Which products and versions are affected?
urllib3 (PyPI) >= 1.25.4, < 1.26.5, ECOSYSTEM:introduced=1.25.4,fixed=1.26.5, GIT:introduced=0,fixed=2d4a3fee6de2fa45eb82169361918f759269b4ec|ECOSYSTEM:introduced=1.25.4,fixed=1.26.5.
Is there a fix for CVE-2021-33503?
Yes. urllib3 (PyPI): upgrade to 1.26.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-33503 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2021-33503?
Check whether you run urllib3 (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

  • urllib3 (PyPI): upgrade to 1.26.5 or later
    pip install "urllib3>=1.26.5"

Technical details

A Regular Expression Denial of Service (ReDoS) vulnerability exists in urllib3 due to catastrophic backtracking in the URL authority parser. When the library processes a URL containing a large number of '@' characters in the authority component, the regular expression engine requires exponential time to evaluate the input. This can be triggered remotely if an application passes attacker-controlled URLs to urllib3 or follows a malicious HTTP redirect. The issue is fixed in version 1.26.5 by optimizing the regular expression used for parsing.

Affected products

  • urllib3 urllib3 >= 1.25.4, < 1.26.5

Identifiers

  • CVE-2021-33503
  • GHSA-q2q7-5pp4-w6pg
  • PYSEC-2021-108

Timeline

  • 2021-05-26: disclosed
  • 2021-05-28: patched: Fix merged in version 1.26.5
  • 2021-06-01: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.