CVE-2021-31542Djangoproject Django
High 7.5 No auth needed
Follow: this CVE · Djangoproject · Djangoproject Django We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- 4.7% probability of exploitation in 30 days · percentile 93
- Auth required
- No
- Published
- May 5, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-22
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
What happens
In Django 2.2 before 2.2.21, 3.1 before 3.1.9, and 3.2 before 3.2.1, MultiPartParser, UploadedFile, and FieldFile allowed directory traversal via uploaded files with suitably crafted file names.
What to do
- Apply the vendor's security update for Django.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | django |
≥ 2.2 < 2.2.21 |
2.2.21 |
pip install "django>=2.2.21" |
| PyPI | django |
≥ 3.0 < 3.1.9 |
3.1.9 |
pip install "django>=3.1.9" |
| PyPI | django |
≥ 3.2 < 3.2.1 |
3.2.1 |
pip install "django>=3.2.1" |
| PyPI | django |
≥ 2.2 < 2.2.21 |
2.2.21 |
pip install "django>=2.2.21" |
| PyPI | django |
≥ 3.1 < 3.1.9 |
3.1.9 |
pip install "django>=3.1.9" |
| PyPI | django |
≥ 3.2 < 3.2.1 |
3.2.1 |
pip install "django>=3.2.1" |
Per OSV / GitHub Advisories (GHSA-rxjp-mfm9-w4wr, PYSEC-2021-7). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| djangoproject | django | ≥ 2.2 < 2.2.21 |
| djangoproject | django | ≥ 3.1 < 3.1.9 |
| djangoproject | django | ≥ 3.2 < 3.2.1 |
| debian | debian_linux | 9.0 |
| fedoraproject | fedora | 34 |
| fedoraproject | fedora | 35 |
Official advisories
- python313-Django5-5.2.16-1.1 on GA media · SUSE · openSUSE-SU-2026:11270-1 · Jul 14, 2026 Critical
- python313-Django-5.2.16-1.1 on GA media · SUSE · openSUSE-SU-2026:11248-1 · Jul 10, 2026 Critical
- python313-Django4-4.2.30-4.1 on GA media · SUSE · openSUSE-SU-2026:11235-1 · Jul 9, 2026 Critical
Also: SUSE (+1)
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.
- www.openwall.com Mailing List Patch Third Party Advisory
- docs.djangoproject.com Patch Vendor Advisory
- github.com
- github.com
- github.com
- groups.google.com
- lists.debian.org Mailing List Third Party Advisory
- lists.fedoraproject.org
- lists.fedoraproject.org
- security.netapp.com Third Party Advisory
- www.djangoproject.com Release Notes Vendor Advisory