CVE-2021-3281
Django vulnerability analysis and mitigation

Overview

CVE-2021-3281 is a directory traversal vulnerability discovered in Django versions 2.2 before 2.2.18, 3.0 before 3.0.12, and 3.1 before 3.1.6. The vulnerability was identified in the django.utils.archive.extract() method, which is used by the 'startapp --template' and 'startproject --template' commands. The issue was disclosed on February 1, 2021, and was reported by Wang Baohua (Django Security).

Technical details

The vulnerability exists in the django.utils.archive.extract() function where it fails to properly validate paths when extracting archives. The function allows directory traversal via archives containing absolute paths or relative paths with dot segments. This vulnerability has been assigned a CVSS v3.1 base score of 7.5 (HIGH) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N (NetApp Advisory).

Impact

Successful exploitation of this vulnerability could lead to disclosure of sensitive information through directory traversal attacks. The vulnerability allows attackers to potentially access files outside of the intended directory structure when using the template functionality in Django's project and app creation commands (NetApp Advisory).

Exploitability

The vulnerability can be exploited through the Django template functionality when creating new projects or applications. It requires an attacker to provide a maliciously crafted archive file containing absolute paths or relative paths with dot segments as a template (Django Security).

Mitigation and workarounds

The vulnerability has been patched in Django versions 2.2.18, 3.0.12, and 3.1.6. Users are strongly encouraged to upgrade to these versions or later to address the security issue. The Django security team has classified this as a 'low' severity issue but recommends all users upgrade as soon as possible (Django Security).

Additional resources


SourceThis report was generated using AI

Related Django vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-53877MEDIUM6.3
  • Django logoDjango
  • py3-django
NoYesJul 07, 2026
CVE-2026-53878MEDIUM5.3
  • Django logoDjango
  • python-django
NoYesJul 07, 2026
CVE-2026-48588LOW2.3
  • Django logoDjango
  • python3-django5
NoYesJul 07, 2026
CVE-2026-8404LOW2.3
  • Django logoDjango
  • openstack-horizon-2026.1-fips
NoYesJun 03, 2026
CVE-2026-7666LOW2.3
  • Django logoDjango
  • python3-django5-bash-completion
NoYesJun 03, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management