Skip to main content

django-s3file CVE-2026-42196

CRITICAL
Relative Path Traversal (CWE-23)
2026-05-05 https://github.com/codingjoe/django-s3file GHSA-67qg-7284-2277
9.9
CVSS 4.0 · Vendor: https://github.com/codingjoe/django-s3file
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send HTTP POST to upload endpoint
  2. Delivery
    Inject path traversal in file parameter
  3. Exploit
    S3FileMiddleware loads arbitrary S3 object
  4. Execution
    Malicious file appears in request.FILES
  5. Persist
    Application processes file as legitimate upload
  6. Impact
    Confidential data exposed or integrity compromised

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Relative path traversal prevention
Exploitation Conditions

Exploitation requires that the target Django application uses S3FileMiddleware from django-s3file <=7.0.1 to process file uploads. Attacker must be able to send HTTP requests to endpoints using this middleware, which depends on application-specific access controls-if upload endpoints require authentication, attacker needs valid credentials; if publicly accessible (e.g., anonymous upload features), no authentication is needed. Attacker must have knowledge or ability to guess the S3 bucket structure and target file paths beyond the upload directory to construct effective traversal payloads. Impact is limited to files accessible via the S3 IAM role/credentials used by the Django application-attacker cannot traverse beyond bucket permissions. Vulnerability does not require non-default Django configurations, but exploitation success depends on how the application subsequently handles files loaded into request.FILES (automatic processing increases risk vs. manual admin review).

Impact

Real-world risk is MODERATE but highly context-dependent. Without CVSS metrics or EPSS scoring, assessment relies on vulnerability class analysis and vendor advisory. Path traversal (CWE-23) typically enables unauthorized file access, but actual impact depends on three application-specific factors: (1) what data resides in the S3 bucket beyond upload directories, (2) how the Django application processes files loaded into request.FILES (read-only display vs. execution vs. database storage), and (3) whether authentication gates the vulnerable middleware. Confidentiality risk: attackers may retrieve sensitive files from S3 (credentials, backups, user data) if stored in the same bucket. Integrity risk: if application logic trusts file origins, malicious content from unexpected S3 paths could corrupt databases or trigger unsafe operations. LIMITING FACTORS: exploitation requires knowledge of S3 bucket structure and target file paths (not blind traversal), and impact is bounded by S3 IAM permissions and Django application logic. No evidence of public exploit code or active exploitation. Priority: MEDIUM for applications handling sensitive files in S3; LOWER for isolated upload-only implementations with read-only public content.

Exploit ScenarioDerived

An attacker identifies a Django application using django-s3file for handling file uploads to an S3 bucket containing both user uploads (s3://bucket/uploads/) and sensitive application data (s3://bucket/config/secrets.json). The attacker intercepts or crafts an HTTP request to the upload endpoint, modifying the file path parameter from 'uploads/user123/photo.jpg' to '../config/secrets.json'. The vulnerable S3FileMiddleware processes this manipulated path without proper canonicalization, retrieves secrets.json from S3, and populates it into request.FILES. The application's file processing logic then inadvertently exposes the secrets file content in the HTTP response or stores it in a publicly accessible location, resulting in credential disclosure.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 05, 2026

Path traversal in django-s3file's S3FileMiddleware allows attackers to manipulate HTTP requests and force Django applications to load arbitrary files from unintended S3 locations into request.FILES, bypassing pre-signed upload location restrictions. Affects all versions <=7.0.1. Vendor-confirmed vulnerability with patch released in version 7.0.2. No active exploitation confirmed (not in CISA KEV). CVSS metrics not available, but path traversal combined with file handling operations presents moderate confidentiality and integrity risk depending on application-specific file processing logic.

RemediationAI

Immediately upgrade django-s3file to version 7.0.2 or later using pip install --upgrade django-s3file==7.0.2 or updating requirements.txt and redeploying. Vendor advisory confirms version 7.0.2 contains the fix for path validation in S3FileMiddleware (https://github.com/codingjoe/django-s3file/security/advisories/GHSA-67qg-7284-2277). If immediate upgrade is not feasible, implement compensating controls: (1) add custom middleware before S3FileMiddleware to validate and sanitize file path parameters, rejecting requests containing '../', encoded traversal sequences, or paths resolving outside expected prefixes; (2) restrict S3 bucket IAM policies to enforce least-privilege access scoping uploaded objects to specific prefixes, limiting traversal impact; (3) implement additional application-layer validation on request.FILES to verify file origins match expected S3 keys before processing. Note that workarounds do not eliminate the vulnerability and may interfere with legitimate file upload workflows; upgrading remains the definitive remediation.

Affected Packages

pypi django-s3file fix: 7.0.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Django-s3file is a Python middleware library that facilitates direct S3 uploads in Django applications by handling pre-signed S3 URLs and populating request.FILES with uploaded content. The vulnerability resides in S3FileMiddleware's input validation logic, specifically CWE-23 (Relative Path Traversal). The middleware fails to properly sanitize or canonicalize file path parameters in HTTP requests before retrieving files from S3. Attackers can inject relative path sequences (likely '../' traversal patterns) to escape the intended pre-signed upload directory scope and reference arbitrary S3 objects within the bucket or accessible storage. This allows unauthorized file access outside the application's expected upload boundaries, violating the security contract of pre-signed URLs which should restrict uploads to specific object keys.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/codingjoe/django-s3file) PRIMARY 9.9 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N

Primary rating from Vendor (https://github.com/codingjoe/django-s3file) · only source for this CVE.

CVSS VectorVendor: https://github.com/codingjoe/django-s3file

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
May 12, 2026 - 22:22 NVD
9.9 (CRITICAL)

DescriptionCVE.org

Impact

S3FileMiddleware is vulnerable to relative path traversal attacks, where an attacker can use a modified request to escape pre-signed upload locations and have the Django application load files from random locations into request.FILES

Depending on how files are handled, this may lead to confidentiality and integrity issues.

Patches

Django-S3File urges all users to update to a patched version >=7.0.2.

Executive ViewAI

Why It Matters

django-s3file versions 7.0.1 and earlier contain a path traversal vulnerability in S3FileMiddleware that allows attackers to bypass upload location restrictions and force applications to load arbitrary files from unintended S3 locations, potentially exposing sensitive data or enabling malicious file injection into application workflows. Organizations using this library risk unauthorized file access and integrity compromise unless immediate patching is applied.

Business Impact: High
Compensating Controls

Vendor-released patch: django-s3file 7.0.2. Until patching: Implement restrictive S3 bucket policies that explicitly deny requests outside intended upload prefixes; add application-level path validation and normalization before file processing; monitor S3 access logs for anomalous file load patterns; disable S3FileMiddleware if not actively required and use alternative secure file handling mechanisms.

Threat Intelligence Overview

EPSS Score
0.1%
Top 77% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Affected Products (CPE)CVE.org

pkg:pip/django-s3file

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy