CVE-2021-33503: urllib3 - Catastrophic Backtracking in Authority Regular Expression

urllib3 Updated 02 Oct 2025

Summary

29/06/2021
Yes i
High
7.5

CVE-2021-33503: An issue was discovered in urllib3 before 1.26.5. Affects urllib3 across 2 version ranges.

< 1.26.5 < 2d4a3fee6de2fa45eb82169361918f759269b4ec

Fixed in 2d4a3fee6de2fa45eb82169361918f759269b4ec. How to fix ↓

Also tracked for

The same CVE-2021-33503 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

urllib3 is a Python HTTP library that provides a simple interface for making HTTP requests. It is widely used in various Python applications and frameworks. This vulnerability affects urllib3 versions before 1.26.5. The library's authority regular expression is susceptible to catastrophic backtracking when processing URLs with a large number of @ characters in the authority component. This can lead to a denial of service if a malicious URL is passed as a parameter or redirected to via an HTTP redirect.

Vulnerability Detail

The vulnerability in urllib3 arises from a flaw in the authority regular expression. When presented with a URL containing numerous @ characters in the authority component, the regular expression exhibits catastrophic backtracking. This can cause the regular expression matching process to consume excessive time and resources, leading to a denial of service condition. An attacker could exploit this vulnerability by crafting a malicious URL and passing it as a parameter or redirecting to it via an HTTP redirect. The impact of this vulnerability can range from service disruption to complete unavailability.

How To Fix

Latest published version: 2.8.0 as of 23 Oct 2026

pip install --upgrade "urllib3==2.8.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2d4a3fee6de2fa45eb82169361918f759269b4ec

This is the first release that contains the fix.

pip install --upgrade "urllib3==2d4a3fee6de2fa45eb82169361918f759269b4ec"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, users can manually modify the authority regular expression in urllib3 to prevent catastrophic backtracking. However, this approach is not recommended as it requires modifying the library's source code. It is strongly advised to upgrade to the latest version of urllib3 instead.

Conclusion

The vulnerability in urllib3 versions before 1.26.5 allows for catastrophic backtracking in the authority regular expression, leading to a denial of service condition. It is crucial to upgrade to the latest version of urllib3 (1.26.5 or later) to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for urllib3 →

Share this vulnerability

FAQ

urllib3 is a Python HTTP library that provides a simple interface for making HTTP requests. It is widely used in various Python applications and frameworks.

Versions of urllib3 before 1.26.5 are affected by this vulnerability.

Catastrophic backtracking is a behavior exhibited by certain regular expressions when presented with certain inputs. It causes the regular expression matching process to consume excessive time and resources, leading to a denial of service condition.

An attacker can exploit this vulnerability by crafting a malicious URL containing a large number of @ characters in the authority component and passing it as a parameter or redirecting to it via an HTTP redirect.

The impact of this vulnerability can range from service disruption to complete unavailability, as it can cause a denial of service condition in applications using urllib3.

Related vulnerabilities

Recent vulnerabilities recorded for urllib3.

How To Fix

Latest published version: 2.8.0 as of 23 Oct 2026

pip install --upgrade "urllib3==2.8.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2d4a3fee6de2fa45eb82169361918f759269b4ec

This is the first release that contains the fix.

pip install --upgrade "urllib3==2d4a3fee6de2fa45eb82169361918f759269b4ec"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback