CVE-2025-4330: Extraction filter bypass for linking outside extraction directory
Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata.
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.
Security readout for executives and security teams
Plain-English summary
A flaw in Python’s archive extraction protections can let a malicious tar archive create links pointing outside the intended destination and alter some file metadata. This could allow unauthorized file changes under the extracting process’s permissions. Risk is concentrated in systems that automatically accept and unpack untrusted archives.
Executive priority
Treat as a high-priority integrity issue where customers, partners, or automated feeds can supply tar archives. Prioritize internet-facing upload workflows and privileged extraction services. Accelerate remediation if extraction can reach application files, configuration, deployment assets, or shared storage; otherwise schedule prompt patching after confirming actual tarfile use.
Technical view
CVE-2025-4330 is a CWE-22 path-control flaw in CPython’s tarfile module. The "data" and "tar" extraction filters can be bypassed through link targets outside the extraction directory. Affected usage includes TarFile.extractall() or TarFile.extract() with those filters, plus Python 3.14 users relying on the new default "data" filter.
Likely exposure
Exposure requires affected CPython code to extract attacker-controlled or otherwise untrusted tar archives. Upload processors, conversion services, build systems, and automation pipelines warrant review. Systems that never extract untrusted archives through tarfile are less likely exposed. The supplied affected-version data is incomplete, so confirm exact versions through vendor guidance.
Exploitation context
The CVSS 3.1 score is 7.5, reflecting remotely supplied input, low complexity, no privileges, no user interaction, and high integrity impact. The source bundle marks this CVE as absent from KEV and provides no evidence of active exploitation. Network reachability depends on how an application obtains archives; tarfile itself is not necessarily network-facing.
Researcher notes
The reported behavior concerns extraction-filter enforcement for link destinations and some metadata changes. The source bundle lists CPython branches beginning with 3.10 through 3.14 alpha, but does not clearly express complete affected ranges or fixed release numbers. Review branch-specific commits and the Python security advisory before making precise version determinations. Source-distribution installation already permits build-time code execution, limiting this CVE’s incremental impact there.
Mitigation direction
Apply the vendor-provided CPython fix for the installed supported branch.
Pause or isolate extraction of untrusted tar archives until affected runtimes are remediated.
Follow the vendor-linked mitigation guidance where immediate patching is unavailable.
Run extraction with minimal filesystem permissions and segregate destination storage.
Validation and detection
Inventory CPython versions in applications, containers, build workers, and automation hosts.
Find TarFile.extractall() and TarFile.extract() calls, including wrappers and indirect library usage.
Identify calls using "data", "tar", or Python 3.14 default filtering with untrusted archives.
Confirm installed packages contain the applicable vendor patch using trusted package provenance.
Regression-test that archive links cannot affect paths outside an isolated extraction directory.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-22: File access and web shell behavior lookup
File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.