CVE-2023-31047 Django bypasses validation when using one form field to upload multiple files

Critical 9.8 Published Updated

Attackers can bypass file upload validation by submitting multiple files, potentially uploading malicious content despite intended security checks.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-31047?

CVE-2023-31047 is a critical missing authorization vulnerability in Djangoproject Django, published on 7 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In Django 3.2 before 3.2.19, 4.x before 4.1.9, and 4.2 before 4.2.1, it was possible to bypass validation when using one form field to upload multiple files. This multiple upload has never been supported by forms.FileField or forms.ImageField (only the last uploaded file was validated). However, Django's "Uploading multiple files" documentation suggested otherwise.

Weakness: CWE-20, CWE-862

Which versions are affected by CVE-2023-31047?

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

PackageAffectedFixed in
django BitnamiFrom 3.2.0 to 4.2.03.2.19, 4.1.9
django PyPIFrom 3.23.2.19, 4.1.9, 4.2.1
django PyPIFrom 3.2a13.2.19
django PyPIFrom 4.0a14.1.9
django PyPIFrom 4.2a14.2.1
Django PyPIFrom 3.2a13.2.19
2 more packages
Django PyPIFrom 4.0a14.1.9
Django PyPIFrom 4.2a14.2.1
Linux distribution packages (1)
python-Django openSUSE:TumbleweedAll versions4.2.1-1.1

Products include Djangoproject Django, Fedoraproject Fedora.

How do I fix CVE-2023-31047?

Upgrade django to a fixed version for your release line: 3.2.19, 4.1.9 or 4.2.1.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2023-31047 being exploited?

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

All Djangoproject Django vulnerabilities

Sources

Also known as BIT-django-2023-31047, CLSA-2026-1786021276, DEBIAN-CVE-2023-31047, DLA-3415-1, GHSA-r3xc-prgr-mg9p, OESA-2023-1286 and 5 more.

Is CVE-2023-31047 in your software?

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

Check your SBOMs for free