Overview
CVE-2025-4435 is a critical vulnerability that stems from the improper handling of filtered files during the extraction of archives. This vulnerability affects a range of systems and applications that utilize TarFile for archive management, potentially leading to system compromise or data leakage. The issue arises when TarFile.errorlevel = 0 and extraction occurs with a filter, whereby the expectation is for filtered members to be skipped in the extraction process, but they are not.
Vulnerability Summary
CVE ID: CVE-2025-4435
Severity: High (CVSS: 7.5)
Attack Vector: Network
Privileges Required: Low
User Interaction: None
Impact: System compromise or Data leakage
Affected Products
Escape the Surveillance Era
Most apps won’t tell you the truth.
They’re part of the problem.
Phone numbers. Emails. Profiles. Logs.
It’s all fuel for surveillance.
Ameeba Chat gives you a way out.
- • No phone number
- • No email
- • No personal info
- • Anonymous aliases
- • End-to-end encrypted
Chat without a trace.
Product | Affected Versions
TarFile | All versions prior to patch release
Python | Versions using affected TarFile library
How the Exploit Works
The exploit takes advantage of the faulty behavior of TarFile.errorlevel = 0 during archive extraction. Instead of skipping the filtered members as expected, the vulnerability allows these members to be extracted. An attacker can exploit this by embedding malicious payloads in such filtered members. When the extraction process happens, the malicious payload is released into the system, potentially leading to system compromises or data leakage.
Conceptual Example Code
Here is a conceptual example of how an attacker might exploit this vulnerability.
# Create a tarfile with malicious payload
import tarfile
tar = tarfile.open("exploit.tar", "w")
tar.add("malicious_payload")
tar.close()
# Now, the tarfile is sent to the target system. On the target system, the following happens:
import tarfile
tar = tarfile.open("exploit.tar")
tar.errorlevel = 0 # Expectation: malicious_payload should be skipped during extraction
tar.extractall(path="target_directory", members=filter_function) # Actual: malicious_payload gets extracted
tar.close()
In the above example, `filter_function` is intended to filter out `malicious_payload`, but due to the vulnerability, it is not skipped during extraction.

