CVE-2026-42314: Tarfile Incomplete Symlink Validation

Tarfile extraction iterates over archive members (often to mitigate CVE-2007-4559) but fails to validate symlinks using `issym()`, `islnk()`, `linkname`, or `type`. This allows symlink escape attacks where a malicious archive creates symlinks pointing outside the extraction directory.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0python
greprules fetch cve-2026-42314-tarfile-incomplete-symlink-validation --engine opengrep

Description

Tarfile extraction iterates over archive members (often to mitigate CVE-2007-4559) but fails to validate symlinks using `issym()`, `islnk()`, `linkname`, or `type`. This allows symlink escape attacks where a malicious archive creates symlinks pointing outside the extraction directory.

Detection target

Not provided

Recommended fix

Not provided

False-positive notes

Not provided

Community feedback

Sign in to report false positives, mark this rule useful, or suggest metadata improvements.