Extraction Filter Bypass in Python's TarFile Module Affecting Python 3.12 and Later
CVE-2025-4330
What is CVE-2025-4330?
A vulnerability in Python's TarFile module allows attackers to bypass the extraction filter when using the TarFile.extractall() or TarFile.extract() methods. This exploit permits symlink targets to reference locations outside the intended destination directory, potentially enabling unauthorized file modifications and metadata changes. The vulnerability primarily affects versions 3.12 and above. Users of these versions should be cautious when extracting untrusted tar archives, especially with filter parameters set to 'data' or 'tar'. The default behavior change in Python 3.14 also requires careful consideration as it defaults to 'data', exposing users to increased risk if relying on this setting. It is essential to avoid installing source distributions from untrusted sources due to inherent risks associated with arbitrary code execution during the build process.
Affected Version(s)
CPython 0 < 3.9.23
CPython 3.10.0 < 3.10.18
CPython 3.11.0 < 3.11.13
References
CVSS V3.1
Timeline
Vulnerability published
Vulnerability Reserved