CVE-2026-40865: Django Path Traversal Join

Use of `os.path.join` with user-controlled input can lead to path traversal vulnerabilities. An attacker may use directory traversal sequences (e.g., `../../`) to access files outside the intended directory. Use `django.utils._os.safe_join` to safely construct paths.

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

Description

Use of `os.path.join` with user-controlled input can lead to path traversal vulnerabilities. An attacker may use directory traversal sequences (e.g., `../../`) to access files outside the intended directory. Use `django.utils._os.safe_join` to safely construct paths.