Description
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 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 | 2:2.2.22-1 | — |
| Debian 13 | python-django | 2:2.2.22-1 | — |
| Debian 12 | python-django | 2:2.2.22-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | python-django | 2:2.2.12-1ubuntu0.7 | USN-5373-1, USN-4975-1 |
| Ubuntu 18.04 LTS | python-django | 1:1.11.11-1ubuntu1.17 | USN-5373-1, USN-4975-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 16.04 LTS | python-django | 1.8.7-1ubuntu5.15+esm5 | USN-5373-2 |
| Ubuntu Pro 14.04 LTS | python-django | 1.6.11-0ubuntu1.3+esm5 | USN-5373-2 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE Package Hub 15 SP3 | python-Django | 2.2.28-bp153.2.3.1 | openSUSE-SU-2023:0005-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-Django | 3.2.7-2.3 | openSUSE-SU-2026:11248-1, openSUSE-SU-2024:13887-1, openSUSE-SU-2024:11205-1 |
| openSUSE Tumbleweed | python-Django4 | 4.2.14-1.1 | openSUSE-SU-2026:11235-1, openSUSE-SU-2024:14208-1 |
| openSUSE Tumbleweed | python-Django5 | 5.2.16-1.1 | openSUSE-SU-2026:11270-1 |
| openSUSE Tumbleweed | python-Django6 | 6.0-1.1 | openSUSE-SU-2026:10005-1 |
| openSUSE Leap 15.3 | python-Django | 2.2.28-bp153.2.3.1 | openSUSE-SU-2023:0005-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | django | >= 2.2, < 2.2.22 | 2.2.22 | GHSA-qm57-vhq3-3fwf |
| PyPI | django | >= 3.1, < 3.1.10 | 3.1.10 | GHSA-qm57-vhq3-3fwf |
| PyPI | django | >= 3.2, < 3.2.2 | 3.2.2 | GHSA-qm57-vhq3-3fwf |
| PyPI | django | >= 2.2, < 2.2.22 · >= 3.1, < 3.1.10 · >= 3.2, < 3.2.2 | 2.2.22, 3.1.10, 3.2.2 | PYSEC-2021-8 |
Advisories 11
- openSUSE-SU-2026:11270-1 python313-Django5-5.2.16-1.1 on GA media SUSE / openSUSE Security Updates · Jul 15, 2026
- openSUSE-SU-2026:11248-1 python313-Django-5.2.16-1.1 on GA media SUSE / openSUSE Security Updates · Jul 11, 2026
- openSUSE-SU-2026:11235-1 python313-Django4-4.2.30-4.1 on GA media SUSE / openSUSE Security Updates · Jul 10, 2026
- USN-5373-2 python-django vulnerabilities Ubuntu Security Notices (USN) · Jun 29, 2026
- openSUSE-SU-2026:10005-1 python312-Django6-6.0-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- USN-5373-1 python-django vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- USN-4975-1 python-django vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- openSUSE-SU-2024:11205-1 python36-Django-3.2.7-2.3 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:13887-1 python310-Django-4.2.11-2.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2023:0005-1 Security update for python-Django SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14208-1 python310-Django4-4.2.14-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://groups.google.com/forum/#%21forum/django-announce
- https://docs.djangoproject.com/en/3.2/releases/security/
- http://www.openwall.com/lists/oss-security/2021/05/06/1
- https://www.djangoproject.com/weblog/2021/may/06/security-releases/
- FEDORA-2021-01044b8a59 vendor-advisory
- https://security.netapp.com/advisory/ntap-20210611-0002/