CVE-2025-4517

CRITICAL

Python <3.14 - Path Traversal

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 16 public exploits for CVE-2025-4517. PoCs published by DesertDemons, AzureADTrent, adminlove520.

AI-analyzed exploit summary This repository provides a detailed technical analysis of CVE-2025-4138 and CVE-2025-4517, which involve a path traversal vulnerability in Python's tarfile module. The vulnerability allows arbitrary file writes through symlink manipulation and filter bypass, leading to privilege escalation.

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.

Exploits (16)

github WRITEUP 10 stars
by DesertDemons · pythonpoc
https://github.com/DesertDemons/CVE-2025-4138-4517-POC

This repository provides a detailed technical analysis of CVE-2025-4138 and CVE-2025-4517, which involve a path traversal vulnerability in Python's tarfile module. The vulnerability allows arbitrary file writes through symlink manipulation and filter bypass, leading to privilege escalation.

Classification
Writeup 100%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (versions 3.12.0-3.12.10, 3.13.0-3.13.3)
No auth needed
Prerequisites: Vulnerable Python version · Privileged process extracting untrusted tar archives
devstral-2 · analyzed Feb 19, 2026 Full analysis →
nomisec WORKING POC 6 stars
by AzureADTrent · poc
https://github.com/AzureADTrent/CVE-2025-4517-POC

This repository contains a functional exploit for CVE-2025-4517, which leverages a tarfile symlink bypass via hardlink to achieve privilege escalation by writing to /etc/sudoers. The exploit uses a combination of deep directory structures, symlink chains, and hardlinks to bypass Python's tarfile filter protections.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Complex
Reliability
Reliable
Target: Python 3.8.0 - 3.13.1 with tarfile filter bypass
No auth needed
Prerequisites: Access to a system with vulnerable Python version · Ability to execute the exploit script
devstral-2 · analyzed Mar 15, 2026 Full analysis →
github WORKING POC 2 stars
by adminlove520 · pythonpoc
https://github.com/adminlove520/CVE-Poc_All_in_One/tree/main/2025/CVE-2025-4517

This repository contains functional exploit code for multiple CVEs, including authentication bypass vulnerabilities in TOTOLINK devices and a scanner for Fortinet SSL VPN (CVE-2024-21762). The PoCs demonstrate the vulnerabilities with clear technical details and functional code.

Classification
Working Poc 90%
Attack Type
Auth Bypass
Complexity
Trivial
Reliability
Reliable
Target: TOTOLINK LR350, TOTOLINK T6, Fortinet SSL VPN
No auth needed
Prerequisites: network access to the target device
devstral-2 · analyzed Feb 27, 2026 Full analysis →
nomisec WORKING POC 2 stars
by AnimePrincess420 · poc
https://github.com/AnimePrincess420/CVE-2025-4517-PoC

This PoC exploits CVE-2025-4517, a path traversal vulnerability in Python's tarfile module, to overwrite /etc/sudoers and grant arbitrary users sudo privileges. It constructs a malicious tar archive with symlinks to bypass path checks and injects a sudoers entry for a specified user.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (versions affected by CVE-2025-4517)
No auth needed
Prerequisites: Ability to place a malicious tar file in a location processed by a vulnerable application · Vulnerable application using tarfile.extract() or extractall() with filter='data' or 'tar'
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 1 stars
by Gh0s7Ops · poc
https://github.com/Gh0s7Ops/CVE-2025-4517-POC

This repository contains a functional exploit for CVE-2025-4517, leveraging a tarfile symlink bypass via hardlink manipulation to achieve privilege escalation by writing to /etc/sudoers. The exploit uses a multi-phase approach with deep directory structures and symlink chains to bypass Python's tarfile filter protections.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (versions 3.8.0 - 3.13.1)
Auth required
Prerequisites: Access to a vulnerable Python environment · Ability to execute the exploit script · Write access to a directory where the malicious tar can be deployed
devstral-2 · analyzed Mar 03, 2026 Full analysis →
nomisec WORKING POC 1 stars
by ben-slates · poc
https://github.com/ben-slates/CVE-2025-4517-POC

