CVE-2021-28658 Directory Traversal in Django

Medium 5.3 Published Updated

Attackers can exploit directory traversal in Django's MultiPartParser to read or modify files via crafted filenames, requiring an upgrade to secure versions.

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

What is CVE-2021-28658?

CVE-2021-28658 is a medium-severity path traversal vulnerability in Debian Debian Linux, published on 6 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In Django 2.2 before 2.2.20, 3.0 before 3.0.14, and 3.1 before 3.1.8, MultiPartParser allowed directory traversal via uploaded files with suitably crafted file names. Built-in upload handlers were not affected by this vulnerability.

Weakness: CWE-22

Which versions are affected by CVE-2021-28658?

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

PackageAffectedFixed in
django BitnamiFrom 2.2.02.2.20, 3.0.14, 3.1.8
django PyPIFrom 2.22.2.20, 3.0.14, 3.1.8
django PyPIFrom 2.2a12.2.20
django PyPIFrom 3.0a13.0.14
django PyPIFrom 3.1a13.1.8
Django PyPIFrom 2.2a12.2.20
2 more packages
Django PyPIFrom 3.0a13.0.14
Django PyPIFrom 3.1a13.1.8

Products include Debian Debian Linux, Djangoproject Django, Fedoraproject Fedora.

How do I fix CVE-2021-28658?

Upgrade django to a fixed version for your release line: 2.2.20, 3.0.14 or 3.1.8.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2021-28658 being exploited?

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

All Debian Debian Linux vulnerabilities

Sources

Also known as BIT-django-2021-28658, DEBIAN-CVE-2021-28658, DLA-2622-1, GHSA-xgxc-v2qg-chmh, PYSEC-2021-6, UBUNTU-CVE-2021-28658 and 1 more.

Is CVE-2021-28658 in your software?

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

Check your SBOMs for free