python-urllib3: inefficient algorithm allows a DoS (CPU consumption) in _encode_invalid_chars function in util/url.py
Published Mar 6, 2020
8.7
HIGHCVSS 4.0
EPSS 3.37%
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 products
No data.
No data.
Red Hat Enterprise Linux 6
python-urllib3
Not affected
Red Hat Enterprise Linux 7
python-urllib3
Not affected
Red Hat Enterprise Linux 8
python-urllib3
Not affected
Red Hat OpenShift Container Platform 3.11
python-urllib3
Not affected
Red Hat OpenShift Container Platform 4
python-urllib3
Not affected
Red Hat OpenStack Platform 10 (Newton)
python-urllib3
Not affected
Red Hat OpenStack Platform 13 (Queens)
python-urllib3
Not affected
Red Hat OpenStack Platform 15 (Stein)
python-urllib3
Not affected
Red Hat Quay 3
python-urllib3
Not affected
Red Hat Satellite 6
python-urllib3
Not affected
Red Hat Software Collections
rh-mongodb36-python-urllib3
Not affected
Red Hat Software Collections
rh-python38-python-urllib3
Not affected
Red Hat Storage 3
python-urllib3
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 | python-urllib3 | Not affected | n/a |
| Red Hat Enterprise Linux 7 | python-urllib3 | Not affected | n/a |
| Red Hat Enterprise Linux 8 | python-urllib3 | Not affected | n/a |
| Red Hat OpenShift Container Platform 3.11 | python-urllib3 | Not affected | n/a |
| Red Hat OpenShift Container Platform 4 | python-urllib3 | Not affected | n/a |
| Red Hat OpenStack Platform 10 (Newton) | python-urllib3 | Not affected | n/a |
| Red Hat OpenStack Platform 13 (Queens) | python-urllib3 | Not affected | n/a |
| Red Hat OpenStack Platform 15 (Stein) | python-urllib3 | Not affected | n/a |
| Red Hat Quay 3 | python-urllib3 | Not affected | n/a |
| Red Hat Satellite 6 | python-urllib3 | Not affected | n/a |
| Red Hat Software Collections | rh-mongodb36-python-urllib3 | Not affected | n/a |
| Red Hat Software Collections | rh-python38-python-urllib3 | Not affected | n/a |
| Red Hat Storage 3 | python-urllib3 | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
Red Hat Product Security does not consider this to be a vulnerability. The choice of an inefficient algorithm could cause a little more CPU time to be used than the alternative, however the difference in practice is not sufficient to cause a meaningful or even noticeable impact on the application.
Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
No CVSS v3.0 score for this CVE.
AV:N/AC:L/Au:N/C:N/I:N/A:C
This CVE is not in the KEV list.
No CISA SSVC assessment for this CVE yet.
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 1, 2026.
Score over time
2021–2026- EPSS v1
- EPSS v2
- EPSS v3
- EPSS v5
Percentile over time
- EPSS v1
- EPSS v2
- EPSS v3
- EPSS v5
Table of values (14 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 3.37% (0.03371) | 88.35th | v5 (v2026.06.15) |
| Jun 15, 2026 | 3.29% (0.03288) | 86.84th | v5 (v2026.06.15) |
| Jul 20, 2024 | 0.20% (0.00204) | 58.86th | v3 (v2023.03.01) |
| Jan 9, 2024 | 0.20% (0.00204) | 58.32th | v3 (v2023.03.01) |
| Dec 25, 2023 | 0.21% (0.00211) | 58.93th | v3 (v2023.03.01) |
| Mar 7, 2023 | 0.18% (0.00176) | 52.95th | v3 (v2023.03.01) |
| Mar 6, 2023 | 0.95% (0.00954) | 36.37th | v2 (v2022.01.01) |
| Sep 2, 2022 | 0.95% (0.00954) | 34.50th | v2 (v2022.01.01) |
| Apr 1, 2022 | 0.95% (0.00954) | 32.50th | v2 (v2022.01.01) |
| Feb 4, 2022 | 5.74% (0.05736) | 77.22th | v2 (v2022.01.01) |
| Feb 3, 2022 | 4.49% (0.04486) | 75.02th | v1 |
| Jan 6, 2022 | 4.49% (0.04486) | 74.80th | v1 |
| Sep 1, 2021 | 1.04% (0.01036) | 62.47th | v1 |
| Apr 14, 2021 | 1.04% (0.01036) | 0.00th | v1 |
References (10)
- https://access.redhat.com/security/cve/CVE-2020-7212 Vendor Advisory
- https://bugzilla.novell.com/show_bug.cgi?id=1166069
- https://bugzilla.redhat.com/show_bug.cgi?id=1812095 Issue Tracking
- https://github.com/advisories/GHSA-hmv2-79q8-fv6g Advisory
- https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2020-149.yaml
- https://github.com/urllib3/urllib3/blob/master/CHANGES.rst x_refsource_MISCRelease NotesThird Party Advisory
- https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a x_refsource_MISCPatchThird Party Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2020-7212
- https://pypi.org/project/urllib3/1.25.8 x_refsource_MISCRelease NotesVendor Advisory
- https://www.cve.org/CVERecord?id=CVE-2020-7212
| Link | Providers | Tags |
|---|---|---|
| https://access.redhat.com/security/cve/CVE-2020-7212 | Vendor Advisory | |
| https://bugzilla.novell.com/show_bug.cgi?id=1166069 | ||
| https://bugzilla.redhat.com/show_bug.cgi?id=1812095 | Issue Tracking | |
| https://github.com/advisories/GHSA-hmv2-79q8-fv6g | Advisory | |
| https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2020-149.yaml | ||
| https://github.com/urllib3/urllib3/blob/master/CHANGES.rst | x_refsource_MISCRelease NotesThird Party Advisory | |
| https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a | x_refsource_MISCPatchThird Party Advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-7212 | ||
| https://pypi.org/project/urllib3/1.25.8 | x_refsource_MISCRelease NotesVendor Advisory | |
| https://www.cve.org/CVERecord?id=CVE-2020-7212 |
Change history (0)
No recorded changes yet.