
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-115791 is a stdlib shadowing vulnerability in CPython's tarfile, zipfile, and gzip command-line interfaces (CLIs) that can lead to arbitrary Python code execution. When decompressing an archive using these CLIs, a maliciously crafted archive can place a Python script (e.g., traceback.py) in the current working directory that shadows a standard library module; if an error occurs during subsequent file extraction, the rogue script is executed instead of the legitimate stdlib module. The vulnerability affects all CPython versions before 3.16.0 and is classified as MEDIUM severity with a CVSS v4.0 base score of 5.3 (Feedly, oss-security). It was disclosed on November 10, 2026, by CPython core developer Victor Stinner (CPython Issue).
The root cause is CWE-829 (Inclusion of Functionality from Untrusted Control Sphere): when python -m tarfile, python -m zipfile, or python -m gzip is invoked, Python automatically prepends the current working directory to sys.path[0]. Because archive extraction also targets the current directory, a crafted archive can deposit a Python file (most critically traceback.py) that shadows the identically named stdlib module. If a decompression error occurs for a subsequent file in the archive, Python's error-handling mechanism imports traceback, which resolves to the attacker-controlled file rather than the legitimate stdlib module, executing arbitrary code. The fix introduces runpy._remove_sys_path0() and a sys._path0 variable; the CLI entry points for gzip, tarfile, and zipfile now call this function to strip the current directory from sys.path before any extraction occurs (CPython PR, CPython Issue). Exploitation requires that the victim actively decompress a malicious archive using the Python CLI (python -m tarfile/zipfile/gzip) and that an extraction error be triggered for a subsequent file.
Successful exploitation allows an attacker to execute arbitrary Python code with the privileges of the user running the decompression command, resulting in high confidentiality and integrity impact (the attacker can read sensitive files and modify system state). Availability is not directly impacted by the vulnerability itself. The attack is local in nature and scoped to the vulnerable system; however, depending on the user's privilege level, it could facilitate privilege escalation or lateral movement within a compromised environment (Feedly, oss-security).
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the disclosure date (Feedly). The EPSS score is approximately 0.162%, indicating a low near-term probability of exploitation. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires user interaction (actively running the Python CLI to decompress a malicious archive) and a specific error condition during extraction, which limits its practical exploitability (Feedly, CPython Issue).
.tar, .zip, or .gz archive containing two entries: (a) a malicious Python script named traceback.py with the attacker's payload (e.g., reverse shell, data exfiltration), and (b) a second file that will trigger an extraction error (e.g., a file with an invalid path or permissions conflict).python -m tarfile -e malicious.tar . or python -m zipfile -e malicious.zip .).traceback.py will be written. The first file (traceback.py) is successfully extracted to the current directory.traceback module.traceback to the attacker-controlled traceback.py in the current directory (via sys.path[0]), executing the malicious payload with the privileges of the user running the command (CPython Issue, CPython PR).traceback.py or other stdlib-named .py files (e.g., os.py, sys.py) appearing in directories where archive extraction was performed; presence of archive files from untrusted sources in user-accessible directories.-m tarfile, -m zipfile, or -m gzip (e.g., outbound network connections, shell spawning, file writes outside the expected extraction directory).python -m tarfile, python -m zipfile, python -m gzip) followed by unexpected errors and subsequent process activity; audit logs recording creation of Python script files during archive extraction operations.The Python Software Foundation has addressed this vulnerability in CPython 3.16.0 and has backported the fix to branches 3.11, 3.12, 3.13, 3.14, and 3.15 (CPython PR, CPython Issue). Users should upgrade to the latest patched release for their Python branch as soon as available. As a workaround, avoid using python -m tarfile, python -m zipfile, or python -m gzip to decompress untrusted archives, particularly in directories where an attacker could pre-stage or inject files; use alternative extraction tools or validate archive contents before extraction (oss-security).
The vulnerability was reported and fixed by CPython core developer Victor Stinner, with the fix reviewed and approved by Seth Michael Larson, Ethan Furman, and Eclips4 (CPython PR). The Python Security team classified it as MEDIUM severity and issued a formal announcement via the security-announce@python.org mailing list (oss-security). The fix was also tracked by the Yocto Project security list and Debian security teams, indicating broad downstream awareness (Feedly).
Fix availability across major Linux distributions and their releases.
bionic (esm-apps)
python3.7
bionic (esm-infra)
python2.7
devel
python3.14
focal (esm-apps)
python2.7
focal (esm-infra)
python3.8
jammy
python2.7
jammy (esm-apps)
python2.7
noble
python3.12
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."