cve.bz

CVE-2021-3281 Path traversal

5.3 mediumEPSS 7.6%Fix available

Medium (5.3). EPSS 7.6% estimated probability of exploitation activity in the next 30 days. Fixed in django 2.2.18, 3.0.12, 3.1.6.

On this page
In Django 2.2 before 2.2.18, 3.0 before 3.0.12, and 3.1 before 3.1.6, the django.utils.archive.extract method (used by "startapp --template" and "startproject --template") allows directory traversal via an archive with absolute paths or relative paths with dot segments.

Severity

CVSS 3.1

5.3 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
EPSS
7.6% (unchanged from 7.6% a week ago; 7.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 95th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-3281 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-3281?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-3281?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-3281 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
djangoproject:djangofrom 2.2 before 2.2.18
djangoproject:djangofrom 3.0 before 3.0.12
djangoproject:djangofrom 3.1 before 3.1.6
fedoraproject:fedora33

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-fvgf-6h6h-3322PyPIdjango>=2.2 <2.2.182.2.18
GHSA-fvgf-6h6h-3322PyPIdjango>=3.1 <3.1.63.1.6
GHSA-fvgf-6h6h-3322PyPIdjango>=3.0 <3.0.123.0.12
PYSEC-2021-9PyPIdjango>=2.2 <2.2.18
>=3.0 <3.0.12
>=3.1 <3.1.6
2.2.18, 3.0.12, 3.1.6

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9python-django1:1.10.7-2+deb9u10DLA-2540-1
Debian10python-django1:1.11.29-1+deb10u2DLA-3164-1
Debian12, 13, 14python-django2:2.2.18-1DEBIAN-CVE-2021-3281
Ubuntu16.04:LTSpython-django1.8.7-1ubuntu5.14UBUNTU-CVE-2021-3281 USN-4715-1
Ubuntu18.04:LTSpython-django1:1.11.11-1ubuntu1.10UBUNTU-CVE-2021-3281 USN-4715-1
Ubuntu20.04:LTSpython-django2:2.2.12-1ubuntu0.3UBUNTU-CVE-2021-3281 USN-4715-1
UbuntuPro:14.04:LTSpython-django1.6.11-0ubuntu1.3+esm2UBUNTU-CVE-2021-3281 USN-4715-2
Red Hatansible_automation_platform:4.2::el7automation-hub, python-galaxy-ng, python3-galaxy-ng0:4.2.2-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-bleach, python3-bleach0:3.3.0-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-bleach-allowlist, python3-bleach-allowlist0:1.0.3-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-galaxy-importer, python3-galaxy-importer0:0.2.15-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-pulp-ansible, python3-pulp-ansible1:0.5.6-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python3-django0:2.2.18-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8automation-hub, python-galaxy-ng, python3-galaxy-ng0:4.2.2-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-bleach, python3-bleach0:3.3.0-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-bleach-allowlist, python3-bleach-allowlist0:1.0.3-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-galaxy-importer, python3-galaxy-importer0:0.2.15-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-pulp-ansible, python3-pulp-ansible1:0.5.6-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python3-django0:2.2.18-1.el8pcRHSA-2021:0781
2 more for Red Hat in the JSON and on Red Hat's page.
SUSEHPE Helion OpenStack 8release-notes-hpe-helion-openstack8.20201214-3.29.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8venv-openstack-horizon-hpe12.0.5~dev6-14.34.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-horizon8.0+git.1610733160.0f577f4-3.21.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-logging8.0+git.1610573640.452aed1-3.27.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-monasca8.0+git.1610740501.5dca121-3.27.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-mq8.0+git.1605176800.52cccfa-3.29.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-osconfig8.0+git.1610643571.91b88d6-3.52.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-neutron11.0.9~dev69-13.36.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-nova16.1.9~dev78-11.34.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8kibana4.6.3-3.6.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8openstack-neutron, openstack-neutron-doc11.0.9~dev69-3.40.1SUSE-RU-2021:0351-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8openstack-nova, openstack-nova-doc16.1.9~dev78-3.45.1SUSE-RU-2021:0351-1
35 more for SUSE in the JSON and on SUSE's page.
Alpinev3.13, v3.14, v3.15 and 9 morepy3-django3.1.6-r0ALPINE-CVE-2021-3281

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The following products ship affected version of python-django, however the vulnerable function archive.extract() is currently not used in any part of the product and hence this issue has been rated as having a security impact of Low:

* Red Hat Gluster Storage 3

* Red Hat Update Infrastructure 3

Because the flaw's impact is lower and Red Hat OpenStack Platform 13 will be retiring soon, no update will be provided at this time for the RHOSP13 python-django package.

ProductPackageStateAdvisory
Red Hat Ansible Tower 3.8 for RHEL 7ansible-tower-38/ansible-runner-rhel7:1.4.7-1Fixed 2021-03-09RHSA-2021:0780
Red Hat Ansible Tower 3.8 for RHEL 7ansible-tower-38/ansible-tower-rhel7:3.8.2-1Fixed 2021-03-09RHSA-2021:0780
Red Hat Automation Hub 4.2 for RHEL 7automation-hub-0:4.2.2-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python3-django-0:2.2.18-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-bleach-0:3.3.0-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-bleach-allowlist-0:1.0.3-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-galaxy-importer-0:0.2.15-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-galaxy-ng-0:4.2.2-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-pulp-ansible-1:0.5.6-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8automation-hub-0:4.2.2-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python3-django-0:2.2.18-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Ansible Automation Platform 1.2python-djangoAffected
Red Hat Ansible Tower 3djangoNot affected
Red Hat Ceph Storage 2python-djangoOut of support scope
Red Hat Ceph Storage 3python-djangoWill not fix
Red Hat OpenStack Platform 10 (Newton)python-djangoOut of support scope
Red Hat OpenStack Platform 13 (Queens)python-djangoWill not fix
Red Hat Satellite 6python-djangoAffected
Red Hat Storage 3python-djangoFix deferred
Red Hat Update Infrastructure 3 for Cloud Providerspython-djangoFix deferred
7 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-3281.

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON