CVE-2024-12718 Details
Description
Allows modifying some file metadata (e.g. last modified) with filter="data" or file permissions (chmod) with filter="tar" of files outside the extraction directory. 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. Only Python versions 3.12 or later are affected by these vulnerabilities, earlier versions don't include the extraction filter feature. 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.
A vulnerability in the Python tarfile module allows for the extraction filter to be bypassed, leading to arbitrary file permission changes outside the extraction directory. This issue arises when using the TarFile.extract() or TarFile.extractall() methods with the filter parameter set to 'data' or 'tar'. The vulnerability is present in Python versions 3.12 and later, with a notable change in version 3.14 where the default filter was updated to 'data', increasing the risk for users relying on this default. The vulnerability was discovered during the extraction of a crafted tar archive that exploited the filtering mechanism, particularly targeting symlink handling to manipulate file permissions on the filesystem.
Users can upgrade to Python versions 3.13.12, 3.14.6, or 3.12.10, where this vulnerability has been fixed. For those unable to upgrade, a manual mitigation involves rejecting tarfile members that contain insecure link names before extraction.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jun 3, 2025CISA-ADP
Assessed Jul 24, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Python | >= 3.12, < 3.14 |
CPE
Remediation
| |
Change History
8 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 31, 2026 | CVE Modified | [email protected] |
| Jul 30, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jul 24, 2025 | CVE Modified | CISA-ADP |
| Jun 3, 2025 | CVE Modified | [email protected] |
| Jun 3, 2025 | CVE Modified | [email protected] |
| Jun 3, 2025 | New CVE Received | [email protected] |
Volerion