Skip to main content

CPython CVE-2026-115791

| EUVDEUVD-2026-121328 MEDIUM
Inclusion of Functionality from Untrusted Control Sphere (CWE-829)
2026-11-10 PSF GHSA-mcvr-4p4q-h9hh
5.3
CVSS 4.0 · Vendor: PSF
View

Attack ChainAIDerived

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

  1. Access
    Deliver crafted archive to victim
  2. Delivery
    Victim runs python -m tarfile/zipfile extraction
  3. Exploit
    Extracted traceback.py shadows stdlib module
  4. Execution
    Decompression error triggers module import
  5. Impact
    Arbitrary code runs as the user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Trusted source inclusion only
Exploitation Conditions

Exploitation requires a victim to invoke CPython's tarfile, zipfile, or gzip command-line interface (python -m tarfile/zipfile/gzip) to extract an attacker-supplied archive into the current working directory. The archive must contain a Python file whose name shadows a standard-library module that is imported during error handling (the advisory specifically calls out traceback.py), and a decompression error must occur on a subsequent file so that the import - and thus the planted code - is triggered. Limiting factors that reduce real-world risk: active user interaction is required (UI:A - the victim must run the CLI themselves), the normal library/API use of tarfile/zipfile is not affected, and the attack is neutralized when Python runs in safe/isolated mode (-P, -I, or PYTHONSAFEPATH set), since sys._path0 is then None and the current directory is not prepended. Affects CPython before 3.16.0.

Impact

The vendor-supplied CVSS 4.0 base score is 5.3 (medium) with vector AV:L/AC:L/AT:P/PR:L/UI:A and high confidentiality/integrity impact (VC:H/VI:H, VA:N) - consistent with local arbitrary code execution rather than a remote network flaw. Key decision signals are muted: there is no EPSS score in the input, the CVE is NOT in CISA KEV (no public exploit identified at time of analysis), and no PoC/exploit reference is supplied - only the issue, patch PR, and PSF advisory. The vuln.today decision label is 'this_month' (not act_now/emergency), which matches a serious-but-not-urgent profile. The product footprint (CPython) is ubiquitous, but the exploitation path is narrow: it requires a victim to actively use the tarfile/zipfile/gzip CLI (python -m MODULE) to extract an attacker-supplied archive, so this is a targeted social-engineering-style vector, not a mass-exploitable remote hole. Net: a legitimate issue worth patching on a normal cycle, not a drop-everything emergency. Note a discrepancy to verify: the input sets PR:L, yet the attacker needs no privileges on the target - the only privilege involved is the victim's own when they run the CLI; the elevated-impact comes from code running as that user, not from attacker-held authentication.

Exploit ScenarioDerived

An attacker crafts a malicious archive containing a Python file named after a standard-library module imported during error handling (e.g. traceback.py). A victim extracts it with CPython's CLI, such as python -m tarfile -e evil.tar, in a working directory; because python -m MODULE prepends the current directory to sys.path and the archive is unpacked into that same directory, a decompression error on a later entry causes the planted module to be imported and its code executed with the victim's privileges. No public exploit code is identified at time of analysis, but the mechanism is fully described in the PSF advisory and patch.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Nov 10, 2026

Decompressing an attacker-supplied archive with CPython's tarfile, zipfile or gzip command-line interface can result in local code execution, because python -m prepends the current working directory to sys.path and the archive is unpacked into that same directory. A file in the archive that shadows a standard-library module imported during error handling - traceback.py is the case the advisory calls out - is executed when a subsequent file in the archive fails to decompress; the victim must invoke the CLI themselves to extract the archive. Per EUVD the affected range is CPython before 3.16.0, an upstream fix exists as PR 161706 with vendor patch status 'available', no public exploit was identified at time of analysis, and ordinary library/API use of tarfile and zipfile is not affected.

RemediationAI

