Header injection possible in Django
Published 9 Jun 2021 · Updated 20 Sept 2024
Is your project on an affected django?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=2.2 <2.2.22
- Fixed in
- 2.2.22
pip install 'django>=2.2.22'- Affected
- >=3.1 <3.1.10
- Fixed in
- 3.1.10
pip install 'django>=3.1.10'- Affected
- >=3.2 <3.2.2
- Fixed in
- 3.2.2
pip install 'django>=3.2.2'Details
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.
Is GHSA-qm57-vhq3-3fwf in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected django, and gives you the command that fixes it.
More advisories for django
- HighCVE-2026-15307Django GeoDjango spatial lookups allow file writes and outbound requests through GDAL raster parsing · 4 Aug 2026
- MediumCVE-2026-15830Django GeoDjango vulnerable to denial of service through deeply nested geometry collections · 4 Aug 2026
- MediumCVE-2026-53878Django: DomainNameValidator permits newline characters that may enable HTTP header injection · 7 Jul 2026
- MediumCVE-2026-53877 Django: GDALRaster may over-read heap memory when constructed from bytes · 7 Jul 2026
- LowCVE-2026-48588Django: cache middleware may expose private responses when unrelated request cookies are present · 7 Jul 2026
- LowCVE-2026-8404Django: UpdateCacheMiddleware may disclose cached responses due to case-sensitive Cache-Control handling · 3 Jun 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-32052
- Linkgithub.com/django/django/commit/e1e81aa1c4427411e3c68facdd761229ffea6f6f
- Linkbugzilla.redhat.com/show_bug.cgi?id=1944801
- Linkdocs.djangoproject.com/en/3.2/releases/security
- Advisorygithub.com/advisories/GHSA-qm57-vhq3-3fwf
- Packagegithub.com/django/django
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-8.yaml
- Linkgroups.google.com/forum/#!forum/django-announce
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE
- Linksecurity.netapp.com/advisory/ntap-20210611-0002
- Linkwww.djangoproject.com/weblog/2021/may/06/security-releases
- Linkwww.openwall.com/lists/oss-security/2021/05/06/1
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.