Django cross-site scripting (XSS) attack via user-supplied redirect URLs
Published 14 May 2022 · Updated 18 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
- <1.4.20
- Fixed in
- 1.4.20
pip install 'django>=1.4.20'- Affected
- >=1.5 <1.6.11
- Fixed in
- 1.6.11
pip install 'django>=1.6.11'- Affected
- >=1.7 <1.7.7
- Fixed in
- 1.7.7
pip install 'django>=1.7.7'- Affected
- >=1.8a1 <1.8c1
- Fixed in
- 1.8c1
pip install 'django>=1.8c1'Details
The utils.http.is_safe_url function in Django before 1.4.20, 1.5.x, 1.6.x before 1.6.11, 1.7.x before 1.7.7, and 1.8.x before 1.8c1 does not properly validate URLs, which allows remote attackers to conduct cross-site scripting (XSS) attacks via a control character in a URL, as demonstrated by a \x08javascript: URL.
Is GHSA-7fq8-4pv5-5w5c 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-2015-2317
- Linkgithub.com/django/django/commit/2342693b31f740a422abf7267c53b4e7bc487c1b
- Linkgithub.com/django/django/commit/2a4113dbd532ce952308992633d802dc169a75f1
- Linkgithub.com/django/django/commit/5510f070711540aaa8d3707776cd77494e688ef9
- Linkgithub.com/django/django/commit/770427c2896a078925abfca2317486b284d22f04
- Packagegithub.com/django/django
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2015-9.yaml
- Linkweb.archive.org/web/20200228131706/http://www.securityfocus.com/bid/73319
- Linkwww.djangoproject.com/weblog/2015/mar/18/security-releases
- Linklists.fedoraproject.org/pipermail/package-announce/2015-April/155421.html
- Linklists.fedoraproject.org/pipermail/package-announce/2015-June/160263.html
- Linklists.opensuse.org/opensuse-updates/2015-04/msg00001.html
- Linklists.opensuse.org/opensuse-updates/2015-09/msg00035.html
- Linkubuntu.com/usn/usn-2539-1
- Linkwww.debian.org/security/2015/dsa-3204
- Linkwww.mandriva.com/security/advisories?name=MDVSA-2015:195
- Linkwww.oracle.com/technetwork/topics/security/bulletinapr2015-2511959.html
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.