{"id":"CVE-2020-7212","aliases":["CVE-2020-7212","GHSA-hmv2-79q8-fv6g","PYSEC-2020-149"],"related":[],"kind":"vulnerability","state":"published","title":"Uncontrolled Resource Consumption in urllib3","summary":"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).","summarySource":"cvelist","descriptions":[{"lang":"en","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).","source":"cvelist"},{"lang":"es","text":"La función _encode_invalid_chars en el archivo util/url.py en la biblioteca urllib3 versiones 1.25.2 hasta 1.25.7 para Python, permite una denegación de servicio (consumo de CPU) debido a un algoritmo ineficiente. La matriz percent_encodings contiene todas las coincidencias de las codificaciones porcentuales. No está desdoblada. Para una URL de longitud N, el tamaño de percent_encodings puede ser hasta O(N). El siguiente paso (normalizar los bytes codificados porcentualmente existentes) también ocupa hasta O(N) para cada paso, por lo que el tiempo total es O(N^2). Si se desdoblaran los porcentajes de codificación, el tiempo para calcular _encode_invalid_chars sería O(kN), donde k es como máximo 484 ((10+6*2)^2).","source":"nvd"}],"published":"2020-03-06T19:14:54.000Z","modified":"2026-06-17T03:24:31.450Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:C","score":7.8,"rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.25.2","status":"affected","fixed":"1.25.8"}],"ecosystem":"PyPI","package":"urllib3","purl":"pkg:pypi/urllib3","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.25.2","lastAffected":"1.25.7"}],"vendor":"python","product":"urllib3","cpe":"cpe:2.3:a:python:urllib3:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"a74c9cfbaed9f811e7563cfc3dce894928e0221a"},{"type":"ecosystem","introduced":"1.25.2","status":"affected","fixed":"1.25.8"}],"ecosystem":"PyPI","package":"urllib3","purl":"pkg:pypi/urllib3","repo":"https://github.com/urllib3/urllib3","source":"pysec"}],"references":[{"url":"https://github.com/urllib3/urllib3/blob/master/CHANGES.rst","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/urllib3/urllib3/commit/a74c9cfbaed9f811e7563cfc3dce894928e0221a","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://pypi.org/project/urllib3/1.25.8/","tags":["package","release-notes","vendor-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-7212","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-hmv2-79q8-fv6g","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2020-149.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/urllib3/urllib3","tags":["package"],"sources":["ghsa"]},{"url":"https://pypi.org/project/urllib3/1.25.8","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-7212","url":"https://www.cve.org/CVERecord?id=CVE-2020-7212","licence":"CVE Terms of Use","modified":"2024-08-04T09:25:48.318Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hmv2-79q8-fv6g","url":"https://github.com/advisories/GHSA-hmv2-79q8-fv6g","licence":"CC-BY-4.0","modified":"2024-11-18T22:35:00.503Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-7212","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-7212","licence":"Public domain","modified":"2026-06-17T03:24:31.450Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-149","url":"https://osv.dev/vulnerability/PYSEC-2020-149","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:58.967Z"}],"updatedAt":"2026-11-25T22:57:51.056Z","epss":{"score":0.03371,"percentile":0.89063,"date":"2026-12-01T12:00:22.000Z"}}