{"id":"CVE-2021-32052","published":"2021-05-06T15:49:20Z","modified":"2024-08-03T23:17:28Z","title":"In Django 2.2 before 2.2.22, 3.1 before 3.1.10, and 3.2 before 3.2.2 (with Python 3.9.5+), URLValidator does not…","vendor":null,"product":null,"tier":"tail","description":{"text":"In Django 2.2 before 2.2.22, 3.1 before 3.1.10, and 3.2 before 3.2.2 (with Python 3.9.5+), URLValidator does not prohibit newlines and tabs (unless the URLField form field is used). If an application uses values with newlines in an HTTP response, header injection can occur. Django itself is unaffected because HttpResponse prohibits newlines in HTTP headers.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.03172,"percentile":0.88346,"provenance":"source"},"cwes":[],"references":[{"url":"https://groups.google.com/forum/#%21forum/django-announce","tags":["x_refsource_MISC"]},{"url":"https://docs.djangoproject.com/en/3.2/releases/security/","tags":["x_refsource_MISC"]},{"url":"http://www.openwall.com/lists/oss-security/2021/05/06/1","tags":["x_refsource_MISC"]},{"url":"https://www.djangoproject.com/weblog/2021/may/06/security-releases/","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://security.netapp.com/advisory/ntap-20210611-0002/","tags":["x_refsource_CONFIRM"]}],"priority":{"score":17.7,"factors":[{"name":"EPSS percentile","points":17.67}]},"affected":[{"ecosystem":"PyPI","package":"Django","vulnerableRanges":[">=2.2, <2.2.22",">=3.1, <3.1.10",">=3.2, <3.2.2"],"patched":["2.2.22","3.1.10","3.2.2"],"from":["GHSA-qm57-vhq3-3fwf","PYSEC-2021-8"],"provenance":"source"}],"summary":{"text":"The flaw is in Django's URLValidator component: it fails to reject newline and tab characters in URLs, unless the URLField form field is used. The validator does not apply to Django's own HttpResponse, which already blocks newlines in headers, so the issue concerns applications that place such validated values into HTTP responses. An attacker who can supply a URL value that passes URLValidator and is then used in an HTTP response can inject headers, provided the application builds responses with newlines from that value and does not go through the URLField form field.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:27:58Z"},"euvd":{"id":"EUVD-2021-0065","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-django-cve-2021-32052","children":[{"from":"CVE-2021-32052","to":"CVE-2023-36053","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["django/core/validators.py"],"commits":["https://github.com/django/django/commit/e1e81aa1c4427411e3c68facdd761229ffea6f6f","https://github.com/django/django/commit/454f2fb93437f98917283336201b4048293f7582","https://github.com/django/django/commit/ad0410ec4f458aa39803e5f6b9a3736527062dcd"],"basis":"shared function","functions":["__init__"]}]}],"packageHistory":[{"cve":"CVE-2021-3281","published":"2021-02-02","fixed":"3.1.6","kev":false},{"cve":"CVE-2021-28658","published":"2021-04-06","fixed":"3.1.8","kev":false},{"cve":"CVE-2021-31542","published":"2021-05-05","fixed":"3.2.1","kev":false,"link":{"from":"CVE-2021-31542","to":"CVE-2021-32052","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"2.2.21","toFixed":"2.2.22","daysApart":1},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"3.1.9","toFixed":"3.1.10","daysApart":1}]}},{"cve":"CVE-2021-32052","published":"2021-05-06","fixed":"3.2.2","kev":false},{"cve":"CVE-2021-33203","published":"2021-06-08","fixed":"3.2.4","kev":false,"link":{"from":"CVE-2021-32052","to":"CVE-2021-33203","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"2.2.22","toFixed":"2.2.24","daysApart":33},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"3.1.10","toFixed":"3.1.12","daysApart":33}]}},{"cve":"CVE-2021-33571","published":"2021-06-08","fixed":"3.2.4","kev":false,"link":{"from":"CVE-2021-32052","to":"CVE-2021-33571","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"2.2.22","toFixed":"2.2.24","daysApart":33},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"3.1.10","toFixed":"3.1.12","daysApart":33},{"kind":"same-code","provenance":"machine","files":["django/core/validators.py"],"commits":["https://github.com/django/django/commit/e1e81aa1c4427411e3c68facdd761229ffea6f6f","https://github.com/django/django/commit/f27c38ab5d90f68c9dd60cabef248a570c0be8fc","https://github.com/django/django/commit/203d4ab9ebcd72fc4d6eb7398e66ed9e474e118e"],"basis":"shared file"}]}},{"cve":"CVE-2021-35042","published":"2021-07-02","fixed":"3.2.5","kev":false}],"package":"PyPI:Django"}}