CVE-2026-40867: Django Insecure Path Join

Constructing file paths with `os.path.join` using user-controlled input allows directory traversal. An attacker can supply paths containing `../` to access files outside the intended directory. Use Django's `safe_join()` from `django.utils._os` instead to validate that the resulting path is within the specified base directory, and verify it is a file using `

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-40867-django-insecure-path-join --engine opengrep

Description

Constructing file paths with `os.path.join` using user-controlled input allows directory traversal. An attacker can supply paths containing `../` to access files outside the intended directory. Use Django's `safe_join()` from `django.utils._os` instead to validate that the resulting path is within the specified base directory, and verify it is a file using `