CVE-2025-4517: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in Python Software Foundation CPython
Allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". You are affected by this vulnerability if using the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() using the filter= parameter with a value of "data" or "tar". See the tarfile extraction filters documentation https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter for more information. Note that for Python 3.14 or later the default value of filter= changed from "no filtering" to `"data", so if you are relying on this new default behavior then your usage is also affected. Note that none of these vulnerabilities significantly affect the installation of source distributions which are tar archives as source distributions already allow arbitrary code execution during the build process. However when evaluating source distributions it's important to avoid installing source distributions with suspicious links.
AI Analysis
Technical Summary
This vulnerability (CVE-2025-4517) in the Python Software Foundation's CPython implementation involves improper limitation of pathnames (CWE-22) during extraction of tar archives using the tarfile module. Specifically, when using TarFile.extractall() or TarFile.extract() with the filter parameter set to "data" or "tar", an attacker can craft tar archives that write files outside the intended extraction directory, leading to arbitrary filesystem writes. The issue affects Python versions 3.10.0, 3.11.0, 3.12.0, 3.13.0, and 3.14.0a1. The default filter value changed to "data" starting with Python 3.14, which means code relying on default behavior in these versions is also vulnerable. The vulnerability does not significantly affect source distribution installations since those already allow arbitrary code execution during build, but installing source distributions with suspicious links should be avoided.
Potential Impact
Successful exploitation allows an attacker to write arbitrary files outside the intended extraction directory, potentially overwriting critical files or placing malicious files in sensitive locations. This can lead to full system compromise, data corruption, or denial of service. The CVSS score of 9.4 reflects the critical severity with network attack vector, low attack complexity, no privileges or user interaction required, and high impact on confidentiality and integrity, with low impact on availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. Until a fix is available, avoid extracting untrusted tar archives using TarFile.extractall() or TarFile.extract() with the filter parameter set to "data" or "tar". For Python 3.14 or later, be aware that the default filter value is "data", so explicitly specifying a safer filter or avoiding extraction of untrusted archives is recommended. Exercise caution when installing source distributions with suspicious symbolic links or paths. Monitor the official Python tarfile module documentation and security advisories for updates and patches.
CVE-2025-4517: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in Python Software Foundation CPython
Description
Allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". You are affected by this vulnerability if using the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() using the filter= parameter with a value of "data" or "tar". See the tarfile extraction filters documentation https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter for more information. Note that for Python 3.14 or later the default value of filter= changed from "no filtering" to `"data", so if you are relying on this new default behavior then your usage is also affected. Note that none of these vulnerabilities significantly affect the installation of source distributions which are tar archives as source distributions already allow arbitrary code execution during the build process. However when evaluating source distributions it's important to avoid installing source distributions with suspicious links.
CVSS v3.1
Score 9.4critical
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability (CVE-2025-4517) in the Python Software Foundation's CPython implementation involves improper limitation of pathnames (CWE-22) during extraction of tar archives using the tarfile module. Specifically, when using TarFile.extractall() or TarFile.extract() with the filter parameter set to "data" or "tar", an attacker can craft tar archives that write files outside the intended extraction directory, leading to arbitrary filesystem writes. The issue affects Python versions 3.10.0, 3.11.0, 3.12.0, 3.13.0, and 3.14.0a1. The default filter value changed to "data" starting with Python 3.14, which means code relying on default behavior in these versions is also vulnerable. The vulnerability does not significantly affect source distribution installations since those already allow arbitrary code execution during build, but installing source distributions with suspicious links should be avoided.
Potential Impact
Successful exploitation allows an attacker to write arbitrary files outside the intended extraction directory, potentially overwriting critical files or placing malicious files in sensitive locations. This can lead to full system compromise, data corruption, or denial of service. The CVSS score of 9.4 reflects the critical severity with network attack vector, low attack complexity, no privileges or user interaction required, and high impact on confidentiality and integrity, with low impact on availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. Until a fix is available, avoid extracting untrusted tar archives using TarFile.extractall() or TarFile.extract() with the filter parameter set to "data" or "tar". For Python 3.14 or later, be aware that the default filter value is "data", so explicitly specifying a safer filter or avoiding extraction of untrusted archives is recommended. Exercise caution when installing source distributions with suspicious symbolic links or paths. Monitor the official Python tarfile module documentation and security advisories for updates and patches.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- PSF
- Date Reserved
- 2025-05-09T15:05:07.139Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 683eff8d182aa0cae27db844
Added to database: 06/03/2025, 13:58:37 UTC
Last enriched: 08/06/2026, 13:55:47 UTC
Last updated: 09/10/2026, 19:36:50 UTC
Views: 151
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.