Vulnerability overview
CVE-2025-4517 is a critical Python tarfile vulnerability that can write files outside the requested extraction directory. Its CVSS 3.1 score is 9.4. The issue is an edge case involving path length, but the impact is concrete: a malicious archive can influence paths that the application believes are safe.
Mechanism and exploitation conditions
The extraction filter checks a target with os.path.realpath. A crafted archive can build a chain of long directory names and symlinks until the resolved path exceeds PATH_MAX. The function then fails to return a complete real path. The filter compares that unreliable result instead of the actual destination.
The attacker follows the path with a regular file or another link that reaches outside the extraction root. Exploitation requires the application to extract attacker-controlled tar content using filter="data" or filter="tar". The attack is not caused by an ordinary absolute path or a simple .. component that the filter already rejects.
Impact
The extraction service account determines the writable targets. An attacker may overwrite configuration, place content in a watched directory, alter application files or cause a denial of service. If the file is later executed with greater privileges, the outcome can become a code-execution or persistence issue.
Affected products and scope
The fixed releases identified by the Python project are 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 and 3.14.0b1. The vulnerability is not proof that every Python installation is exploitable. The application must pass untrusted tar archives through the vulnerable extraction path.
Exposure context
ZoomEye returned 60035 application-fingerprint matches for app="Python" and 0 for vul.cve="CVE-2025-4517". The larger number is product exposure. It does not measure vulnerable archive handlers.
Remediation and mitigations
Patch the interpreter used by the extraction service and rebuild any bundled or containerized runtime. Validate the extraction path after deployment. If patching is delayed, reject hardlinks and symlinks containing .., inspect archive members before extraction and use a disposable low-privilege directory.
Monitor for writes outside the intended extraction root. A path-based monitor alone may miss the primitive, but it can provide useful evidence when combined with archive metadata and process auditing.