Skip to content
OpenAdvisories
Medium · 6.1 CVE-2021-32052 BIT-django-2021-32052EUVD-2021-0065GHSA-qm57-vhq3-3fwfPYSEC-2021-8

Header injection possible in Django

Published May 6, 2021 · Updated Aug 3, 2024 · Assigned by mitre

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.

ReleasePackageFixed inAdvisory
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 —
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
SUSE Package Hub 15 SP3 python-Django 2.2.28-bp153.2.3.1 openSUSE-SU-2023:0005-1
ReleasePackageFixed inAdvisory
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

EcosystemPackageAffectedFixedRecord
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

References