CVE-2026-137507: torchvision before 0.29.2 Path Traversal via Tar Archive Extraction
torchvision before 0.29.2 contains a path traversal vulnerability in extracttar() that allows attackers to write files outside the extraction directory by supplying crafted tar archives. Attackers controlling archives passed to extractarchive() or downloadandextractarchive() can use .. paths, absolute paths, or symlinks to overwrite Python modules and achieve code execution.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using torchvision before 0.29.2 are exposed when they pass attacker-controlled tar archives to extract_archive() or download_and_extract_archive(). The issue is relevant where an attacker can influence an archive that the application downloads or extracts.
What does an attacker need to exploit it?
The attacker needs to supply a crafted tar archive to a vulnerable extraction call. The archive can contain ../ paths, absolute paths, or symlinks that cause files to be written outside the intended extraction directory.
What is the potential impact?
A crafted archive can overwrite files outside the extraction directory, including Python modules. Overwriting Python modules can lead to code execution.
How can this be remediated?
Upgrade torchvision to version 0.29.2 or later. If an upgrade cannot be applied immediately, do not extract untrusted tar archives through the affected functions.