Executive brief
A vulnerability in Python's standard library for handling compressed archives could allow a malicious file to write or read data outside of its intended folder. This affects applications that use Python to extract TAR files, potentially allowing an attacker to overwrite sensitive system files or access private data. The issue occurs even when security filters are enabled, as a specially crafted archive can bypass these protections.
Technical details
A path traversal vulnerability exists in the Python `tarfile` module's `extractall()` function. When using the 'data' or 'tar' filters, a bypass is possible using a crafted archive where a hardlink references a symlink located deeper in the directory structure than the hardlink itself. The extraction fallback mechanism validates the symlink at its original archived location but recreates it at the shallower path of the hardlink; this allows a relative symlink target, previously judged safe by the filter, to resolve to a location outside the intended destination directory. This is an incomplete fix for CVE-2025-4330 and allows for arbitrary file reads or writes upon extraction. The issue is addressed in CPython versions leading up to 3.16.0.
Affected products
- Python Software Foundation CPython < 3.16.0
Timeline
- 2026-06-16: disclosed: Issue reported on GitHub
- 2026-06-23: patched: Fix merged into CPython main branch
- 2026-06-23: advisory: Security announcement and CVE published