---
id: "CVE-2026-42196"
kind: "vulnerability"
aliases: ["CVE-2026-42196", "GHSA-67qg-7284-2277"]
title: "django-s3file is vulnerable to relative path traversal"
severity: "critical"
cvss: 9.9
epss: 0.00565
exploited: false
status: "open"
category: "package"
products: [{"name": "django-s3file", "fixed": ["7.0.2"], "affected": "<= 7.0.1", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-22", "cwe-23", "cwe-26", "django", "package", "python", "s3", "self-hosted"]
not_affected_if: ["not-using-django-s3file"]
published_at: "2026-05-05T20:05:49+00:00"
first_seen_at: "2026-10-27T16:25:42+00:00"
updated_at: "2026-10-27T16:33:07+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-67qg-7284-2277", "first_seen_at": "2026-10-27T16:25:42+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-42196", "first_seen_at": "2026-10-27T16:33:07+00:00"}]
---

# django-s3file is vulnerable to relative path traversal

django-s3file's S3FileMiddleware accepts a modified upload request whose path escapes the pre-signed upload location. The Django application then loads files from other locations on disk into request.FILES, which can expose or alter data depending on how the app handles uploads.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:django-s3file affected <= 7.0.1 fixed 7.0.2

## How to check

- Run `pip show django-s3file` and check whether the version is `7.0.1` or lower.
- Check whether the project uses `S3FileMiddleware` in `MIDDLEWARE` settings.
- Check whether application code reads from `request.FILES` for uploaded files that are then stored or processed.

## Fix

- Upgrade `django-s3file` to `7.0.2` or later.

## Timeline

- 2026-10-27T16:25:42+00:00 ghsa https://github.com/advisories/GHSA-67qg-7284-2277
- 2026-10-27T16:33:07+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-42196

## From the sources

django-s3file is a lightweight file upload input for Django and Amazon S3. Prior to 7.0.2, 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. This vulnerability is fixed in 7.0.2.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
