CVE-2026-42196: Django s3file Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-67qg-7284-2277
CWE-26 CWE-23 CWE-22
Published
Advisory Summary

CVE-2026-42196 is a CRITICAL path traversal vulnerability (CWE-26: Path Traversal: '/dir/../filename') affecting Django s3file libraries in the PyPI ecosystem. The issue involves django-s3file is vulnerable to relative path traversal. Remediation is available by upgrading affected packages to version 7.0.2.

CVE-2026-42196 at a Glance

CVE Identifier CVE-2026-42196
GHSA Identifier GHSA-67qg-7284-2277
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-26: Path Traversal: '/dir/../filename'
Affected Product Django s3file
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-42196

To remediate this vulnerability, upgrade all affected Django s3file dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

django-s3file fixed: 7.0.2
pip install django-s3file>=7.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show django-s3file

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-42196, inspect your installed packages using pip:

pip show django-s3file

Analyze the terminal output to locate any version of Django s3file in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.2), your application is affected.

Note: The pip show django-s3file command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-26: Path Traversal: '/dir/../filename', where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "/dir/../filename" sequences that can resolve to a location that is outside of that directory. In Django s3file, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-42196 Affected Django s3file Versions

1 component(s)
Fixed Versions:
7.0.2
Product / Package Ecosystem Affected Versions Fixed Version
django-s3file
PyPI
< 7.0.2
7.0.2

References

Frequently Asked Questions

What is CVE-2026-42196?
CVE-2026-42196 is a security vulnerability in Django s3file involving django-s3file is vulnerable to relative path traversal under CWE-26: Path Traversal: '/dir/../filename'.
Which Django s3file versions are affected?
Affected versions include releases prior to 7.0.2 across affected packages: django-s3file.
What version fixes CVE-2026-42196?
Upgrading to 7.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is django-s3file affected?
Yes, django-s3file is affected in releases prior to 7.0.2. Upgrade your dependency to 7.0.2 or later.
What CWE is associated with CVE-2026-42196?
CVE-2026-42196 is classified under CWE-26: Path Traversal: '/dir/../filename' (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "/dir/../filename" sequences that can resolve to a location that is outside of that directory.).
How can I check PyPI dependencies for CVE-2026-42196?
Run the dependency tree command: 'pip show django-s3file'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-67qg-7284-2277",
  "modified" : "2026-05-13T16:31:46Z",
  "published" : "2026-05-05T20:05:49Z",
  "aliases" : [ "CVE-2026-42196" ],
  "summary" : "django-s3file is vulnerable to relative path traversal",
  "details" : "### Impact\n`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`\n\nDepending on how files are handled, this may lead to confidentiality and integrity issues.\n\n### Patches\nDjango-S3File urges all users to update to a patched version >=7.0.2.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "django-s3file"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.0.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/codingjoe/django-s3file/security/advisories/GHSA-67qg-7284-2277"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42196"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/codingjoe/django-s3file"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-23", "CWE-26" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T20:05:49Z",
    "nvd_published_at" : "2026-05-12T22:16:34Z"
  }
}