Arbitrary file upload in Django - CVE-2021-31542
Published: May 4, 2021
Vulnerability details
The vulnerability allows a remote attacker to compromise vulnerable system.
The vulnerability exists due to insufficient validation of file during file upload via the MultiPartParser, UploadedFile, and FieldFile methods. A remote attacker can upload a file with a specially crafted filename containing directory traversal characters and overwrite arbitrary files on the system.
Successful exploitation of the vulnerability may allow an attacker to compromise the affected system.
Affected software
Gentoo Linux
SUSE OpenStack Cloud
HPE Helion Openstack
SUSE OpenStack Cloud Crowbar
Ubuntu
Fedora
python-django (Ubuntu package)
python3-django (Ubuntu package)
python-Django
python-django20 (Red Hat package)
ruby2.1-rubygem-puma
ruby2.1-rubygem-puma-debuginfo
rubygem-puma-debugsource
python-django
ruby2.1-rubygem-redcarpet
ruby2.1-rubygem-redcarpet-debuginfo
rubygem-redcarpet-debugsource
python-django3
documentation-suse-openstack-cloud-supplement
documentation-hpe-helion-openstack-user
documentation-hpe-helion-openstack-security
documentation-hpe-helion-openstack-planning
documentation-hpe-helion-openstack-opsconsole
documentation-hpe-helion-openstack-operations
documentation-suse-openstack-cloud-user
documentation-suse-openstack-cloud-security
documentation-suse-openstack-cloud-planning
documentation-suse-openstack-cloud-opsconsole
documentation-suse-openstack-cloud-deployment
documentation-suse-openstack-cloud-upstream-admin
documentation-suse-openstack-cloud-upstream-user
documentation-suse-openstack-cloud-installation
documentation-suse-openstack-cloud-operations
documentation-hpe-helion-openstack-installation
dev-python/django
Red Hat OpenStack
How to mitigate CVE-2021-31542
python-django (Ubuntu package) - addressed in versions 1.6.11-0ubuntu1.3+esm3, 1.8.7-1ubuntu5.15+esm1, 1:1.11.11-1ubuntu1.13
python3-django (Ubuntu package) - addressed in versions 1.8.7-1ubuntu5.15+esm1, 1:1.11.11-1ubuntu1.13, 2:2.2.12-1ubuntu0.6, 2:2.2.16-1ubuntu0.4, 2:2.2.20-1ubuntu0.1
python-Django - update to 1.11.29-3.28.1
python-django20 (Red Hat package) - update to 2.0.13-16.el8ost.1
ruby2.1-rubygem-puma - update to 2.16.0-3.15.1
ruby2.1-rubygem-puma-debuginfo - update to 2.16.0-3.15.1
rubygem-puma-debugsource - update to 2.16.0-3.15.1
python-django - addressed in versions 3.1.9-1.fc34, 3.2.12-1.fc35, 4.0.2-1.fc36
ruby2.1-rubygem-redcarpet - update to 3.2.3-3.3.1
ruby2.1-rubygem-redcarpet-debuginfo - update to 3.2.3-3.3.1
rubygem-redcarpet-debugsource - update to 3.2.3-3.3.1
python-django3 - update to 3.2.15-1.fc38
documentation-suse-openstack-cloud-supplement - update to 8.20210806-1.35.1
documentation-hpe-helion-openstack-user - update to 8.20210806-1.35.1
documentation-hpe-helion-openstack-security - update to 8.20210806-1.35.1
documentation-hpe-helion-openstack-planning - update to 8.20210806-1.35.1
documentation-hpe-helion-openstack-opsconsole - update to 8.20210806-1.35.1
documentation-hpe-helion-openstack-operations - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-user - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-security - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-planning - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-opsconsole - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-deployment - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-upstream-admin - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-upstream-user - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-installation - update to 8.20210806-1.35.1
documentation-suse-openstack-cloud-operations - update to 8.20210806-1.35.1
documentation-hpe-helion-openstack-installation - update to 8.20210806-1.35.1
Red Hat OpenStack - update to 16.1
dev-python/django - update to 5.2.1
External References
Related Security Bulletins
- Insecure processing of uploaded files in Django
- SUSE update for ardana-ansible, ardana-monasca, documentation-suse-openstack-cloud, openstack-ec2-api, openstack-heat-templates, python-Django, python-monasca-common, rubygem-redcarpet, rubygem-puma
- Ubuntu update for python-django
- Ubuntu update for python-django
- Multiple vulnerabilities in Red Hat OpenStack 16.1 packages
- Fedora 34 update for python-django
- Fedora 36 update for python-django
- Fedora 35 update for python-django
- Fedora 38 update for python-django3
- Gentoo update for Django