ADVISORIES

PyPA Advisory Database

PYSEC-2021-98

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.

Affected packages

EcosystemPackageAffected versions
PyPIdjango
All versions before 2.2.24 (fixed in 2.2.24)
From 3.0 before 3.1.12 (fixed in 3.1.12)
From 3.2 before 3.2.4 (fixed in 3.2.4)

References