This repository contains a functional exploit for CVE-2025-4517, leveraging a tarfile symlink and hardlink bypass to achieve privilege escalation by writing to /etc/sudoers. The exploit creates a malicious tar archive that manipulates path traversal and hardlinks to bypass Python's tarfile filter protections.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python 3.8.0 - 3.13.1 with tarfile module
No auth needed
Prerequisites: Access to a system with vulnerable Python version · Ability to execute the exploit script
devstral-2 · analyzed Feb 23, 2026 Full analysis →
nomisec WORKING POC 1 stars
by AzureADTrent · poc
https://github.com/AzureADTrent/CVE-2025-4517-POC-HTB-WingData

This repository contains a functional exploit for CVE-2025-4517, which leverages a tarfile symlink bypass via hardlink to achieve privilege escalation by writing to /etc/sudoers. The exploit uses a combination of deep directory structures, symlink loops, and hardlinks to bypass Python's tarfile filter protections.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python 3.8.0 - 3.13.1 with tarfile filter bypass
No auth needed
Prerequisites: Access to a system with vulnerable Python version · Ability to execute the exploit script
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 1 stars
by StealthByte0 · poc
https://github.com/StealthByte0/CVE-2025-4517-poc

This PoC exploits a path traversal vulnerability in Python's tarfile module (CVE-2025-4517) to overwrite arbitrary files, specifically targeting /etc/sudoers. It uses a combination of symlink loops, hard links, and directory traversal to achieve arbitrary file write during tar extraction.

Classification
Working Poc 95%
Attack Type
Other
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (3.12+ with filter='data' or 'tar')
No auth needed
Prerequisites: Vulnerable Python version (3.12+ with specific filter settings) · Ability to deliver malicious tar file to target · Target system must extract the tar file
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by estebanzarate · poc
https://github.com/estebanzarate/CVE-2025-4517-Python-tarfile-filter-data-Bypass-PoC

This repository contains a functional exploit for CVE-2025-4517, which bypasses Python's tarfile filter='data' sandbox by crafting paths exceeding PATH_MAX, allowing arbitrary file writes. The PoC writes an SSH public key to /root/.ssh/authorized_keys for root access.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (versions 3.8.0 - 3.13.1)
No auth needed
Prerequisites: Access to a system with vulnerable Python version · Ability to execute Python scripts · Write access to a directory where the exploit tar can be deployed
devstral-2 · analyzed Feb 20, 2026 Full analysis →
github WORKING POC
by Kl3lCrypt · pythonpoc
https://github.com/Kl3lCrypt/cve-exploits/tree/main/CVE-2025-4517

The repository contains functional exploit code for CVE-2025-4517, demonstrating a tarfile directory traversal vulnerability. The Python script creates a malicious tar archive with deep directory structures and symbolic links, which can be used to exploit the vulnerability.

Classification
Working Poc 90%
Attack Type
Other
Complexity
Moderate
Reliability
Reliable
Target: Unknown (likely a tarfile processing library or application)
No auth needed
Prerequisites: Ability to deliver a malicious tarfile to the target system
devstral-2 · analyzed Feb 27, 2026 Full analysis →
nomisec WORKING POC
by ben-slates · poc
https://github.com/ben-slates/CVE-2025-4517-POC-HTB-WINGDATA

This repository contains a functional exploit for CVE-2025-4517, which leverages a tarfile symlink and hardlink bypass in Python to achieve privilege escalation by writing to /etc/sudoers. The exploit creates a malicious tar archive that manipulates path traversal and hardlinks to bypass Python's tarfile filter protections.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python 3.8.0 - 3.13.1 with tarfile filter bypass
No auth needed
Prerequisites: Access to a system with vulnerable Python version · Ability to execute the exploit script
devstral-2 · analyzed Feb 19, 2026 Full analysis →
github WORKING POC
by bgutowski · pythonpoc
https://github.com/bgutowski/CVE-2025-4517-POC-Sudoers

