Vulnerability · Published Jun 3, 2025 · Assigned by PSF
CVE-2024-12718Bypass extraction filter to modify file metadata outside extraction directory
Medium 5.3
In plain English
A medium-severity path traversal in CPython from Python Software Foundation. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 58% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | platform-python | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:8 | platform-python-debug | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:8 | platform-python-devel | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:10 | python-unversioned-command | 3.12.9-2.el10_0.2 | ALSA-2025:10140 |
| AlmaLinux:9 | python-unversioned-command | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:9 | python3 | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:9 | python3-debug | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:9 | python3-devel | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:8 | python3-idle | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:9 | python3-idle | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:8 | python3-libs | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:9 | python3-libs | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:8 | python3-test | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:9 | python3-test | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:8 | python3-tkinter | 3.6.8-70.el8_10.alma.1 | ALSA-2025:10128 |
| AlmaLinux:9 | python3-tkinter | 3.9.21-2.el9_6.1 | ALSA-2025:10136 |
| AlmaLinux:8 | python3.11 | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11 | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.11-debug | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11-debug | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.11-devel | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11-devel | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.11-idle | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11-idle | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.11-libs | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11-libs | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.11-rpm-macros | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:8 | python3.11-test | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11-test | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.11-tkinter | 3.11.13-1.el8_10 | ALSA-2025:10026 |
| AlmaLinux:9 | python3.11-tkinter | 3.11.11-2.el9_6.1 | ALSA-2025:10148 |
| AlmaLinux:8 | python3.12 | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12 | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| AlmaLinux:8 | python3.12-debug | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12-debug | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| AlmaLinux:8 | python3.12-devel | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12-devel | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| AlmaLinux:8 | python3.12-idle | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12-idle | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| AlmaLinux:8 | python3.12-libs | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12-libs | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| AlmaLinux:8 | python3.12-rpm-macros | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:8 | python3.12-test | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12-test | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| AlmaLinux:8 | python3.12-tkinter | 3.12.11-1.el8_10 | ALSA-2025:10031 |
| AlmaLinux:9 | python3.12-tkinter | 3.12.9-1.el9_6.1 | ALSA-2025:10189 |
| Alpine:v3.20 | python3 | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.21 | python3 | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.22 | python3 | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.23 | python3 | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.24 | python3 | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.20 | python3-tkinter | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.21 | python3-tkinter | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.22 | python3-tkinter | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.23 | python3-tkinter | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Alpine:v3.24 | python3-tkinter | 3.12.11-r0 | ALPINE-CVE-2024-12718 |
| Debian:12 | pypy3 | no fix listed | DEBIAN-CVE-2024-12718 |
| Debian:13 | pypy3 | no fix listed | DEBIAN-CVE-2024-12718 |
| Debian:14 | pypy3 | 7.3.20+dfsg-2 | DEBIAN-CVE-2024-12718 |
| Debian:13 | python3.13 | 3.13.4-1 | DEBIAN-CVE-2024-12718 |
| Rocky Linux:8 | python3 | 0:3.6.8-70.el8_10.rocky.0 | RLSA-2025:10128 |
| Rocky Linux:8 | python3.11 | 0:3.11.13-1.el8_10 | RLSA-2025:10026 |
| Rocky Linux:9 | python3.11 | 0:3.11.11-2.el9_6.1 | RLSA-2025:10148 |
| Rocky Linux:10 | python3.12 | 0:3.12.9-2.el10_0.2 | RLSA-2025:10140 |
| Rocky Linux:8 | python3.12 | 0:3.12.11-1.el8_10 | RLSA-2025:10031 |
| Rocky Linux:9 | python3.12 | 0:3.12.9-1.el9_6.1 | RLSA-2025:10189 |
| Rocky Linux:9 | python3.9 | 0:3.9.21-2.el9_6.1 | RLSA-2025:10136 |
| Ubuntu:24.04:LTS | python3.12 | 3.12.3-1ubuntu0.7 | USN-7583-1 |
| Ubuntu:24.04:LTS | python3.12 | 3.12.3-1ubuntu0.7 | UBUNTU-CVE-2024-12718 |
| Ubuntu:25.10 | python3.14 | 3.14.0-1 | UBUNTU-CVE-2024-12718 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Python Software Foundation | CPython | 0 – before 3.9.233.10.0 – before 3.10.183.11.0 – before 3.11.133.12.0 – before 3.12.113.13.0 – before 3.13.43.14.0a1 – before 3.14.0b3 |
Weakness: CWE-22 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
References
- https://github.com/python/cpython/issues/135034 issue-tracking
- https://github.com/python/cpython/pull/135037 patch
- https://github.com/python/cpython/issues/127987 issue-tracking
- https://mail.python.org/archives/list/security-announce@python.org/thread/MAXIJJCUUMCL7ATZNDVEGGHUMQMUUKLG/ vendor-advisory
- https://github.com/python/cpython/commit/3612d8f51741b11f36f8fb0494d79086bac9390a patch
- https://github.com/python/cpython/commit/9e0ac76d96cf80b49055f6d6b9a6763fb9215c2a patch
- https://gist.github.com/sethmlarson/52398e33eff261329a0180ac1d54f42f mitigation
- https://github.com/python/cpython/commit/19de092debb3d7e832e5672cc2f7b788d35951da patch
- https://github.com/python/cpython/commit/28463dba112af719df1e8b0391c46787ad756dd9 patch
- https://github.com/python/cpython/commit/4633f3f497b1ff70e4a35b6fe2c907cbe2d4cb2e patch
- https://github.com/python/cpython/commit/9c1110ef6652687d7c55f590f909720eddde965a patch
- https://github.com/python/cpython/commit/aa9eb5f757ceff461e6e996f12c89e5d9b583b01 patch
- https://github.com/python/cpython/commit/dd8f187d0746da151e0025c51680979ac5b4cfb1 patch