The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-45452

CVE-2021-45452: Django Path Traversal Vulnerability

CVE-2021-45452 is a path traversal vulnerability in Django that allows directory traversal through crafted filenames in Storage.save. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-45452 Overview

CVE-2021-45452 is a directory traversal vulnerability in Django's Storage.save function that allows attackers to write files outside of intended directories when crafted filenames are directly passed to the function. This vulnerability affects Django versions 2.2 before 2.2.26, 3.2 before 3.2.11, and 4.0 before 4.0.1.

The flaw exists because the Storage.save method does not adequately sanitize filenames containing path traversal sequences, enabling attackers to potentially read sensitive files or write malicious content to arbitrary locations on the filesystem.

Critical Impact

Attackers can exploit this vulnerability to traverse directories and potentially access or overwrite sensitive files on servers running vulnerable Django versions, leading to information disclosure or system compromise.

Affected Products

  • Django 2.2 before 2.2.26
  • Django 3.2 before 3.2.11
  • Django 4.0 before 4.0.1
  • Fedora 35

Discovery Timeline

  • January 4, 2022 - Django Project releases security patches
  • January 5, 2022 - CVE-2021-45452 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2021-45452

Vulnerability Analysis

This directory traversal vulnerability (CWE-22) resides in Django's file storage system, specifically within the Storage.save method. The vulnerability is exploitable over the network without requiring authentication or user interaction. When an application passes user-controlled filenames directly to Storage.save, an attacker can craft filenames containing directory traversal sequences (such as ../) to escape the intended storage directory.

The impact is primarily focused on confidentiality, as attackers may be able to read files outside the expected directory scope. In certain configurations, this could also enable writing files to sensitive locations, depending on how the application implements file storage operations.

Root Cause

The root cause of CVE-2021-45452 is insufficient input validation in Django's Storage.save function. The method fails to properly sanitize or validate filename inputs before processing them, allowing path traversal characters to be interpreted literally. This enables attackers to navigate the filesystem hierarchy by including sequences like ../ in uploaded filenames or file references.

Attack Vector

The attack vector requires the target application to directly pass user-supplied or externally-controlled filenames to the Storage.save method without proper sanitization. An attacker can exploit this by:

  1. Identifying an endpoint or functionality that accepts filenames and passes them to Django's storage system
  2. Crafting a malicious filename containing directory traversal sequences (e.g., ../../../etc/passwd)
  3. Submitting the crafted filename through the vulnerable application feature
  4. The Storage.save function processes the path traversal sequence, allowing access to files outside the intended directory

The vulnerability is accessible over the network and does not require authentication, though exploitation depends on how the application handles file storage operations. Applications that sanitize filenames before passing them to Storage.save are not affected.

Detection Methods for CVE-2021-45452

Indicators of Compromise

  • Presence of directory traversal sequences (../, ..\\) in application logs related to file operations
  • Unexpected file access or creation attempts outside designated storage directories
  • HTTP requests containing encoded path traversal patterns (e.g., %2e%2e%2f, ..%c0%af)
  • Anomalous file system activity in sensitive directories such as /etc/ or configuration folders

Detection Strategies

  • Implement log monitoring to identify file operation requests containing path traversal sequences
  • Deploy Web Application Firewall (WAF) rules to detect and block directory traversal patterns in request parameters
  • Review Django application code for instances where user input is passed directly to Storage.save without sanitization
  • Use static application security testing (SAST) tools to identify vulnerable code patterns in Django projects

Monitoring Recommendations

  • Enable detailed logging for Django file storage operations and monitor for suspicious filename patterns
  • Configure intrusion detection systems (IDS) to alert on directory traversal signatures in HTTP traffic
  • Establish baseline file system activity and alert on deviations, particularly in storage directories
  • Monitor for access attempts to sensitive files such as /etc/passwd, configuration files, or application secrets

How to Mitigate CVE-2021-45452

Immediate Actions Required

  • Upgrade Django to version 2.2.26, 3.2.11, 4.0.1, or later immediately
  • Audit application code to identify any locations where user-controlled filenames are passed to Storage.save
  • Implement input validation to sanitize filenames before storage operations
  • Review file upload functionality and ensure proper filename handling is in place

Patch Information

Django has released security patches addressing this vulnerability. Organizations should upgrade to the following versions or later:

  • Django 2.2.26 for the 2.2 LTS branch
  • Django 3.2.11 for the 3.2 LTS branch
  • Django 4.0.1 for the 4.0 branch

Detailed information about the security release is available in the Django Weblog Security Releases announcement. The Django Security Release Notes provide additional context on this and related vulnerabilities.

Workarounds

  • Implement application-level filename sanitization to strip or reject path traversal sequences before passing to Storage.save
  • Use Django's get_valid_filename() utility to normalize user-supplied filenames
  • Restrict file storage operations to designated directories using filesystem permissions
  • Consider using UUID-based or hashed filenames instead of user-supplied names for stored files
bash
# Upgrade Django to patched version
pip install --upgrade Django>=4.0.1

# Verify installed Django version
python -c "import django; print(django.VERSION)"

# For Django 2.2 LTS users
pip install "Django>=2.2.26,<3.0"

# For Django 3.2 LTS users
pip install "Django>=3.2.11,<4.0"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechDjango

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.27%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • Django Announcements Forum

  • Fedora Package Announcement

  • NetApp Security Advisory NTAP-20220121-0005
  • Vendor Resources
  • Django Security Release Notes

  • Django Weblog Security Releases
  • Related CVEs
  • CVE-2026-25674: Django Race Condition Vulnerability

  • CVE-2026-1287: Django FilteredRelation SQLi Vulnerability

  • CVE-2025-14550: Django ASGIRequest DOS Vulnerability

  • CVE-2026-1285: Djangoproject Django DoS Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English