Overview
The vulnerability labeled as CVE-2025-4517 is a serious security flaw found in Python’s tarfile module. This vulnerability allows potential attackers to write arbitrarily to the filesystem outside the extraction directory during the extraction process. Python developers who employ the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() with a filter= parameter set to “data” or “tar” are at risk. This issue is particularly pressing as it could lead to system compromise or data leakage.
Vulnerability Summary
CVE ID: CVE-2025-4517
Severity: Critical – CVSS 9.4
Attack Vector: Network
Privileges Required: None
User Interaction: None
Impact: System compromise or data leakage
Affected Products
Share secrets securely
Ameeba is private infrastructure for communication and sensitive work built on encrypted identity instead of exposed corporate identity systems.
Passwords, credentials, confidential files, screenshots, internal discussions, sensitive AI context, and private coordination should not become exposed across ordinary communication platforms.
- • Encrypted identity
- • Private Spaces for organizations and teams
- • End-to-end encrypted chat, calls, files, and notes
- • Sensitive AI work and protected collaboration
- • Built for information that cannot leak
Our mission is to secure human work alongside AI.
Product | Affected Versions
Python | 3.14 or later
How the Exploit Works
The exploit takes advantage of a flaw in Python’s tarfile module during the extraction process. If untrusted tar archives are extracted using TarFile.extractall() or TarFile.extract() with a filter= parameter set to “data” or “tar”, the attacker’s arbitrary code can be written to the filesystem outside the extraction directory. This could enable the attacker to execute malicious code, compromise the system, or lead to potential data leakage.
Conceptual Example Code
Let’s consider a conceptual example where the attacker sends a malicious tar file to the victim. If the victim uses the vulnerable Python code to extract the file, the attacker’s arbitrary code can be written outside of the extraction directory. The code could look something like this:
import tarfile
# open the malicious tar file
tar = tarfile.open("malicious.tar")
# extract the tar file with filter set to "data"
tar.extractall(path="/safe/directory", filter="data")
In this instance, the attacker’s malicious code could be written to parts of the filesystem outside “/safe/directory”, potentially compromising the system or leading to data leakage.
Mitigation Guidance
Users are advised to apply the vendor patch as soon as it becomes available. In the interim, using a Web Application Firewall (WAF) or Intrusion Detection System (IDS) can offer temporary mitigation. Additionally, developers should avoid using the tarfile module to extract untrusted tar archives, and should refrain from using the filter= parameter with a value of “data” or “tar”.
