Description
The is_safe_url function in utils/http.py in Django 1.4.x before 1.4.6, 1.5.x before 1.5.2, and 1.6 before beta 2 treats a URL's scheme as safe even if it is not HTTP or HTTPS, which might introduce cross-site scripting (XSS) or other vulnerabilities into Django applications that use this function, as demonstrated by "the login view in django.contrib.auth.views" and the javascript: scheme.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-django | 1.5.2-1 | — |
| Debian 13 | python-django | 1.5.2-1 | — |
| Debian 12 | python-django | 1.5.2-1 | — |
| Debian 7 | python-django | 1.4.5-1+deb7u1 | DSA-2740-1 |
| Debian 6.0 | python-django | 1.2.3-3+squeeze6 | DSA-2740-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat OpenStack 3 | Django14 +1 | 1.4.8-1.el6ost | RHSA-2013:1521 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | django | >= 1.4, < 1.4.6 | 1.4.6 | GHSA-9cwg-mhxf-hh59 |
| PyPI | django | >= 1.5, < 1.5.2 | 1.5.2 | GHSA-9cwg-mhxf-hh59 |
| PyPI | django | >= 1.4, < 1.4.6 · >= 1.5, < 1.5.2 | 1.4.6, 1.5.2 | PYSEC-2013-21 |
Advisories 2
- DSA-2740-1 python-django - cross-site scripting vulnerability Debian Security (DSA / DLA) · Mar 9, 2026
- RHSA-2013:1521 Red Hat Security Advisory: python-django security update Red Hat Security Advisories (RHSA) · Jan 14, 2026
References
- 61777 vdb-entry
- 1028915 vdb-entry
- openSUSE-SU-2013:1541 vendor-advisory
- https://github.com/django/django/commit/ec67af0bd609c412b76eaa4cc89968a2a8e5ad6a
- 54476 third-party-advisory
- RHSA-2013:1521 vendor-advisory
- [oss-security] 20130814 [CVE request] Django 1.4.6 security release mailing-list
- https://www.djangoproject.com/weblog/2013/aug/13/security-releases-issued
- django-issafeurl-xss(86437) vdb-entry
- https://github.com/django/django/commit/ae3535169af804352517b7fea94a42a1c9c4b762
- https://github.com/django/django/commit/1a274ccd6bc1afbdac80344c9b6e5810c1162b5f
- [oss-security] 20130819 Re: [CVE request] Django 1.4.6 security release mailing-list
- DSA-2740 vendor-advisory