Skip to main content
EPSS 0.8%top 47%

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

0
Medium
VulnerabilityCVE-2024-12718cvecve-2024-12718cwe-22
Published: 06/03/2025 (06/03/2025, 12:59:10 UTC)
Source: CVE Database V5
Vendor/Project: Python Software Foundation
Product: CPython

Description

CVE-2024-12718 is a path traversal vulnerability in the Python tarfile module affecting Python versions 3.12 and later. It allows modification of file metadata or permissions outside the intended extraction directory when using the extractall() or extract() methods with the filter parameter set to "data" or "tar". The default filter changed to "data" starting in Python 3.14, increasing the risk if relying on default behavior. This vulnerability does not significantly impact source distribution installations, which already permit arbitrary code execution during builds.

CVSS v3.1

Score 5.3medium

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

Affected software

Affected versions
=3.10.0=3.11.0=3.12.0=3.13.0=3.14.0>=3.12.0

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/07/2026, 14:56:49 UTC

Technical Analysis

This vulnerability in CPython's tarfile module (CVE-2024-12718) involves improper limitation of pathnames (CWE-22) during extraction of tar archives. When using TarFile.extractall() or TarFile.extract() with the filter parameter set to "data" or "tar", an attacker can modify file metadata such as last modified timestamps or file permissions (chmod) on files outside the extraction directory. This affects Python versions 3.12 and later, as earlier versions do not support the extraction filter feature. Additionally, from Python 3.14 onward, the default filter value changed to "data", meaning that code relying on default filtering is also affected. The vulnerability does not significantly affect source distribution installations, which inherently allow arbitrary code execution during build processes.

Potential Impact

An attacker providing a crafted tar archive can cause modification of file metadata or permissions outside the intended extraction directory when the vulnerable extraction filters are used. This can lead to unauthorized changes to files on the system, potentially impacting system integrity. There is no direct confidentiality or availability impact reported. The vulnerability has a CVSS score of 5.3 (medium severity) with network attack vector, low attack complexity, no privileges required, and no user interaction needed.

Mitigation Recommendations

Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. Until a patch 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 is "data", so explicitly specify a safe filter or avoid extraction of untrusted tar files. Exercise caution when installing source distributions with suspicious links, although this vulnerability does not significantly affect source distribution installations.

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
2024-12-17T17:04:51.209Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 683ef51d182aa0cae27c315d

Added to database: 06/03/2025, 13:14:05 UTC

Last enriched: 08/07/2026, 14:56:49 UTC

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

Views: 270

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