CVE-2021-31542: Path Traversal

Published Apr 27, 2021
·
Updated

A flaw was found in django. MultiPartParser, UploadedFile, and FieldFile allowed directory-traversal via uploaded files with suitably crafted file names.

Other sources

A flaw was found in Django. MultiPartParser, UploadedFile, and FieldFile allowed directory-traversal via uploaded files with suitably crafted file names. The highest threat from this vulnerability is to data confidentiality.

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.

Affected Software

14 affected componentsFixes available
redhat/python-django20<0:2.0.13-16.el8
0:2.0.13-16.el8
redhat/python3-django<0:2.2.24-1.el7
0:2.2.24-1.el7
redhat/Django<3.2.1
3.2.1
redhat/Django<3.1.9
3.1.9
redhat/Django<2.2.21
2.2.21
pip/Django>=3.2<3.2.1
3.2.1
pip/Django>=3.0<3.1.9
3.1.9
pip/Django>=2.2<2.2.21
2.2.21
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

Remediation

Information

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

Event History

May 4, 2021
CVE Published
12:00 AM
May 5, 2021
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Jun 4, 2021
Advisory Published
via GitHub·09:15 PM

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-31542?

CVE-2021-31542 is a vulnerability found in Django 2.2 before 2.2.21, 3.1 before 3.1.9, and 3.2 before 3.2.1 that allows directory-traversal via uploaded files, potentially compromising data confidentiality.

2

How severe is CVE-2021-31542?

CVE-2021-31542 has a severity value of 7.5, which is considered high.

3

How can I fix CVE-2021-31542 in Django?

To fix CVE-2021-31542, make sure you upgrade Django to version 2.2.21, 3.1.9, or 3.2.1 depending on which version you are using.

4

Where can I find more information about CVE-2021-31542?

You can find more information about CVE-2021-31542 at the following references: [CVE Record](https://www.cve.org/CVERecord?id=CVE-2021-31542), [NVD](https://nvd.nist.gov/vuln/detail/CVE-2021-31542), [Django Security Releases](https://www.djangoproject.com/weblog/2021/may/04/security-releases/), [Red Hat Bugzilla](https://bugzilla.redhat.com/show_bug.cgi?id=1954294), [Red Hat Advisory](https://access.redhat.com/errata/RHSA-2021:5070).

5

What is the Common Weakness Enumeration (CWE) associated with CVE-2021-31542?

The Common Weakness Enumeration (CWE) associated with CVE-2021-31542 are CWE-22 and CWE-434.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203