CVEfocus › CVE database › CVE-2020-7212

CVE-2020-7212

CVSS 7.5 HighEPSS 3.4% (higher than 89% of CVEs)Published 2020-03-06Updated 2024-08-04Assigner: mitre

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).

What to do

Fixed builds are available from Debian, PyPI: see the table below for the fixed version per release.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

4Fixed
5Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 16.04python-urllib3Not affected
vulnerable_code_not_present
Debian 14python-urllib3Fixed1.25.8-1DEBIAN-CVE-2020-7212
Debian 13python-urllib3Fixed1.25.8-1DEBIAN-CVE-2020-7212
Debian 12python-urllib3Fixed1.25.8-1DEBIAN-CVE-2020-7212
Red Hat Enterprise Linux 8python-urllib3Not affected
Red Hat Enterprise Linux 8python3-urllib3Not affected
Red Hat Enterprise Linux 7python-urllib3Not affected
Red Hat Enterprise Linux 6python-urllib3Not affected
PyPI libraryurllib3Fixed1.25.8PYSEC-2020-149

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.