Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2025-4138— Bypassing extraction filter to create symlinks to arbitrary targets outside extraction directory

CVSS 7.5 · High EPSS 1.15% · P64

Possible ATT&CK Techniques 1AI

T1083 · File and Directory Discovery
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2025-4138

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Bypassing extraction filter to create symlinks to arbitrary targets outside extraction directory
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Source: CVE Program / CVE List V5
Vulnerability Type
对路径名的限制不恰当(路径遍历)
Source: CVE Program / CVE List V5
Vulnerability Title
Python 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Python是Python基金会的一套开源的、面向对象的程序设计语言。该语言具有可扩展、支持模块和包、支持多种平台等特点。 Python 3.12及之后版本存在安全漏洞,该漏洞源于提取过滤器可被忽略,可能导致符号链接指向目标目录外和修改文件元数据。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
Python Software FoundationCPython 0 ~ 3.10.18 -

II. Public POCs for CVE-2025-4138

#POC DescriptionSource LinkShenlong Link
1CVE-2025-4138 / CVE-2025-4517 — Python tarfile PATH_MAX Symlink Filter Bypass https://github.com/DesertDemons/CVE-2025-4138-4517-POCPOC Details
2CVE-2025-4138 - Python Arbitrary file write outside extraction directoryhttps://github.com/thefizzyfish/CVE-2025-4138_tarfile_filter_bypassPOC Details
3A Python script to generate a malicious tar archive that exploits CVE-2025-4138 / CVE-2025-4517.https://github.com/kyakei/CVE-2025-4138-pocPOC Details
4Tarfile module directory traversal vulnerability ( with overflow crossed Directory ) --> Lead to Privilege escalation https://github.com/localh0ste/CVE-2025-4138POC Details
AI-Generated POCPremium
Qwen3.6-35B-A3B · 9110 chars
Pro+ exclusive includes:
Vulnerability reproduction recording (real sandbox build + trigger, exclusive)
In-depth vulnerability mechanism
Trigger conditions & impact
Full executable POC code
Exploit chain & mitigation
POC zip download
100+ AI POC generations per month

III. Intelligence Information for CVE-2025-4138

登录查看更多情报信息。

Patches & Fixes for CVE-2025-4138 (5)

Same Patch Batch · Python Software Foundation · 2025-06-03 · 5 CVEs total

CVE-2025-45179.4 CRITICALArbitrary writes via tarfile realpath overflow
CVE-2025-43307.5 HIGHExtraction filter bypass for linking outside extraction directory
CVE-2025-44357.5 HIGHTarfile extracts filtered members when errorlevel=0
CVE-2024-127185.3 MEDIUMBypass extraction filter to modify file metadata outside extraction directory

IV. Related Vulnerabilities

V. Comments for CVE-2025-4138

No comments yet


Leave a comment