Skip to main content

Python shutil EUVDEUVD-2026-25922

| CVE-2026-3087 MEDIUM
Path Traversal (CWE-22)
2026-04-27 cna@python.org
6.0
CVSS 4.0 · Vendor: python
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Supply crafted ZIP with `C:\target\path` entry
  2. Delivery
    Deliver ZIP to Windows Python application accepting uploads
  3. Exploit
    Application invokes `shutil.unpack_archive()`
  4. Install
    Drive-letter prefix evades `/` and `..` checks
  5. C2
    `os.path.join()` resets base to attacker-controlled absolute path
  6. Execute
    Arbitrary file written outside extraction directory
  7. Impact
    Leveraged for DLL hijack or persistence

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Three specific conditions must all be satisfied: (1) the target application runs on Windows - this vulnerability is explicitly Windows-only; Linux and macOS handle drive-letter path components as literal filenames and are unaffected; (2) the application calls shutil.unpack_archive() (or the underlying _unpack_zipfile()) on a ZIP file whose content the attacker can control or influence, such as through a file-upload feature, a download-and-extract workflow, or an artifact processing pipeline; and (3) the Python process has write permissions to the absolute path specified in the malicious ZIP entry - if the process runs as a low-privilege account without write access to sensitive directories, the file write will fail or be limited to less impactful locations. Exploitation is further constrained by CVSS 4.0's AT:P designation, confirming that prerequisites beyond network access are required. Applications that only process ZIP files from trusted internal sources are not at risk regardless of OS.

Impact

The CVSS 4.0 score of 6.0 with AT:P (attack prerequisites present) accurately reflects the conditional nature of this vulnerability - exploitation requires a Windows execution environment, which limits the realistic attack surface compared to a cross-platform flaw. The VI:H (high integrity impact on the vulnerable system) is well-founded: arbitrary file write outside the extraction boundary can be chained to DLL hijacking, startup persistence, or configuration file manipulation if the Python process holds sufficient OS privileges. EPSS of 0.05% at the 14th percentile strongly suggests no current automated exploitation in the wild, consistent with SSVC's 'Automatable: no' and 'Exploitation: none' designations. SSVC's 'Technical Impact: partial' appears conservative - arbitrary file writes are frequently the final step before full code execution. The absence of a CISA KEV listing and confirmed public POC means this is a theoretical-but-credible risk rather than an active threat. Real-world priority should be elevated for Windows-hosted Python services that accept user-supplied ZIP files (build pipelines, file processors, deployment tools); it can be deprioritized for environments where all ZIP inputs are internally trusted.

Exploit ScenarioDerived

An attacker submits a crafted ZIP archive to a Windows-hosted Python web application's file-upload endpoint; the archive contains a member named C:/Windows/System32/malicious.dll. When the application calls shutil.unpack_archive() on the uploaded file, the drive-letter path bypasses all sanitization and the file is written to C:\Windows\System32\malicious.dll. If the process runs with elevated privileges, the attacker can achieve persistent code execution via DLL hijacking on the next application or OS restart. No confirmed public POC exists at time of analysis, so this scenario remains theoretical.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Path traversal in CPython's shutil.unpack_archive() on Windows allows arbitrary file writes outside the intended extraction directory when processing ZIP archives containing Windows drive-letter absolute paths (e.g., C:\..., D:\...). The existing sanitization in _unpack_zipfile() rejected only Unix-style absolute paths (/) and directory traversal sequences (..), leaving Windows drive specifiers completely unchecked. No public exploit has been identified at time of analysis; EPSS of 0.05% (14th percentile) and SSVC exploitation status of 'none' indicate no observed exploitation, though the high integrity impact warrants patching in environments that process untrusted ZIP archives on Windows.

RemediationAI

Upgrade to a patched CPython release once available; fixes have been committed to multiple CPython maintenance branches via commits ab5ef98, b01e594, fc829e8, 65b2554, 8e13025, 8ee6aff, and ba0aca3 (consolidated in PR #146591 at https://github.com/python/cpython/pull/146591), but a specific tagged release version containing these patches has not been confirmed in the available data - monitor the Python security announcements list at https://mail.python.org/archives/list/security-announce@python.org/ for an official release notice. As an interim compensating control, applications that process user-supplied ZIP files on Windows should pre-filter all member filenames before calling shutil.unpack_archive(), rejecting any entry whose name matches a Windows drive-letter pattern (e.g., re.match(r'^[A-Za-z]:', name)) or any absolute-rooted form; this adds a validation step that the callee currently omits. Alternatively, replace shutil.unpack_archive() with a custom extraction loop that calls os.path.splitroot() and discards entries where the drive or root component is non-empty. Restricting upload functionality to authenticated, trusted users reduces exposure but does not eliminate the path traversal defect. Running the Python process under a low-privilege account without write access to sensitive system directories (e.g., C:\Windows\System32) is a defense-in-depth measure that limits the impact of successful exploitation.

Affected VersionsENISA

CPython 0

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerable code in Lib/shutil.py iterated over ZIP entries and used os.path.join(extract_dir, *name.split('/')) to construct target paths. On Windows, Python's os.path.join() silently discards preceding components when a path element contains a drive root (e.g., C:\), so a ZIP entry named C:/Windows/evil.dll would resolve entirely to C:\Windows\evil.dll, ignoring extract_dir. The original filter checked only for names starting with / or containing .., missing Windows-specific absolute forms such as C:/, D:\, E:relative, //server/share, and \\server2\share. The CWE-22 root cause is path traversal via absolute path injection rather than relative component escape. CPE strings confirm all CPython versions are affected (cpe:2.3:a:python:python:*:*:*:*:*:*:*:*) exclusively on Windows; macOS and Linux handle these path components literally and are not vulnerable. The fix (PR #146591) replaces manual extraction with zipfile.ZipFile.extractall() under a new _ignore_invalid_names flag and adds os.path.splitroot() logic in zipfile._extract_member() to detect and discard entries with drive letters, root separators, or post-sanitization name changes.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (python) PRIMARY 6.0 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

No authentication inherent to the library; Windows-only prerequisite captured by context, not AC; high integrity from arbitrary write; no confidentiality or availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (python).

CVSS VectorVendor: python

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

If shutil.unpack_archive() is given a ZIP archive with an absolute Windows path containing a drive (C:\\...) then the archive will be extracted outside the target directory which is different than other operating systems. Only Windows is affected by this vulnerability.

Threat Intelligence Overview

EPSS Score
0.0%
Top 86% exploitable
Prevalence
High
Python standard library, widely deployed across enterprise and cloud environments
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy