CVE-2026-40071: Python Tarfile Incomplete Symlink Validation

An extraction loop over `tarfile` members was detected without explicit validation for symbolic or hard links. Attackers can embed a symbolic link in an archive that points outside the destination directory, bypassing normal path traversal validations, to achieve arbitrary file writes (Symlink Escape). Ensure `member.issym()` and `member.islnk()` are checked

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-40071-python-tarfile-incomplete-symlink-validation --engine opengrep

Description

An extraction loop over `tarfile` members was detected without explicit validation for symbolic or hard links. Attackers can embed a symbolic link in an archive that points outside the destination directory, bypassing normal path traversal validations, to achieve arbitrary file writes (Symlink Escape). Ensure `member.issym()` and `member.islnk()` are checked