---
id: "GHSA-pcjh-6r5h-r92r"
kind: "vulnerability"
aliases: ["GHSA-pcjh-6r5h-r92r"]
title: "django-sendfile2 before 0.7.0 contains reflected file download vulnerability"
severity: "high"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "django-sendfile2", "fixed": ["0.7.0"], "affected": "< 0.7.0", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-20", "django", "django-sendfile2", "package", "python"]
not_affected_if: ["fixed-file-names", "not-using-django-sendfile2"]
published_at: "2022-08-11T18:12:35+00:00"
first_seen_at: "2026-10-24T06:33:21+00:00"
updated_at: "2026-10-25T05:41:48+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-pcjh-6r5h-r92r", "first_seen_at": "2026-10-24T06:33:21+00:00"}]
---

# django-sendfile2 before 0.7.0 contains reflected file download vulnerability

django-sendfile2 up to 0.6.1 does not protect against reflected file downloads, so a file name taken from user input can be served with an attacker-chosen name. An attacker can craft a link that makes a victim's browser download a file the server returns under a name the attacker controls.

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

## Affected

- pypi:django-sendfile2 affected < 0.7.0 fixed 0.7.0

## How to check

- Run `pip show django-sendfile2` and confirm the installed version is below `0.7.0`.
- Search the codebase for calls to django-sendfile2 and check whether the file name passed to it comes from request parameters or other user input.

## Fix

- Upgrade django-sendfile2 to `0.7.0`.
- If upgrading is not possible, sanitize user-supplied file names before passing them to django-sendfile2, following Django's patch for CVE-2022-36359 (https://github.com/django/django/commit/bd062445cffd3f6cc6dcd20d13e2abed818fa173).

## Timeline

- 2026-10-24T06:33:21+00:00 ghsa https://github.com/advisories/GHSA-pcjh-6r5h-r92r

## From the sources

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

---

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