This repository contains a functional exploit for CVE-2025-4517, leveraging a PATH_MAX overflow in Python's tarfile module to bypass security filters and write arbitrary files. The exploit specifically targets /etc/sudoers.d/ to achieve local privilege escalation by adding a user to the sudoers file.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (versions affected by CVE-2025-4517)
No auth needed
Prerequisites: Local access to the target system · Ability to execute Python code · Write permissions in a directory where the malicious tar file can be created
devstral-2 · analyzed Feb 19, 2026 Full analysis →
nomisec WORKING POC
by kerburenthusiasm · poc
https://github.com/kerburenthusiasm/CVE-2025-4517-PoC

This PoC exploits a directory traversal vulnerability in tar archive handling, allowing arbitrary file write via crafted symlinks and path traversal sequences. The script generates a malicious tar file that can escape intended directories and write files to arbitrary locations on the system.

Classification
Working Poc 95%
Attack Type
Other
Complexity
Moderate
Reliability
Reliable
Target: tar archive extraction utilities (version not specified)
No auth needed
Prerequisites: Ability to deliver a malicious tar file to the target system · Target system must extract the tar file
devstral-2 · analyzed Feb 19, 2026 Full analysis →
github WORKING POC
by kyakei · pythonpoc
https://github.com/kyakei/CVE-2025-4138-poc

This repository contains a functional Python script that generates a malicious tar archive exploiting CVE-2025-4138/CVE-2025-4517 (PATH_MAX truncation in Python's tarfile module) to achieve local privilege escalation by writing to /etc/sudoers.d/. The exploit constructs a symlink chain to bypass path resolution checks and injects a sudoers file granting passwordless root access.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: Python (3.12.0–3.12.10, 3.13.0–3.13.3)
No auth needed
Prerequisites: Access to a system with a vulnerable Python version · Ability to transfer and extract the malicious tar archive via a privileged process
devstral-2 · analyzed Feb 19, 2026 Full analysis →
nomisec WORKING POC
by Rohitberiwala · poc
https://github.com/Rohitberiwala/PyPath-Escape-CVE-2025-4517-Exploit-Research

This repository contains a functional exploit for CVE-2025-4517, which leverages a PATH_MAX overflow in Python's tarfile module to bypass symlink filters during tar extraction. The exploit constructs a malicious tar archive that can write arbitrary files to sensitive locations (e.g., /root/.ssh/authorized_keys) by chaining symlinks to exceed path length limits.

Classification
Working Poc 95%
Attack Type
Other
Complexity
Moderate
Reliability
Reliable
Target: Python tarfile module (likely affecting multiple versions)
No auth needed
Prerequisites: Ability to deliver a malicious tar archive to the target system · Target system must extract the archive using Python's tarfile module
devstral-2 · analyzed Feb 19, 2026 Full analysis →
nomisec WORKING POC
by 0xDTC · poc
https://github.com/0xDTC/CVE-2025-4517-tarfile-PATH_MAX-bypass

This repository contains a functional exploit PoC for CVE-2025-4517, which bypasses Python's tarfile.extractall filter via a PATH_MAX overflow in os.path.realpath(). The exploit generates a malicious tar archive that writes arbitrary files outside the extraction directory.

Classification
Working Poc 95%
Attack Type
Other
Complexity
Moderate
Reliability
Reliable
Target: Python 3.12.0-3.12.10, 3.13.0-3.13.3, 3.14.0a1-3.14.0a7
No auth needed
Prerequisites: Vulnerable Python version · Ability to deliver malicious tar archive to target
devstral-2 · analyzed Feb 19, 2026 Full analysis →

Scores

CVSS v3 9.4
EPSS 0.0040
EPSS Percentile 61.4%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L

CISA SSVC

Vulnrichment
Exploitation none
Automatable yes
Technical Impact total

Details

CWE
CWE-22
Status published
Products (7)
Python Software Foundation/CPython < 3.10.18
Python Software Foundation/CPython < 3.9.23
Python Software Foundation/CPython 3.10.0 - 3.10.18
Python Software Foundation/CPython 3.11.0 - 3.11.13
Python Software Foundation/CPython 3.12.0 - 3.12.11
Python Software Foundation/CPython 3.13.0 - 3.13.4
Python Software Foundation/CPython 3.14.0a1 - 3.14.0b3
Published Jun 03, 2025
Tracked Since Feb 18, 2026