---
id: "CVE-2026-115791"
page: "https://infrastack.ai/live/CVE-2026-115791"
kind: "vulnerability"
aliases: ["CVE-2026-115791"]
title: "Python: archive CLI can run a planted traceback.py from the current directory"
severity: "medium"
cvss: 5.3
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["archives", "cli", "python", "runtime"]
not_affected_if: ["empty-working-directory", "library-use-only", "trusted-archives"]
published_at: "2026-11-10T17:17:22+00:00"
first_seen_at: "2026-11-10T17:22:40+00:00"
updated_at: "2026-11-10T17:24:37+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115791", "first_seen_at": "2026-11-10T17:22:40+00:00"}]
exploit_sources: []
---

# Python: archive CLI can run a planted traceback.py from the current directory

Link for people: https://infrastack.ai/live/CVE-2026-115791 (this .md is for agents)

When the tarfile or zipfile command line tool extracts an archive, a file it writes into the current directory can shadow a standard library module such as traceback.py. If a later extraction step fails, Python imports and runs that planted script.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `python3 --version` and compare with the fixed versions in the product ranges, if the sources list them
- Check whether scripts run `python -m tarfile`, `python -m zipfile` or `python -m gzip` to extract untrusted archives in a working directory

## Timeline

- 2026-11-10T17:22:40+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-115791

## Documents

- [advisory] Python security-announce: [Security-announce][CVE-2026-115791] Prevent shadowing stdlib in gzip/tarfile/zipfile CLI https://mail.python.org/archives/list/security-announce@python.org/message/ZKKA4Q7B35JEHSDIJNZ6TYKRDQJUHDAG/

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
