Vulnerability · Published Jun 3, 2025 · Assigned by PSF

CVE-2025-4517Arbitrary writes via tarfile realpath overflow

Critical 9.4

In plain English

A critical-severity path traversal in CPython from Python Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.5% (higher than 74% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.4Critical
Exploit odds (30 days)1.5%top 26.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official description

Allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8platform-python3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:8platform-python-debug3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:8platform-python-devel3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:10python-unversioned-command3.12.9-2.el10_0.2ALSA-2025:10140
AlmaLinux:9python-unversioned-command3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:9python33.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:9python3-debug3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:9python3-devel3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:8python3-idle3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:9python3-idle3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:8python3-libs3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:9python3-libs3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:8python3-test3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:9python3-test3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:8python3-tkinter3.6.8-70.el8_10.alma.1ALSA-2025:10128
AlmaLinux:9python3-tkinter3.9.21-2.el9_6.1ALSA-2025:10136
AlmaLinux:8python3.113.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.113.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.11-debug3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.11-debug3.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.11-devel3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.11-devel3.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.11-idle3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.11-idle3.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.11-libs3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.11-libs3.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.11-rpm-macros3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:8python3.11-test3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.11-test3.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.11-tkinter3.11.13-1.el8_10ALSA-2025:10026
AlmaLinux:9python3.11-tkinter3.11.11-2.el9_6.1ALSA-2025:10148
AlmaLinux:8python3.123.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.123.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python3.12-debug3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.12-debug3.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python3.12-devel3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.12-devel3.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python3.12-idle3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.12-idle3.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python3.12-libs3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.12-libs3.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python3.12-rpm-macros3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:8python3.12-test3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.12-test3.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python3.12-tkinter3.12.11-1.el8_10ALSA-2025:10031
AlmaLinux:9python3.12-tkinter3.12.9-1.el9_6.1ALSA-2025:10189
AlmaLinux:8python393.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-Cython0.29.21-5.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-Cython0.29.21-5.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-PyMySQL0.10.1-2.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-attrs20.3.0-2.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-cffi1.14.3-2.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-cffi1.14.3-2.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-chardet3.0.4-19.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-cryptography3.3.1-3.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-debug3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-devel3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-idle3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-idna2.10-4.module_el8.10.0+3849+a48d89aaALSA-2025:23530
AlmaLinux:8python39-iniconfig1.1.1-2.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-libs3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-lxml4.6.5-1.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-lxml4.6.5-1.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-mod_wsgi4.7.1-7.module_el8.10.0+3989+a618fe15.1ALSA-2025:23530
AlmaLinux:8python39-more-itertools8.5.0-2.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-numpy1.19.4-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-numpy1.19.4-3.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-numpy-doc1.19.4-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-numpy-f2py1.19.4-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-numpy-f2py1.19.4-3.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-packaging20.4-4.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pip20.2.4-9.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-pip-wheel20.2.4-9.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-pluggy0.13.1-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-ply3.11-10.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-psutil5.8.0-4.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-psutil5.8.0-4.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-psycopg22.8.6-3.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-psycopg2-doc2.8.6-3.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-psycopg2-tests2.8.6-3.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-py1.10.0-1.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pybind112.7.1-1.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pybind112.7.1-1.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-pybind11-devel2.7.1-1.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-pybind11-devel2.7.1-1.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pycparser2.20-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pyparsing2.4.7-5.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pysocks1.7.1-4.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pytest6.0.2-2.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pyyaml5.4.1-1.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-pyyaml5.4.1-1.module_el8.6.0+3248+c431e88cALSA-2025:23530
AlmaLinux:8python39-requests2.25.0-3.module_el8.9.0+3634+fb2a896cALSA-2025:23530
AlmaLinux:8python39-rpm-macros3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-scipy1.5.4-5.module_el8.9.0+3634+fb2a896cALSA-2025:23530
AlmaLinux:8python39-setuptools50.3.2-7.module_el8.10.0+4040+9207bbc0ALSA-2025:23530
AlmaLinux:8python39-setuptools-wheel50.3.2-7.module_el8.10.0+4040+9207bbc0ALSA-2025:23530
AlmaLinux:8python39-six1.15.0-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-test3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-tkinter3.9.25-2.module_el8.10.0+4083+53cad1fbALSA-2025:23530
AlmaLinux:8python39-toml0.10.1-5.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-urllib31.25.10-5.module_el8.10.0+3765+2f9a457dALSA-2025:23530
AlmaLinux:8python39-wcwidth0.2.5-3.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-wheel1:0.35.1-4.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
AlmaLinux:8python39-wheel-wheel1:0.35.1-4.module_el8.6.0+2780+a40f65e1ALSA-2025:23530
Alpine:v3.20python33.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.21python33.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.22python33.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.23python33.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.24python33.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.20python3-tkinter3.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.21python3-tkinter3.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.22python3-tkinter3.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.23python3-tkinter3.12.11-r0ALPINE-CVE-2025-4517
Alpine:v3.24python3-tkinter3.12.11-r0ALPINE-CVE-2025-4517
Debian:12pypy3no fix listedDEBIAN-CVE-2025-4517
Debian:13pypy3no fix listedDEBIAN-CVE-2025-4517
Debian:14pypy37.3.20+dfsg-2DEBIAN-CVE-2025-4517
Debian:13python3.133.13.4-1DEBIAN-CVE-2025-4517
Rocky Linux:8Cython0:0.29.21-5.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8Cython0:0.29.21-5.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8PyYAML0:5.4.1-1.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8PyYAML0:5.4.1-1.module+el8.9.0+1418+f0d66789RLSA-2025:23530
Rocky Linux:8PyYAML0:5.4.1-1.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8mod_wsgi0:4.7.1-7.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8mod_wsgi0:4.7.1-7.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8mod_wsgi0:4.7.1-7.module+el8.10.0+1978+d4f111ba.1RLSA-2025:23530
Rocky Linux:8numpy0:1.19.4-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8numpy0:1.19.4-3.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8pybind110:2.7.1-1.module+el8.9.0+1357+a3b80af7RLSA-2025:23530
Rocky Linux:8pytest0:6.0.2-2.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8pytest0:6.0.2-2.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-PyMySQL0:0.10.1-2.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-PyMySQL0:0.10.1-2.module+el8.10.0+1592+61442852RLSA-2025:23530
Rocky Linux:8python-PyMySQL0:0.10.1-2.module+el8.10.0+1910+234ad790RLSA-2025:23530
Rocky Linux:8python-PyMySQL0:0.10.1-2.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-attrs0:20.3.0-2.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-attrs0:20.3.0-2.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-cffi0:1.14.3-2.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-cffi0:1.14.3-2.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-chardet0:3.0.4-19.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-chardet0:3.0.4-19.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-chardet0:3.0.4-19.module+el8.9.0+1418+f0d66789RLSA-2025:23530
Rocky Linux:8python-cryptography0:3.3.1-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-cryptography0:3.3.1-3.module+el8.10.0+1697+7e517775RLSA-2025:23530
Rocky Linux:8python-idna0:2.10-4.module+el8.10.0+1809+41195054RLSA-2025:23530
Rocky Linux:8python-idna0:2.10-4.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-iniconfig0:1.1.1-2.module+el8.9.0+1332+dd574197RLSA-2025:23530
Rocky Linux:8python-lxml0:4.6.5-1.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-more-itertools0:8.5.0-2.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-more-itertools0:8.5.0-2.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-packaging0:20.4-4.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-packaging0:20.4-4.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-pluggy0:0.13.1-3.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-pluggy0:0.13.1-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-ply0:3.11-10.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-ply0:3.11-10.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-ply0:3.11-10.module+el8.9.0+1418+f0d66789RLSA-2025:23530
Rocky Linux:8python-psutil0:5.8.0-4.module+el8.9.0+1357+a3b80af7RLSA-2025:23530
Rocky Linux:8python-psycopg20:2.8.6-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-psycopg20:2.8.6-3.module+el8.10.0+1660+b5b6f004RLSA-2025:23530
Rocky Linux:8python-py0:1.10.0-1.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-py0:1.10.0-1.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-pycparser0:2.20-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-pycparser0:2.20-3.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-pysocks0:1.7.1-4.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-pysocks0:1.7.1-4.module+el8.9.0+1418+f0d66789RLSA-2025:23530
Rocky Linux:8python-pysocks0:1.7.1-4.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-requests0:2.25.0-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-requests0:2.25.0-3.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-toml0:0.10.1-5.module+el8.9.0+1332+dd574197RLSA-2025:23530
Rocky Linux:8python-urllib30:1.25.10-5.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-urllib30:1.25.10-5.module+el8.10.0+1545+03246da9RLSA-2025:23530
Rocky Linux:8python-wcwidth0:0.2.5-3.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-wcwidth0:0.2.5-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python-wheel1:0.35.1-4.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python-wheel1:0.35.1-4.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python30:3.6.8-70.el8_10.rocky.0RLSA-2025:10128
Rocky Linux:8python3.110:3.11.13-1.el8_10RLSA-2025:10026
Rocky Linux:9python3.110:3.11.11-2.el9_6.1RLSA-2025:10148
Rocky Linux:10python3.120:3.12.9-2.el10_0.2RLSA-2025:10140
Rocky Linux:8python3.120:3.12.11-1.el8_10RLSA-2025:10031
Rocky Linux:9python3.120:3.12.9-1.el9_6.1RLSA-2025:10189
Rocky Linux:9python3.90:3.9.21-2.el9_6.1RLSA-2025:10136
Rocky Linux:8python3x-pip0:20.2.4-9.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python3x-pip0:20.2.4-9.module+el8.10.0+1721+e52d6351RLSA-2025:23530
Rocky Linux:8python3x-pyparsing0:2.4.7-5.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8python3x-pyparsing0:2.4.7-5.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python3x-setuptools0:50.3.2-7.module+el8.10.0+2057+30213a2bRLSA-2025:23530
Rocky Linux:8python3x-six0:1.15.0-3.module+el8.10.0+1582+bc278001RLSA-2025:23530
Rocky Linux:8python3x-six0:1.15.0-3.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8scipy0:1.5.4-5.module+el8.10.0+1860+afcc1c71RLSA-2025:23530
Rocky Linux:8scipy0:1.5.4-5.module+el8.10.0+1582+bc278001RLSA-2025:23530
Ubuntu:24.04:LTSpython3.123.12.3-1ubuntu0.7USN-7583-1
Ubuntu:24.04:LTSpython3.123.12.3-1ubuntu0.7UBUNTU-CVE-2025-4517
Ubuntu:25.10python3.143.14.0-1UBUNTU-CVE-2025-4517

Affected products (as reported)

VendorProductVersions
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:H/I:H/A:L

References