CVE-2025-4138

HIGH

Python <3 - Info Disclosure

Title source: llm

Description

Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata. 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 (5)

nomisec WORKING POC 7 stars
by DesertDemons · poc
https://github.com/DesertDemons/CVE-2025-4138-4517-POC
nomisec WORKING POC 1 stars
by thefizzyfish · poc
https://github.com/thefizzyfish/CVE-2025-4138_tarfile_filter_bypass
gitlab WORKING POC
by run3 · poc
https://gitlab.com/run3/test
nomisec WORKING POC
by kyakei · poc
https://github.com/kyakei/CVE-2025-4138-poc
nomisec WORKING POC
by localh0ste · poc
https://github.com/localh0ste/CVE-2025-4138

Scores

CVSS v3 7.5
EPSS 0.0007
EPSS Percentile 20.5%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Classification

CWE
CWE-22
Status draft

Timeline

Published Jun 03, 2025
Tracked Since Feb 18, 2026