Skip to content
NewA calmer, faster ZeroHour

CVE-2026-115791

Stdlib module shadowing in CPython tarfile/zipfile CLI

CVSS 4.0
5.3 medium
EPSS
—
Published
·
Modified
Analyze CVE-2026-115791 with Vani AIImpact, affected versions, exploitation status, mitigations and detection

Using Python's tarfile or zipfile CLI to extract an archive can create a script that shadows a standard-library module, such as traceback.py, in the current directory. If the next file fails to decompress, Python may import and run that script because python -m puts the current directory on sys.path. A local attacker who supplies the archive needs the operator to run the CLI and hit that error to execute code as that user. Affected CPython builds are not listed.

What to do: Apply CPython's update for CVE-2026-115791. The fix drops the current directory from sys.path in the gzip, tarfile, and zipfile command-line interfaces.

ProductAffected
Python CPython—
Estimated exposure
No basis for an estimate.

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description · NVD

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.

Weakness
CWE-829
Vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

1 story