CVE-2021-32052
Header injection possible in Django
Reported by mitre · Published May 6, 2021
django is fixed in 3.2.2, 3.1.10 and 2.2.22 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| django | PyPI | 3.2.2, 3.1.10, 2.2.22 |
| python-django | Arch Linux | 3.2.2-1 |
| django | Bitnami | 3.2.2, 3.1.10, 2.2.22 |
| python-django | Ubuntu:18.04:LTS | 1:1.11.11-1ubuntu1.17 |
| django | djangoproject | 3.2.2, 3.1.10, 2.2.22 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| arch | python-django | 0 |
| n/a | n/a | * |
| PyPI | Django | 2.2, 3.1, 3.2 |
Timeline
- May 6, 2021 CVE Published
- May 7, 2021 EPSS Score (30 in total, the first dated here)
- Jun 9, 2023 PoC Published (42 in total, the first dated here)
- Mar 7, 2026 Distribution Patch (5 in total, the first dated here)
- Mar 7, 2026 Security Advisory (12 in total, the first dated here)
- Aug 1, 2026 Coalition ESS Score
- Sep 20, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-32052
vulnetix vdb fixes CVE-2021-32052
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-32052/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_MISC
- x_refsource_MISC
- x_refsource_MISC
- FEDORA-2021-01044b8a59 vendor-advisoryx_refsource_FEDORA
- x_refsource_CONFIRM
- https://nvd.nist.gov/vuln/detail/CVE-2021-32052 advisory
- https://github.com/advisories/GHSA-qm57-vhq3-3fwf advisory
- https://github.com/django/django/commit/e1e81aa1c4427411e3c68facdd761229ffea6f6f patch
- https://bugzilla.redhat.com/show_bug.cgi?id=1944801 url
- https://docs.djangoproject.com/en/3.2/releases/security url
- https://github.com/django/django url
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-8.yaml advisory
- https://groups.google.com/forum/#!forum/django-announce url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE url
- https://security.netapp.com/advisory/ntap-20210611-0002 advisory
- https://www.djangoproject.com/weblog/2021/may/06/security-releases url