Install a CPython build that contains upstream PR 161706 (https://github.com/python/cpython/pull/161706); EUVD's affected range of 0 to <3.16.0 implies 3.16.0 as the first release outside the vulnerable range, and the security-announce advisory (https://mail.python.org/archives/list/security-announce@python.org/thread/ZKKA4Q7B35JEHSDIJNZ6TYKRDQJUHDAG/) should be consulted for the exact patched versions on maintained branches, which the supplied data does not enumerate. The fix removes sys.path[0] from sys.path in the gzip, tarfile and zipfile CLIs via runpy._remove_sys_path0(), so after upgrading no further action is needed for those entry points. Until a patched interpreter is deployed, invoke the archive CLIs in safe or isolated mode (python -P -m tarfile, python -I -m zipfile, or with PYTHONSAFEPATH set), which leaves sys._path0 as None so the current directory is not prepended; the trade-off is that the interpreter will also stop honouring the script/module directory on sys.path, and -I additionally ignores PYTHON* environment variables and the user site-packages directory, which can break launchers that rely on them. Alternatively, avoid using the CLI to unpack untrusted archives inside the working directory - extract into a dedicated directory via the tarfile/zipfile library APIs, which are not affected by this flaw, or run the extraction with a working directory that contains no writable Python-importable files.

Affected VersionsENISA

CPython 0 <3.16.0

Affected Packages

euvd cpython fix: 3.16.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

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

Technical ContextAI · show details

CPython ships command-line front ends for its archive modules (python -m tarfile, python -m zipfile, and python -m gzip), and these extract into the process's current working directory. The runtime behaviour being abused is the sys.path[0] insertion performed at startup: under python -m MODULE the current directory is prepended to sys.path, so any .py file written into that directory by an extraction becomes importable ahead of the standard library. The advisory describes the trigger as an error while decompressing a later file in the same archive, which causes an import (traceback) to be resolved from the just-extracted, attacker-named file rather than from the stdlib. The programmatic tarfile/zipfile APIs are unaffected; only the CLI extraction path is. The upstream fix (PR 161706) introduces sys._path0 - the path the runtime prepended - and a runpy._remove_sys_path0() helper that deletes every exact copy of that value from sys.path, which the gzip, tarfile and zipfile CLIs now call before extracting. No CWE identifier is supplied in the source data, so the root cause is best characterised from the patch and advisory as an unsafe search-path condition during archive extraction. Running with -P, -I or PYTHONSAFEPATH leaves sys._path0 as None and the current directory is not prepended, which is why those modes neutralise the issue. Severity signals diverge: the vendor's CVSS 4.0 base score is 5.3 (AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:N), while the independent assessment scores it CVSS 3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N; both agree on local access, required user interaction, high confidentiality and integrity impact, and no availability impact. The CPE supplied is cpe:2.3:a:python_software_foundation:cpython, with EUVD listing CPython 0 through <3.16.0 as affected.

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 (PSF) PRIMARY 5.3 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
vuln.today AI 6.3 MEDIUM

Local archive-based delivery (AV:L) needing the victim to run the extraction CLI and an error to trigger (UI:R, AC:H); attacker holds no privileges (PR:N); planted code yields C:H/I:H, no availability impact.

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

Primary rating from Vendor (PSF).

CVSS VectorVendor: PSF

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

DescriptionCVE.org

When tarfile or zipfile command line interface (CLI) is used to

decompress an archive, a Python script shadowing the stdlib can be

created. Then if an error occurs during decompressing the next file,

the newly created Python script is executed. This is especially true

if the created Python is called traceback.py. The problem is that

Python adds the current directory to sys.path when python -m MODULE is

run, and the archive is also decompressed in the current directory.

The fix removes sys.path[0] in gzip, tarfile and zipfile command line

interface to prevent shadowing standard library modules from extracted

files.

Threat Intelligence Overview

EPSS Score
0.2%
Top 95% exploitable
Prevalence
Ubiquitous
CPython is the reference Python interpreter, present in nearly all environments
Data Quality
5 sources
Confidence: Medium

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.2%
Patch available Yes
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
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Total

Priority Score

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

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