Impact
The tarfile module’s extraction filters allow certain archive members to create empty directories outside the intended extraction destination when the member name is crafted to traverse the filesystem, for example "../evil/../dest/sub/file". The containment check uses the resolved path, but intermediate directories are created using the original name, enabling path traversal. Only empty directories are created outside the destination; the actual file contents are still extracted inside the destination. This flaw can be exploited to create arbitrary directory structures adjacent to the extraction target. The vulnerability is identified as a path traversal weakness (CWE‑22).
Affected Systems
This issue affects CPython implementations supplied by the Python Software Foundation that run on POSIX platforms (e.g., Linux, macOS). Windows systems are not impacted because the underlying operating system normalises ".." components before the filesystem operation, preventing directories outside the destination from being created.
Risk and Exploitability
The CVSS score of 6.3 indicates a moderate severity. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting limited widespread exploitation. Exploitation requires a user to supply a crafted tar file and execute the extraction routine; therefore, it does not provide a remote attack vector unless the extraction is performed in a privileged or exposed context. The risk hinges on the potential for local privilege escalation or repository poisoning if the extraction location has sensitive permissions.
OpenCVE Enrichment