CVE-2021-31542 json
Path Traversal in Django
published 2021-05-05 5 y ago modified 2026-09-08 2 mo ago also BIT-django-2021-31542 , EUVD-2021-0064 , GHSA-rxjp-mfm9-w4wr , PYSEC-2021-7
- cvss
- 7.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 5.3%
- EPSS 5.3% chance of exploitation in 30 days, percentile 92%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi django 2.2.21, 3.1.9, 3.2.1
- bitnami django 2.2.21, 3.1.9, 3.2.1
- djangoproject django 2.2.21, 3.1.9, 3.2.1
- python-django Debian 14, Debian 13, Debian 12 2:2.2.21-1
debian advisories DEBIAN-CVE-2021-31542
- python-django Ubuntu 18.04 LTS 1:1.11.11-1ubuntu1.13
- python-django Ubuntu 20.04 LTS 2:2.2.12-1ubuntu0.6
- python-django Ubuntu Pro 14.04 LTS 1.6.11-0ubuntu1.3+esm3
- python-django Ubuntu Pro 16.04 LTS 1.8.7-1ubuntu5.15+esm1
ubuntu advisories UBUNTU-CVE-2021-31542
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- foreman satellite capsule 6.10, satellite 6.10 2.5.2.17-2.el7sat
- candlepin satellite 6.10 4.0.9-1.el7sat
- satellite satellite capsule 6.10, satellite 6.10 6.10.0-3.el7sat
- python-ecdsa satellite capsule 6.10, satellite 6.10 0.13.3-2.el7pc
- python-pyyaml satellite capsule 6.10, satellite 6.10 5.4.1-1.el7pc
- python3-ecdsa satellite capsule 6.10, satellite 6.10 0.13.3-2.el7pc
- python-aiohttp satellite capsule 6.10, satellite 6.10 3.7.4-1.el7pc
- python-urllib3 satellite capsule 6.10, satellite 6.10 1.26.5-1.el7pc
red hat advisories RHSA-2021:4702RHSA-2021:5070
- kibana OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 4.6.6-3.9.2
- grafana OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 6.7.4-4.18.2
- cassandra OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 3.11.10-5.3.5
- python-py OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 1.4.34-3.3.3
- crowbar-core OpenStack Cloud Crowbar 8 5.0+git.1622489449.a8e60e238-3.50.4
- python-Django OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 1.11.29-3.25.3
- ardana-cobbler OpenStack Cloud 8, HPE Helion OpenStack 8 8.0+git.1614096566.e8c2b27-3.44.3
- openstack-nova OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 16.1.9~dev92-3.48.5
suse advisories SUSE-SU-2021:2554-1SUSE-SU-2021:1963-1SUSE-SU-2021:1962-1
- python-Django5 openSUSE Tumbleweed 5.2.16-1.1
- python-Django openSUSE Tumbleweed 5.2.16-1.1
- python-Django4 openSUSE Tumbleweed 4.2.30-4.1
- python-Django6 openSUSE Tumbleweed 6.0-1.1
- python-Django4 openSUSE Tumbleweed 4.2.14-1.1
- python-Django openSUSE Tumbleweed 3.2.7-2.3
- python-Django openSUSE Tumbleweed 4.2.11-2.1
opensuse advisories openSUSE-SU-2026:11270-1openSUSE-SU-2026:11248-1openSUSE-SU-2026:11235-1openSUSE-SU-2026:10005-1openSUSE-SU-2024:14208-1openSUSE-SU-2024:11205-1
- python-django Arch Linux 3.2.1-1
arch linux advisories AVG-1910
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-31542 updated cvss 7.5
django: Potential directory-traversal via uploaded files
-
Red Hat Ansible Automation Platform 1.2 django, python-djangoaffected: workaround, no fix available
-
Red Hat Ceph Storage 2 python-django, calamari-server, python-django-bash-completion Red Hat Ceph Storage 3 python-django, python-django-bash-completion Red Hat OpenStack Platform 10 (Newton) python-django, python-django-bash-completionaffected: workaround, no fix planned “Out of support scope”
-
Red Hat OpenStack Platform 13 (Queens) python-django, python2-django, python-django-bash-completion Red Hat Satellite 6 python-django, python2-django, python-django-bash-completion Red Hat Storage 3 python-django, python2-django, python-django-bash-completion Red Hat Update Infrastructure 3 for Cloud Providers python-djangoaffected: workaround, no fix planned “Will not fix”
-
Red Hat OpenStack Platform 16.1 python-django20 2.0.13-16.el8ost.1, python3-django20 2.0.13-16.el8ost.1, python-django20-bash-completion 2.0.13-16.el8ost.1fixed: vendor fix RHSA-2021:5070
-
Red Hat Satellite 6.10 python3-django 2.2.24-1.el7pc Red Hat Satellite Capsule 6.10 python3-django 2.2.24-1.el7pcfixed: vendor fix RHSA-2021:4702
-
Red Hat Ansible Tower 3 django Red Hat Satellite 6.10 tfm 7.0-1.el7sat, gofer 2.12.5-7.el7sat, katello 4.1.1-2.el7sat, libsolv 0.7.20-1.el7pc, receptor 0.6.4-2.el7ar, libcomps 0.1.15-1.el7pc, +581 more Red Hat Satellite Capsule 6.10 tfm 7.0-1.el7sat, katello 4.1.1-2.el7sat, libsolv 0.7.20-1.el7pc, libcomps 0.1.15-1.el7pc, python-rq 1.8.1-1.el7pc, python-idna 2.10-1.el7pc, +354 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
5.33% chance of exploitation in the next 30 days, higher than 92% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
| OSV | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | django | >=2.2, <2.2.21 >=3.0, <3.1.9 >=3.2, <3.2.1 >=3.1, <3.1.9 |
2.2.21 3.1.9 3.2.1 |
| bitnami | django | >=2.2.0, <2.2.21 >=3.1.0, <3.1.9 >=3.2.0, <3.2.1 |
2.2.21 3.1.9 3.2.1 |
Classification
- Weakness
- Technology feeds
References
-
github.com
/django/django/commit/04ac1624bdc2fa737188401757cf95ced122d26d
web
-
github.com
/django/django/commit/25d84d64122c15050a0ee739e859f22ddab5ac48
web
-
github.com
/django/django/commit/c98f446c188596d4ba6de71d1b77b4a6c5c2a007
web
-
docs.djangoproject.com
/en/3.2/releases/security/
patch, vendor-advisory, advisory, web
-
openwall.com
/lists/oss-security/2021/05/04/3
web, mailing-list, patch, third-party-advisory, advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV/
vendor-advisory, web
-
djangoproject.com
/weblog/2021/may/04/security-releases/
release-notes, vendor-advisory, advisory, article
-
groups.google.com
/forum/#%21forum/django-announce
web
-
lists.debian.org
/debian-lts-announce/2021/05/msg00005.html
mailing-list, web, third-party-advisory, advisory
-
security.netapp.com
/advisory/ntap-20210618-0001/
third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-31542
advisory, web
-
djangoproject.com
/weblog/2021/may/04/security-releases
web
-
security.netapp.com
/advisory/ntap-20210618-0001
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV
web
-
groups.google.com
/forum/#!forum/django-announce
web
-
github.com
/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-7.yaml
web
-
github.com
/django/django
package
-
github.com
/advisories/GHSA-rxjp-mfm9-w4wr
advisory
-
docs.djangoproject.com
/en/3.2/releases/security
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/
web
Sources
- CVE List CVE-2021-31542
- GitHub Advisory GHSA-rxjp-mfm9-w4wr
- NVD CVE-2021-31542
- OSV BIT-django-2021-31542
- OSV PYSEC-2021-7
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.