Skip to main content
EPSS 0.9%top 41%

CVE-2025-4330: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in Python Software Foundation CPython

0
High
VulnerabilityCVE-2025-4330cvecve-2025-4330cwe-22
Published: 06/03/2025 (06/03/2025, 12:58:57 UTC)
Source: CVE Database V5
Vendor/Project: Python Software Foundation
Product: CPython

Description

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.

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected software

Affected versions
=3.10.0=3.11.0=3.12.0=3.13.0=3.14.03.10.03.11.03.12.03.13.03.14.0a1

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/06/2026, 13:55:33 UTC

Technical Analysis

This vulnerability in CPython's tarfile module (CVE-2025-4330) involves improper limitation of a pathname to a restricted directory (CWE-22). It allows attackers to bypass the extraction filter, causing symlink targets within tar archives to point outside the extraction directory, potentially modifying file metadata outside the intended scope. The issue affects the use of TarFile.extractall() and TarFile.extract() when the filter parameter is set to "data" or "tar", including the default filter in Python 3.14 and later. This could lead to unauthorized file modifications during archive extraction.

Potential Impact

The vulnerability allows an attacker to bypass pathname restrictions during tar archive extraction, enabling symlink targets to reference locations outside the intended extraction directory. This can result in unauthorized modification of file metadata outside the target directory. There is no direct impact on confidentiality or availability, but integrity is impacted. Source distributions are less affected due to existing arbitrary code execution risks during build processes.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor 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". Exercise caution when installing source distributions containing suspicious symbolic links. Monitor the official Python Software Foundation advisories for updates and patches.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.1
Assigner Short Name
PSF
Date Reserved
2025-05-05T15:05:14.302Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 683eff8d182aa0cae27db842

Added to database: 06/03/2025, 13:58:37 UTC

Last enriched: 08/06/2026, 13:55:33 UTC

Last updated: 09/10/2026, 19:36:50 UTC

Views: 185

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses