High severity · published Mar 6, 2020
CVE-2020-7212
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…
7.5
CVSS
3.4%
EPSS
No
On KEV
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).
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
None
Integrity
None
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)3.4% · higher than 89% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
UR
Urllib3 · Python
1.25.2 through 1.25.7 · source: NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-7212
CVE.org
https://www.cve.org/CVERecord?id=CVE-2020-7212
Release Notes
https://github.com/urllib3/urllib3/blob/master/CHANGES.rst
Patch
https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a
Release Notes
https://pypi.org/project/urllib3/1.25.8/
More from Urllib3
9.8
CVE-2018-20060
urllib3 before version 1.23 does not remove the Authorization HTTP header when following a cross-origin redirect (i.e., a redirect that differs in host, port, or scheme)
8.1
CVE-2026-97687
urllib3: HTTPS proxy TLS configuration may be ignored or overridden
8.1
CVE-2023-43804
urllib3 is a user-friendly HTTP client library for Python
7.5
CVE-2026-97689
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
7.5
CVE-2026-44432
urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API
