GHSA-6r3c-8xf3-ggrr Directory traversal outside of SENDFILE_ROOT in django-sendfile2
Attackers can read arbitrary files outside the intended root directory due to improper path validation in django-sendfile2 backends.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-6r3c-8xf3-ggrr?
GHSA-6r3c-8xf3-ggrr is a path traversal vulnerability in django-sendfile2, published on 24 Jun 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Which versions are affected by GHSA-6r3c-8xf3-ggrr?
2 open source packages ship an affected version, including django-sendfile2.
| Package | Affected | Fixed in |
|---|---|---|
django-sendfile2 PyPI | All versions | 0.6.0 |
django-sendfile2 PyPI | All versions | 0.6.0 |
How do I fix GHSA-6r3c-8xf3-ggrr?
Upgrade django-sendfile2 to 0.6.0 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is GHSA-6r3c-8xf3-ggrr being exploited?
There is no known exploitation of GHSA-6r3c-8xf3-ggrr in the wild and no public exploit code.