CVE-2021-3281
Django Directory Traversal via archive.extract
Reported by mitre · Published February 2, 2021
Django is fixed in 3.1.6, 3.0.12 and 2.2.18 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| Django | PyPI | 3.1.6, 3.0.12, 2.2.18 |
| django | djangoproject | 3.1.6, 3.0.12, 2.2.18 |
| python-django | Ubuntu:16.04:LTS | 1.8.7-1ubuntu5.14 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| n/a | n/a | * |
| arch | python-django | 0 |
| PyPI | Django | 2.2, 3.1, 3.0 |
| alpine | py3-django | 0 |
Timeline
- Feb 2, 2021 CVE Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Nov 21, 2025 PoC Published
- Mar 7, 2026 Distribution Patch (8 in total, the first dated here)
- Mar 7, 2026 Security Advisory (12 in total, the first dated here)
- Aug 1, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-3281
vulnetix vdb fixes CVE-2021-3281
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-3281/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_MISC
- x_refsource_CONFIRM
- FEDORA-2021-5329c680f7 vendor-advisoryx_refsource_FEDORA
- x_refsource_CONFIRM
- https://nvd.nist.gov/vuln/detail/CVE-2021-3281 advisory
- https://github.com/advisories/GHSA-fvgf-6h6h-3322 advisory
- https://github.com/django/django/commit/02e6592835b4559909aa3aaaf67988fef435f624 patch
- https://github.com/django/django/commit/05413afa8c18cdb978fcdf470e09f7a12b234a23 patch
- https://github.com/django/django/commit/21e7622dec1f8612c85c2fc37fe8efbfd3311e37 patch
- https://github.com/django/django/commit/52e409ed17287e9aabda847b6afe58be2fa9f86a patch
- https://docs.djangoproject.com/en/3.1/releases/3.0.12 url
- https://docs.djangoproject.com/en/3.1/releases/security url
- https://github.com/django/django url
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-9.yaml advisory
- https://groups.google.com/forum/#!forum/django-announce url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YF52FKEH5S2P5CM4X7IXSYG67YY2CDOO url
- https://security.netapp.com/advisory/ntap-20210226-0004 advisory
- https://www.djangoproject.com/weblog/2021/feb/01/security-releases url