Vulnerability DatabaseCVE-2026-115791

CVE-2026-115791: 
Python Interpreter vulnerability analysis and mitigation

Overview

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).

Technical details

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.

Impact

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).

Exploitability

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).

Exploitation steps

  1. Craft a malicious archive: Create a .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).
  2. Deliver the archive: Social-engineer or otherwise deliver the malicious archive to a target who will decompress it using the Python CLI (e.g., python -m tarfile -e malicious.tar . or python -m zipfile -e malicious.zip .).
  3. Trigger extraction: The victim runs the Python CLI decompression command in a working directory where the attacker's traceback.py will be written. The first file (traceback.py) is successfully extracted to the current directory.
  4. Trigger the error: The second file in the archive causes an extraction error (e.g., a file that conflicts with an existing path or has an invalid name), causing Python's error-handling to import the traceback module.
  5. Code execution: Python resolves 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).

Indicators of compromise

  • File System: Unexpected 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.
  • Process: Unusual child processes spawned by a Python interpreter invoked with -m tarfile, -m zipfile, or -m gzip (e.g., outbound network connections, shell spawning, file writes outside the expected extraction directory).
  • Logs: System or application logs showing Python CLI invocations (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.

Mitigation and workarounds

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).

Community reactions

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).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

python3.11

Affected

sid

python3.15

Affected

trixie

python3.13

Affected

Ubuntu

Unknown

bionic (esm-apps)

python3.7

Unknown

bionic (esm-infra)

python2.7

Unknown

devel

python3.14

Unknown

focal (esm-apps)

python2.7

Unknown

focal (esm-infra)

python3.8

Unknown

jammy

python2.7

Unknown

jammy (esm-apps)

python2.7

Unknown

noble

python3.12

Unknown

RHEL / CentOS

Affected

RHEL 8

Not Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

Source: This report was generated using AI

Related Python Interpreter vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-115559MEDIUM6.3
  • Python Interpreter logoPython Interpreter
  • python3.16-debuginfo
NoYesNov 10, 2026
CVE-2026-124249MEDIUM6.3
  • Python Interpreter logoPython Interpreter
  • python3.12-idle
NoYesNov 09, 2026
CVE-2026-115791MEDIUM5.3
  • Python Interpreter logoPython Interpreter
  • python3
NoYesNov 10, 2026
CVE-2026-16052LOW2.3
  • Python Interpreter logoPython Interpreter
  • python3.14-freethreading-libs
NoYesNov 12, 2026
CVE-2026-19552NONEN/A
  • Python Interpreter logoPython Interpreter
  • python-tools
NoYesNov 09, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management