{"id":"GHSA-6r3c-8xf3-ggrr","kind":"vulnerability","aliases":["GHSA-6r3c-8xf3-ggrr"],"related":[],"title":"Directory traversal outside of SENDFILE_ROOT in django-sendfile2","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).\n\nThis will be fixed in 0.6.0 which is to be released the same day as this advisory is made public.\n\nWhen upgrading, you will need to make sure `SENDFILE_ROOT` is set in your settings module if it wasn't already.","summary":"django-sendfile2 does not enforce that requested file paths stay inside SENDFILE_ROOT in the simple and development backends, and other backends may not either. An attacker who can request files through an affected view can read files outside the intended directory.","severity":"medium","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"django-sendfile2","fixed":["0.6.0"],"affected":"< 0.6.0","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-22","django","package","python","self-hosted"],"not_affected_if":["no-user-controlled-paths","not-using-django-sendfile2"],"how_to_check":"- Run `pip show django-sendfile2` and confirm the version is below `0.6.0`\n- Check whether the project sets `SENDFILE_BACKEND` to `sendfile2.backends.simple` or `development`, or uses another backend\n- Check whether `SENDFILE_ROOT` is set in the settings module","fix":"- Upgrade django-sendfile2 to `0.6.0` or later\n- Set `SENDFILE_ROOT` in the settings module if it is not already set","status":"open","published_at":"2020-06-24T17:15:26+00:00","first_seen_at":"2026-10-24T06:33:21+00:00","triaged_at":"2026-10-25T05:41:52+00:00","updated_at":"2026-10-25T05:41:52+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-10-25T05:41:52Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade django-sendfile2 to `0.6.0` or later\n- Set `SENDFILE_ROOT` in the settings module if it is not already set","reach":"internet","title":"django-sendfile2: directory traversal lets requests read files outside SENDFILE_ROOT","impact":"medium","summary":"django-sendfile2 does not enforce that requested file paths stay inside SENDFILE_ROOT in the simple and development backends, and other backends may not either. An attacker who can request files through an affected view can read files outside the intended directory.","category":"package","nicknames":[],"who_cares":["django","python","self-hosted"],"confidence":0.7,"needs_auth":"unknown","worst_case":"Attacker reads arbitrary server files outside SENDFILE_ROOT","analyst_note":"","how_to_check":"- Run `pip show django-sendfile2` and confirm the version is below `0.6.0`\n- Check whether the project sets `SENDFILE_BACKEND` to `sendfile2.backends.simple` or `development`, or uses another backend\n- Check whether `SENDFILE_ROOT` is set in the settings module","needs_analyst":false,"not_affected_if":["no-user-controlled-paths","not-using-django-sendfile2"],"who_is_affected":"Django projects that use django-sendfile2 to serve files based on a user-supplied or otherwise attacker-influenced path. The simple and development backends are called out as not limiting paths to SENDFILE_ROOT, and the advisory says other backends may not either. Projects that only serve fixed files or do not use django-sendfile2 can skip it.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"medium"},"cost_usd":0.00064,"input_tokens":3421,"output_tokens":596,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-22':25B '0.6.0':133C '6r3c':13A,18A '8xf3':14A,19A 'advisori':144C 'affect':66B 'alreadi':168C 'also':104C 'assumpt':120C 'attack':59B 'author':127C 'backend':51B,54B,82C,101C,114C 'case':95C,108C 'correct':84C 'current':78C 'cwe':24B 'day':141C 'develop':50B,100C 'directori':1A,74B 'django':9A,22A,26B,33B,76C 'django-sendfile2':8A,21A,32B,75C 'either':57B,115C 'enforc':37B 'file':40B,63B,70B,86C 'fix':131C 'ggrr':15A,20A 'ghsa':12A,17A 'ghsa-6r3c-8xf3-ggrr':11A,16A 'host':31B 'insid':43B 'intend':73B 'limit':85C 'made':123C,146C 'make':154C 'may':55B 'modul':163C 'necessarili':106C 'need':152C 'origin':126C 'outsid':3A,71B 'packag':27B 'path':41B,87C 'public':147C 'python':28B 'read':69B 'releas':138C 'reli':79C 'request':39B,62B 'root':6A,45B,90C,157C 'self':30B 'self-host':29B 'sendfil':5A,44B,89C,156C 'sendfile2':10A,23A,34B,77C 'set':159C,162C 'simpl':48B,98C 'stay':42B 'sure':155C 'travers':2A 'upgrad':149C 'view':67B 'wasn':166C","nicknames":[],"mitigations":[],"who_affected":"Django projects that use django-sendfile2 to serve files based on a user-supplied or otherwise attacker-influenced path. The simple and development backends are called out as not limiting paths to SENDFILE_ROOT, and the advisory says other backends may not either. Projects that only serve fixed files or do not use django-sendfile2 can skip it.","tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2020-06-24T17:15:26+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-6r3c-8xf3-ggrr","url":"https://github.com/advisories/GHSA-6r3c-8xf3-ggrr","severity":"medium","published_at":"2020-06-24T17:15:26+00:00","modified_at":"2026-10-24T06:30:31+00:00","first_seen_at":"2026-10-24T06:33:21+00:00","fetched_at":"2026-10-25T06:54:11+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}