CVE-2025-67720: Path Traversal From Fallback Filename

Constructing file paths from untrusted fallbacks without proper sanitization can lead to Path Traversal (CWE-22). Always sanitize filenames derived from external input using `os.path.basename()` and remove null bytes before inspecting them with `os.path.isabs` or opening file handles.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2025-67720-path-traversal-from-fallback-filename --engine opengrep

Description

Constructing file paths from untrusted fallbacks without proper sanitization can lead to Path Traversal (CWE-22). Always sanitize filenames derived from external input using `os.path.basename()` and remove null bytes before inspecting them with `os.path.isabs` or opening file handles.