Extraction Filter Bypass in Python's TarFile Module Affecting Python 3.12 and Later
CVE-2025-4330

7.5HIGH

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

Score:
7.5
Severity:
HIGH
Confidentiality:
None
Integrity:
High
Availability:
None
Attack Vector:
Network
Attack Complexity:
Low
Privileges Required:
None
User Interaction:
None
Scope:
Unchanged

Timeline

  • Vulnerability published

  • Vulnerability Reserved

Credit

Caleb Brown (Google)
Petr Viktorin
Serhiy Storchaka
Hugo van Kemenade
Ɓukasz Langa
Thomas Wouters
Seth Larson
.