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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2023-31047

CVE-2023-31047: Django File Upload Bypass Vulnerability

CVE-2023-31047 is a file upload validation bypass flaw in Django that allows attackers to upload files without proper validation. This article covers the technical details, affected versions, security impact, and mitigation.

Published: January 28, 2026

CVE-2023-31047 Overview

CVE-2023-31047 is an input validation vulnerability affecting Django web framework versions 3.2 before 3.2.19, 4.x before 4.1.9, and 4.2 before 4.2.1. The vulnerability enables attackers to bypass file validation when using a single form field to upload multiple files. While forms.FileField and forms.ImageField never officially supported multiple file uploads (only validating the last uploaded file), Django's documentation on "Uploading multiple files" incorrectly suggested this functionality was supported, creating a security gap that could be exploited.

Critical Impact

Attackers can bypass file type and content validation by uploading multiple files through a single form field, potentially uploading malicious files such as web shells or malware while only the last file is validated.

Affected Products

  • Django 3.2 before 3.2.19
  • Django 4.x before 4.1.9
  • Django 4.2 before 4.2.1 (including beta and release candidate versions)
  • Fedora 38 (bundled Django packages)

Discovery Timeline

  • 2023-05-03 - Django Project releases security patches
  • 2023-05-07 - CVE-2023-31047 published to NVD
  • 2025-01-29 - Last updated in NVD database

Technical Details for CVE-2023-31047

Vulnerability Analysis

This vulnerability stems from a fundamental design limitation in Django's file upload handling combined with misleading documentation. When a form field is configured to accept multiple file uploads using the HTML5 multiple attribute, Django's forms.FileField and forms.ImageField classes only process and validate the last file in the upload sequence. This creates a dangerous scenario where an attacker can submit multiple files, with malicious content in the earlier files and a benign file last, effectively bypassing all file validation checks.

The vulnerability is classified under CWE-20 (Improper Input Validation) and CWE-862 (Missing Authorization), reflecting both the input handling deficiency and the lack of proper access controls on file uploads.

Root Cause

The root cause lies in the architectural design of Django's file form fields. The forms.FileField and forms.ImageField classes were never designed to handle multiple file uploads, yet the framework's documentation provided examples suggesting this functionality was supported. When multiple files are submitted to a single field, the validation logic only examines the final file in the upload request, leaving all preceding files unvalidated. This disconnect between documented behavior and actual implementation creates an exploitable validation gap.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can craft a malicious HTTP POST request containing multiple files in a single form field. By placing a malicious file (such as a PHP web shell, executable, or specially crafted image containing embedded code) before a benign file that passes validation, the attacker can bypass Django's file validation entirely.

The exploitation mechanism involves:

  1. Identifying a Django application with a file upload form using FileField or ImageField
  2. Crafting a multipart form request with multiple files in the same field
  3. Placing malicious content in all files except the last one
  4. Submitting the request where only the final benign file is validated
  5. The malicious files may be saved to the server without validation

Detection Methods for CVE-2023-31047

Indicators of Compromise

  • Unexpected file types present in upload directories that don't match allowed extensions
  • Multiple files uploaded in short succession from the same source with only one matching validation rules
  • Web shells or executable files in directories intended for images or documents
  • Anomalous HTTP POST requests with unusually large multipart form data containing multiple file attachments

Detection Strategies

  • Monitor web server logs for multipart form requests with multiple Content-Disposition: form-data; filename= entries for the same field name
  • Implement file integrity monitoring on upload directories to detect unexpected file types
  • Deploy web application firewalls (WAF) with rules to inspect multipart form submissions for multiple file uploads to single fields
  • Review Django application logs for file upload events and correlate with actual files stored on disk

Monitoring Recommendations

  • Enable verbose logging for file upload handlers in Django applications
  • Configure alerts for file uploads that don't match expected MIME types in upload directories
  • Implement periodic scanning of upload directories for known malicious file signatures
  • Monitor for unusual file access patterns or execution attempts in upload directories

How to Mitigate CVE-2023-31047

Immediate Actions Required

  • Upgrade Django to version 3.2.19, 4.1.9, or 4.2.1 or later immediately
  • Review all file upload implementations in your Django applications for potential exploitation
  • Scan upload directories for suspicious files that may have been uploaded before patching
  • Implement additional server-side file validation independent of Django's form validation

Patch Information

Django Project has released security patches addressing this vulnerability. The fixes are available in Django versions 3.2.19, 4.1.9, and 4.2.1. Organizations should upgrade to these versions or later as soon as possible. For detailed patch information, refer to the Django Security Release Notes and the Django Weblog Security Release announcement.

Fedora users should apply the updated Django packages as announced through the Fedora Package Announcements.

Workarounds

  • Remove the multiple attribute from file input fields if multiple file uploads are not explicitly required
  • Implement custom form field validation that iterates through all uploaded files rather than only the last
  • Add server-side validation logic outside of Django's form handling to validate all files in the request
  • Use allowlist-based file type checking at the web server level in addition to Django validation
  • Consider implementing a separate file scanning service that validates all uploaded content before storage
bash
# Upgrade Django to patched version
pip install --upgrade Django>=3.2.19

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

# For production environments, update requirements.txt
echo "Django>=4.2.1" >> requirements.txt
pip install -r requirements.txt

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

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechDjangoproject

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-20

  • CWE-862
  • Technical References
  • Django Announcement Forum

  • Fedora Package Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory
  • Vendor Resources
  • Django Security Release Notes

  • Django Weblog Security Release
  • Latest CVEs
  • CVE-2026-40322: SiYuan Knowledge Management RCE Vulnerability

  • CVE-2026-40318: SiYuan Path Traversal Vulnerability

  • CVE-2026-40259: SiYuan Auth Bypass Vulnerability

  • CVE-2026-40255: AdonisJS HTTP Server CSRF Vulnerability
Default Legacy - Prefooter | 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