CVE-2025-4517: critical vulnerability in Python Software Foundation CPython
Arbitrary writes via tarfile realpath overflow
Published · Updated
E-mail alert when it lands in KEV, gets a public PoC or its score goes up.
48Vexday Risk Score
No sign of exploitation. It has a public proof of concept.
ssvc Attendcvss 9.4epss 1.4%
from disclosure to weapon257 days
Published on NVDJun 3
1st PoC+257d
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.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
Affected products
Python Software Foundation · CPythonpublic PoCs found — 8
githubgithub.com/0xDTC/CVE-2025-4517-tarfile-PATH_MAX-bypass★ 8githubgithub.com/AzureADTrent/CVE-2025-4517-POC★ 8githubgithub.com/StealthByte0/CVE-2025-4517-poc★ 2githubgithub.com/AnimePrincess420/CVE-2025-4517-PoC★ 2githubgithub.com/estebanzarate/CVE-2025-4517-Python-tarfile-filter-data-Bypass-PoC★ 0githubgithub.com/Rohitberiwala/PyPath-Escape-CVE-2025-4517-Exploit-Research★ 0githubgithub.com/kerburenthusiasm/CVE-2025-4517-PoC★ 0githubgithub.com/bgutowski/CVE-2025-4517-POC-Sudoers★ 0⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.
Related CVEs — Python Software Foundation CPython
In the same product, most dangerous first.
CVE-2024-7592HIGHQuadratic complexity parsing cookies with backslashesEPSS 2.3%CVE-2024-6232HIGHRegular-expression DoS when parsing TarFile headersEPSS 2.2%CVE-2024-12254HIGHUnbounded memory buffering in SelectorSocketTransport.writelines()EPSS 1.9%CVE-2025-13836MEDIUMExcessive read buffering DoS in http.clientEPSS 1.6%CVE-2025-0938MEDIUMURL parser allowed square brackets in domain namesEPSS 1.6%CVE-2025-4138HIGHBypassing extraction filter to create symlinks to arbitrary targets outside extraction directoryEPSS 1.4%
References
https://gist.github.com/sethmlarson/52398e33eff261329a0180ac1d54f42fhttps://github.com/python/cpython/commit/19de092debb3d7e832e5672cc2f7b788d35951dahttps://github.com/python/cpython/commit/28463dba112af719df1e8b0391c46787ad756dd9https://github.com/python/cpython/commit/3612d8f51741b11f36f8fb0494d79086bac9390ahttps://github.com/python/cpython/commit/4633f3f497b1ff70e4a35b6fe2c907cbe2d4cb2ehttps://github.com/python/cpython/commit/9c1110ef6652687d7c55f590f909720eddde965ahttps://github.com/python/cpython/commit/9e0ac76d96cf80b49055f6d6b9a6763fb9215c2ahttps://github.com/python/cpython/commit/aa9eb5f757ceff461e6e996f12c89e5d9b583b01https://github.com/python/cpython/commit/dd8f187d0746da151e0025c51680979ac5b4cfb1https://github.com/python/cpython/issues/135034https://github.com/python/cpython/pull/135037https://mail.python.org/archives/list/security-announce@python.org/thread/MAXIJJCUUMCL7ATZNDVEGGHUMQMUUKLG/