CVE-2021-32052 Header injection possible in Django

Medium 6.1 Published Updated

Header injection possible in Django applications using URLValidator with newlines in HTTP responses, requiring specific application logic to exploit.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-32052?

CVE-2021-32052 is a medium-severity vulnerability in Djangoproject Django, published on 6 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-79

Which versions are affected by CVE-2021-32052?

8 open source packages ship an affected version, including django and Django. It affects 2 products.

PackageAffectedFixed in
django BitnamiFrom 2.2.02.2.22, 3.1.10, 3.2.2
django PyPIFrom 2.22.2.22, 3.1.10, 3.2.2
django PyPIFrom 2.22.2.22
django PyPIFrom 3.13.1.10
django PyPIFrom 3.23.2.2
Django PyPIFrom 2.22.2.22
2 more packages
Django PyPIFrom 3.13.1.10
Django PyPIFrom 3.23.2.2

Products include Djangoproject Django, Fedoraproject Fedora.

How do I fix CVE-2021-32052?

Upgrade django to a fixed version for your release line: 2.2.22, 3.1.10 or 3.2.2.

Is CVE-2021-32052 being exploited?

There is no known exploitation of CVE-2021-32052 in the wild and no public exploit code.

All Djangoproject Django vulnerabilities

Sources

Also known as BIT-django-2021-32052, DEBIAN-CVE-2021-32052, GHSA-qm57-vhq3-3fwf, PYSEC-2021-8, UBUNTU-CVE-2021-32052.

Is CVE-2021-32052 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free