Django open redirect and possible XSS attack via user-supplied numeric redirect URLs
Published 4 Jan 2019 · 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.10a1 <1.10.7
- Fixed in
- 1.10.7
pip install 'django>=1.10.7'- Affected
- >=1.9a1 <1.9.13
- Fixed in
- 1.9.13
pip install 'django>=1.9.13'- Affected
- >=1.8a1 <1.8.18
- Fixed in
- 1.8.18
pip install 'django>=1.8.18'Details
Django 1.10 before 1.10.7, 1.9 before 1.9.13, and 1.8 before 1.8.18 relies on user input in some cases to redirect the user to an "on success" URL. The security check for these redirects (namely `django.utils.http.is_safe_url()) considered some numeric URLs "safe" when they shouldn't be, aka an open redirect vulnerability. Also, if a developer relies on is_safe_url()` to provide safe redirect targets and puts such a URL into a link, they could suffer from an XSS attack.
Is GHSA-37hp-765x-j95x 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-2017-7233
- Linkgithub.com/django/django/commit/254326cb3682389f55f886804d2c43f7b9f23e4f
- Linkgithub.com/django/django/commit/8339277518c7d8ec280070a780915304654e3b66
- Linkgithub.com/django/django/commit/f824655bc2c50b19d2f202d7640785caabc82787
- Linkaccess.redhat.com/errata/RHSA-2017:1445
- Linkaccess.redhat.com/errata/RHSA-2017:1451
- Linkaccess.redhat.com/errata/RHSA-2017:1462
- Linkaccess.redhat.com/errata/RHSA-2017:1470
- Linkaccess.redhat.com/errata/RHSA-2017:1596
- Linkaccess.redhat.com/errata/RHSA-2017:3093
- Linkaccess.redhat.com/errata/RHSA-2018:2927
- Advisorygithub.com/advisories/GHSA-37hp-765x-j95x
- Packagegithub.com/django/django
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2017-9.yaml
- Linkwww.djangoproject.com/weblog/2017/apr/04/security-releases
- Linkwww.debian.org/security/2017/dsa-3835
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.