CVE-2026-29790: Path Traversal Commonprefix

Use of `os.path.commonprefix` for path validation is insecure. `commonprefix` performs a character-by-character comparison rather than comparing path components. This allows path traversal to sibling directories that share the same string prefix as the intended destination directory. Use `os.path.commonpath` instead.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-29790-path-traversal-commonprefix --engine opengrep

Description

Use of `os.path.commonprefix` for path validation is insecure. `commonprefix` performs a character-by-character comparison rather than comparing path components. This allows path traversal to sibling directories that share the same string prefix as the intended destination directory. Use `os.path.commonpath` instead.