---
id: GHSA-6r3c-8xf3-ggrr
title: Directory traversal outside of SENDFILE_ROOT in django-sendfile2
summary: Directory traversal outside of SENDFILE_ROOT in django-sendfile2
severity: medium
cwe:
  - CWE-22
vendor: django-sendfile2
product: django-sendfile2
ecosystem: pip
affected:
  - django-sendfile2 < 0.6.0
patched:
  - django-sendfile2 0.6.0
published: '2020-06-24'
updated: '2026-10-24'
sourceUpdated: '2026-10-24T06:30:31Z'
source: GHSA
sourceUrl: 'https://github.com/advisories/GHSA-6r3c-8xf3-ggrr'
references:
  - url: >-
      https://github.com/moggers87/django-sendfile2/security/advisories/GHSA-6r3c-8xf3-ggrr
  - url: >-
      https://github.com/moggers87/django-sendfile2/commit/f870c52398a55b9b5189932dd8caa24efb4bc1e1
  - url: 'https://github.com/advisories/GHSA-6r3c-8xf3-ggrr'
tags:
  - ghsa
  - pip
ingestedAt: '2026-10-24T06:53:46.598Z'
---

## Overview

django-sendfile2 currently relies on the backend to correctly limit file paths to `SENDFILE_ROOT`. This is not the case for the `simple` and `development` backends, it is also not necessarily the case for any of the other backends either (it's just an assumption that was made by the original author).

This will be fixed in 0.6.0 which is to be released the same day as this advisory is made public.

When upgrading, you will need to make sure `SENDFILE_ROOT` is set in your settings module if it wasn't already.

## Affected packages

- `django-sendfile2 < 0.6.0`

## Remediation

Upgrade to a patched release:

- `django-sendfile2 0.6.0`
