{"id":"CVE-2020-7212","published":"2020-03-06T19:14:54Z","modified":"2024-08-04T09:25:48Z","title":"The _encode_invalid_chars function in util/url.py in the urllib3 library 1.25.2 through 1.25.7 for Python allows a…","vendor":null,"product":null,"tier":"tail","description":{"text":"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).","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.03371,"percentile":0.88723,"provenance":"source"},"cwes":[],"references":[{"url":"https://github.com/urllib3/urllib3/blob/master/CHANGES.rst","tags":["x_refsource_MISC"]},{"url":"https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a","tags":["x_refsource_MISC"]},{"url":"https://pypi.org/project/urllib3/1.25.8/","tags":["x_refsource_MISC"]}],"priority":{"score":17.7,"factors":[{"name":"EPSS percentile","points":17.74}]},"affected":[{"ecosystem":"PyPI","package":"urllib3","vulnerableRanges":[">=1.25.2, <1.25.8"],"patched":["1.25.8"],"from":["GHSA-hmv2-79q8-fv6g","PYSEC-2020-149"],"provenance":"source"}],"euvd":{"id":"EUVD-2020-0231","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-urllib3-cve-2018-20060","children":[{"from":"CVE-2020-7212","to":"CVE-2021-33503","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/urllib3/util/url.py"],"commits":["https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a","https://github.com/urllib3/urllib3/commit/2d4a3fee6de2fa45eb82169361918f759269b4ec","https://github.com/urllib3/urllib3/commit/5b047b645f5f93900d5e2fc31230848c25eb1f5f"],"basis":"shared function","functions":["parse_url","split_first"]}]}],"packageHistory":[{"cve":"CVE-2018-25091","published":"2023-10-15","fixed":"1.24.2","kev":false},{"cve":"CVE-2019-11324","published":"2019-04-18","fixed":"1.24.2","kev":false},{"cve":"CVE-2019-11236","published":"2019-04-15","fixed":"1.24.3","kev":false},{"cve":"CVE-2020-7212","published":"2020-03-06","fixed":"1.25.8","kev":false},{"cve":"CVE-2020-26137","published":"2020-09-29","fixed":"1.25.9","kev":false,"link":{"from":"CVE-2020-7212","to":"CVE-2020-26137","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:urllib3","fromFixed":"1.25.8","toFixed":"1.25.9","daysApart":207}]}},{"cve":"CVE-2021-28363","published":"2021-03-15","fixed":"1.26.4","kev":false},{"cve":"CVE-2021-33503","published":"2021-06-29","fixed":"1.26.5","kev":false}],"package":"PyPI:urllib3"}}