CVE-2026-115791
When tarfile or zipfile command line interface (CLI) is used to decompress an archive, a Python script shadowing the stdlib can be created.
Impact
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.
An attacker can exploit this with local access to the system, with a regular user account, but a user has to actively do something, such as open a file or a link. Specific conditions have to be met, which makes an attack harder. If it succeeds: high risk of data being read, high risk of data or systems being changed.
Affected products · Python Software Foundation
| Product | Affected versions |
|---|---|
| CPython | before 3.16.0 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/python/cpython/issues/161705
- https://github.com/python/cpython/pull/161706
- https://mail.python.org/archives/list/security-announce@python.org/thread/ZKKA4Q7B35JEHSDIJNZ6TYKRDQJUHDAG/
- https://github.com/advisories/GHSA-mcvr-4p4q-h9hh
- https://nvd.nist.gov/vuln/detail/CVE-2026-115791
- https://mail.python.org/archives/list/security-announce@python.org/thread/ZKKA4Q7B35JEHSDIJNZ6TYKRDQJUHDAG
- http://www.openwall.com/lists/oss-security/2026/11/10/30