Skip to main content
← All vulnerabilities
CVE-2025-4517

Arbitrary writes via tarfile realpath overflow

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4, and 1 more
8 proofs of concept on GitHub
  • Exploitation: none
  • Automatable: yes
  • Technical impact: total

Summary

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: yes · Technical impact: total

  3. Record last updated

Affected versions

  • Python Software Foundation CPython

    fixed in 3.9.23; From 3.10.0 · fixed in 3.10.18; From 3.11.0 · fixed in 3.11.13; From 3.12.0 · fixed in 3.12.11; From 3.13.0 · fixed in 3.13.4; From 3.14.0a1 · fixed in 3.14.0b3

References 20

GitHub · python/cpython

mail.python.org

gist.github.com

GitHub · 0xDTC/CVE-2025-4517-tarfile-PATH_MAX-bypass

GitHub · AnimePrincess420/CVE-2025-4517-PoC

GitHub · AzureADTrent/CVE-2025-4517-POC

GitHub · Rohitberiwala/PyPath-Escape-CVE-2025-4517-Exploit-Research

GitHub · StealthByte0/CVE-2025-4517-poc

GitHub · bgutowski/CVE-2025-4517-POC-Sudoers

GitHub · estebanzarate/CVE-2025-4517-Python-tarfile-filter-data-Bypass-PoC

GitHub · kerburenthusiasm/CVE-2025-4517-PoC