# CVE-2020-7212: Uncontrolled Resource Consumption in urllib3

> 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, NVD) `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.37% (percentile 90, 2026-11-26)
- **CWE:** CWE-400
- **Aliases:** GHSA-hmv2-79q8-fv6g, PYSEC-2020-149
- **Published:** 2020-03-06T19:14:54.000Z
- **Modified:** 2026-06-17T03:24:31.450Z

## Who should check

- Projects that depend on PyPI package urllib3 (\>= 1.25.2, \< 1.25.8)
- Anyone running n/a (versions: see the vendor advisory)

## Description

The \_encode\_invalid\_chars function in util/url.py in the urllib3 library 1.25.2 through 1.25.7 for Python allows a denial of service (CPU consumption) because of an inefficient algorithm. The percent\_encodings array contains all matches of percent encodings. It is not deduplicated. For a URL of length N, the size of percent\_encodings may be up to O(N). The next step (normalize existing percent-encoded bytes) also takes up to O(N) for each step, so the total time is O(N^2). If percent\_encodings were deduplicated, the time to compute \_encode\_invalid\_chars would be O(kN), where k is at most 484 ((10+6\*2)^2).

## Affected and fixed versions

- PyPI `urllib3`: affected \>= 1.25.2, \< 1.25.8; fixed 1.25.8 (osv)
- n/a: see vendor advisory (nvd)

## Mitigation

- Upgrade urllib3 to 1.25.8 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2020-7212.md
Affected: urllib3 >= 1.25.2, < 1.25.8
Fixed in: 1.25.8

Steps:
1. Search this machine and project for urllib3 (PyPI), n/a: 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-2020-7212 being exploited?

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

### How serious is CVE-2020-7212?

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

### Which versions are affected by CVE-2020-7212?

urllib3 \>= 1.25.2, \< 1.25.8.

### Is there a fix for CVE-2020-7212?

Yes. Fixed in 1.25.8. Upgrade urllib3 to 1.25.8 or later.

### How do I check if I'm affected by CVE-2020-7212?

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://pypi.org/project/urllib3/1.25.8/>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2020-7212>
- vendor: <https://github.com/advisories/GHSA-hmv2-79q8-fv6g>
- patch: <https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a>
- other: <https://github.com/urllib3/urllib3/blob/master/CHANGES.rst>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2020-149.yaml>
- other: <https://github.com/urllib3/urllib3>
- other: <https://pypi.org/project/urllib3/1.25.8>

## 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-2020-7212>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-hmv2-79q8-fv6g> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2020-149> (license: <https://creativecommons.org/licenses/by/4.0/>)

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