CVE-2026-62388: Python Lexical Traversal Check Without Resolution

Lexical path checks (such as checking for '..' or os.path.isabs) do not prevent symlink-based path traversal. Validate that the resolved target path is strictly contained within the expected root directory using Path.resolve() and is_relative_to or os.path.commonpath.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-62388-python-lexical-traversal-check-without-resolution --engine opengrep

Description

Lexical path checks (such as checking for '..' or os.path.isabs) do not prevent symlink-based path traversal. Validate that the resolved target path is strictly contained within the expected root directory using Path.resolve() and is_relative_to or os.path.commonpath.