What’s Vulnerable › Vulnerabilities
CVE-2021-32052: Header injection possible in Django
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2021-05-06 · updated 2026-06-17
- Weakness: CWE-79
Description
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.
Affected products
- Django: from 2.2 before 2.2.22; from 3.1 before 3.1.10; from 3.2 before 3.2.2 — fixed in 2.2.22, 3.1.10, 3.2.2
- Fedoraproject Fedora: 34
- Pypi Django: from 2.2 before 2.2.22; from 3.1 before 3.1.10; from 3.2 before 3.2.2; 2.2, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5 (+28) — fixed in 2.2.22, 3.1.10, 3.2.2
How to fix
Upgrade to a fixed version: Django 2.2.22, 3.1.10, 3.2.2; Pypi Django 2.2.22, 3.1.10, 3.2.2. Check the vendor advisory for mitigations.
References
- http://www.openwall.com/lists/oss-security/2021/05/06/1
- https://docs.djangoproject.com/en/3.2/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/
- https://security.netapp.com/advisory/ntap-20210611-0002/
- https://www.djangoproject.com/weblog/2021/may/06/security-releases/
- http://www.openwall.com/lists/oss-security/2021/05/06/1
- https://docs.djangoproject.com/en/3.2/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/
- https://security.netapp.com/advisory/ntap-20210611-0002/
- https://www.djangoproject.com/weblog/2021/may/06/security-releases/
Get alerted when CVE-2021-32052 or the next vulnerability affects your stack