# CVE-2021-31542: Path Traversal in Django

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 4.73%, higher than 92% of CVEs (2026-12-01)
- Published: 2021-05-05T00:00:00.000Z
- Modified: 2026-09-08T08:46:24.848Z
- Also known as: GHSA-rxjp-mfm9-w4wr, BIT-DJANGO-2021-31542, PYSEC-2021-7
- Weaknesses: CWE-22, CWE-434
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- django (PyPI): from 2.2 before 2.2.21; from 3.0 before 3.1.9; from 3.2 before 3.2.1; from 3.1 before 3.1.9
- djangoproject django: from 2.2 before 2.2.21; from 3.1 before 3.1.9; from 3.2 before 3.2.1
- debian debian_linux: 9.0
- fedoraproject fedora: 34; 35
- django (Bitnami): from 2.2.0 before 2.2.21; from 3.1.0 before 3.1.9; from 3.2.0 before 3.2.1

## Every score

- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:P/I:N/A:N`
- Bitnami Vulnerability Database: rating High

## References

- <https://groups.google.com/forum/#%21forum/django-announce> (web)
- <https://docs.djangoproject.com/en/3.2/releases/security/> (advisory, patch, vendor-advisory, web)
- <http://www.openwall.com/lists/oss-security/2021/05/04/3> (advisory, mailing-list, patch, third-party-advisory, web)
- <https://www.djangoproject.com/weblog/2021/may/04/security-releases/> (advisory, article, release-notes, vendor-advisory)
- <https://lists.debian.org/debian-lts-announce/2021/05/msg00005.html> (advisory, mailing-list, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/> (vendor-advisory, web)
- <https://security.netapp.com/advisory/ntap-20210618-0001/> (advisory, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV/> (vendor-advisory, web)
- <https://github.com/django/django/commit/04ac1624bdc2fa737188401757cf95ced122d26d> (web)
- <https://github.com/django/django/commit/25d84d64122c15050a0ee739e859f22ddab5ac48> (web)
- <https://github.com/django/django/commit/c98f446c188596d4ba6de71d1b77b4a6c5c2a007> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-31542> (advisory, web)
- <https://www.djangoproject.com/weblog/2021/may/04/security-releases> (web)
- <https://security.netapp.com/advisory/ntap-20210618-0001> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV> (web)
- <https://groups.google.com/forum/#!forum/django-announce> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-7.yaml> (web)
- <https://github.com/django/django> (package)
- <https://github.com/advisories/GHSA-rxjp-mfm9-w4wr> (advisory)
- <https://docs.djangoproject.com/en/3.2/releases/security> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/> (web)

## Sources

- CVE List: [CVE-2021-31542](https://www.cve.org/CVERecord?id=CVE-2021-31542), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-rxjp-mfm9-w4wr](https://github.com/advisories/GHSA-rxjp-mfm9-w4wr), CC-BY-4.0, modified 2024-09-20
- NVD: [CVE-2021-31542](https://nvd.nist.gov/vuln/detail/CVE-2021-31542), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-7](https://osv.dev/vulnerability/PYSEC-2021-7), CC-BY-4.0, modified 2023-12-06
- Bitnami Vulnerability Database: [BIT-DJANGO-2021-31542](https://osv.dev/vulnerability/BIT-DJANGO-2021-31542), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-31542 · Whole record: https://cve.day/CVE-2021-31542.json · Rebuilt by cve.day 2026-11-25T22:58:01.141Z
