Link following in Python - CVE-2025-4138

 

Link following in Python - CVE-2025-4138

Published: June 26, 2025 / Updated: April 1, 2026


Vulnerability identifier: #VU111968
CSH Severity: High
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P/U:Amber
CVE-ID: CVE-2025-4138
CWE-ID: CWE-59
Exploitation vector: Remote access
Exploit availability: Public exploit is available
Vendor: Python.org
Affected software:
Python

Detailed vulnerability description

The vulnerability allows a remote attacker to compromise the affected system.

The vulnerability exists due to an insecure link following issue when extracting data from an archive in the tarfile module. A remote attacker can pass a specially crafted archive to the application and overwrite arbitrary files outside the destination directory during extraction with filter="data"..


How to mitigate CVE-2025-4138

Install updates from vendor's website.

Sources