Vulnerabilities in pkg:pypi/django-sendfile2

PACKAGE
Advisory Summary

GHSA-pcjh-6r5h-r92r is a HIGH django-sendfile2 before 0.7.0 contains reflected vulnerability (CWE-20: Improper Input Validation) affecting Django sendfile2 libraries in the PyPI ecosystem. The issue involves django-sendfile2 before 0.7.0 contains reflected file download vulnerability. Remediation is available by upgrading affected packages to version 0.7.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/django-sendfile2

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/django-sendfile2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pcjh-6r5h-r92r - HIGH django-sendfile2 before 0.7.0 contains reflected file download vulnerability
GHSA-6r3c-8xf3-ggrr - MODERATE Directory traversal outside of SENDFILE_ROOT in django-sendfile2

GHSA-pcjh-6r5h-r92r at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pcjh-6r5h-r92r
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Django sendfile2
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-pcjh-6r5h-r92r

To remediate this vulnerability, upgrade all affected Django sendfile2 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-sendfile2 fixed: 0.7.0
pip install django-sendfile2>=0.7.0
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-sendfile2

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-pcjh-6r5h-r92r, inspect your installed packages using pip:

pip show django-sendfile2

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Django sendfile2, 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

Similar to CVE-2022-36359 for Django, django-sendfile2 did not protect against a reflected file download attack in version 0.6.1 and earlier. If the file name used by django-sendfile2 was derived from user input, then it would be possible to perform a such an attack. A new version of django-sendfile2 will be released. Either download django-sendfile2 0.7.0 as a workaround or sanitize user input yourself, using Django's patch as a template: https://github.com/django/django/commit/bd062445cffd3f6cc6dcd20d13e2abed818fa173

GHSA-pcjh-6r5h-r92r Affected Django sendfile2 Versions

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

References

Frequently Asked Questions

What is GHSA-pcjh-6r5h-r92r?
GHSA-pcjh-6r5h-r92r is a security vulnerability in Django sendfile2 involving django-sendfile2 before 0.7.0 contains reflected file download vulnerability under CWE-20: Improper Input Validation.
Which Django sendfile2 versions are affected?
Affected versions include releases prior to 0.7.0 across affected packages: django-sendfile2.
What version fixes GHSA-pcjh-6r5h-r92r?
Upgrading to 0.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is django-sendfile2 affected?
Yes, django-sendfile2 is affected in releases prior to 0.7.0. Upgrade your dependency to 0.7.0 or later.
What CWE is associated with GHSA-pcjh-6r5h-r92r?
GHSA-pcjh-6r5h-r92r is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for GHSA-pcjh-6r5h-r92r?
Run the dependency tree command: 'pip show django-sendfile2'. 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-pcjh-6r5h-r92r",
  "modified" : "2022-08-11T18:12:35Z",
  "published" : "2022-08-11T18:12:35Z",
  "aliases" : [ ],
  "summary" : "django-sendfile2 before 0.7.0 contains reflected file download vulnerability",
  "details" : "Similar to CVE-2022-36359 for Django, django-sendfile2 did not protect against a reflected file download attack in version 0.6.1 and earlier. If the file name used by django-sendfile2 was derived from user input, then it would be possible to perform a such an attack. A new version of django-sendfile2 will be released. Either download django-sendfile2 0.7.0 as a workaround or sanitize user input yourself, using Django's patch as a template: https://github.com/django/django/commit/bd062445cffd3f6cc6dcd20d13e2abed818fa173",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "django-sendfile2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/moggers87/django-sendfile2/security/advisories/GHSA-pcjh-6r5h-r92r"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moggers87/django-sendfile2/commit/4c370859023292e3715200a57843f86c5ef3cd77"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/moggers87/django-sendfile2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moggers87/django-sendfile2/releases/tag/v0.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-11T18:12:35Z",
    "nvd_published_at" : null
  }
}