Path Traversal in Django
Published 10 Jun 2021 · Updated 20 Sept 2024
Is your project on an affected django?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- <2.2.24
- Fixed in
- 2.2.24
pip install 'django>=2.2.24'- Affected
- >=3.0 <3.1.12
- Fixed in
- 3.1.12
pip install 'django>=3.1.12'- Affected
- >=3.2 <3.2.4
- Fixed in
- 3.2.4
pip install 'django>=3.2.4'Details
Django before 2.2.24, 3.x before 3.1.12, and 3.2.x before 3.2.4 has a potential directory traversal via django.contrib.admindocs. Staff members could use the TemplateDetailView view to check the existence of arbitrary files. Additionally, if (and only if) the default admindocs templates have been customized by application developers to also show file contents, then not only the existence but also the file contents would have been exposed. In other words, there is directory traversal outside of the template root directories.
Is GHSA-68w8-qjq3-2gfm in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected django, and gives you the command that fixes it.
More advisories for django
- HighCVE-2026-15307Django GeoDjango spatial lookups allow file writes and outbound requests through GDAL raster parsing · 4 Aug 2026
- MediumCVE-2026-15830Django GeoDjango vulnerable to denial of service through deeply nested geometry collections · 4 Aug 2026
- MediumCVE-2026-53878Django: DomainNameValidator permits newline characters that may enable HTTP header injection · 7 Jul 2026
- MediumCVE-2026-53877 Django: GDALRaster may over-read heap memory when constructed from bytes · 7 Jul 2026
- LowCVE-2026-48588Django: cache middleware may expose private responses when unrelated request cookies are present · 7 Jul 2026
- LowCVE-2026-8404Django: UpdateCacheMiddleware may disclose cached responses due to case-sensitive Cache-Control handling · 3 Jun 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-33203
- Linkgithub.com/django/django/commit/053cc9534d174dc89daba36724ed2dcb36755b90
- Linkgithub.com/django/django/commit/20c67a0693c4ede2b09af02574823485e82e4c8f
- Linkgithub.com/django/django/commit/dfaba12cda060b8b292ae1d271b44bf810b1c5b9
- Linkdocs.djangoproject.com/en/3.2/releases/security
- Advisorygithub.com/advisories/GHSA-68w8-qjq3-2gfm
- Packagegithub.com/django/django
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-98.yaml
- Linkgroups.google.com/forum/#!forum/django-announce
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV
- Linksecurity.netapp.com/advisory/ntap-20210727-0004
- Linkwww.djangoproject.com/weblog/2021/jun/02/security-releases
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.