Module shadowing in CPython gzip, tarfile and zipfile CLI
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- Active
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-829.
Summary
CPython from 0 before 3.16.0 has a flaw in the gzip, tarfile and zipfile command line interfaces. Python adds the current directory to the module search path, so a Python file extracted from an archive can shadow a standard library module (CWE-829). A local user with low privileges can cause such a file to run during a later extraction error, which may require user interaction.
Written with Claude Haiku 5.5 from the sources below · 2026-11-11
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Python Software Foundation | CPython | before 3.16.0 | 3.16.0 | Patch available | CNA |
- CPython VendorPython Software Foundation Affected before 3.16.0 Fixed in 3.16.0 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python:python:*:*:*:*:*:*:*:* | — | — | python-pillow |
- cpe:2.3:a:python:python:*:*:*:*:*:*:*:* Versions — — ·python-pillow
Remediation
Upgrade CPython to 3.16.0, which removes the current directory from the module search path in these command line interfaces.
Written with Claude Haiku 5.5 from the sources below · 2026-11-11
- Fix · CNA CPython (Python Software Foundation) Fixed in 3.16.0
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
Python Software Foundation CPython 3.16.0
2 records Highest priority Priority LOW 2 LOW
Other records, highest priority first
- TI-2026-89064 Plaintext bytes buffered before STARTTLS are trusted in imaplibPriority LOW 28
Timeline
- 2026-11-10 Threatist record created from CVE-2026-115791
- 2026-11-10 Weakness changed · CISA ADP
- 2026-11-10 CISA SSVC decision points changed
- 2026-11-10 Alias added: GHSA-mcvr-4p4q-h9hh
- 2026-11-11 CISA SSVC decision points changed
References
More Python Software Foundation vulnerabilities
- TI-2024-07037 Quadratic complexity parsing cookies with backslashes CVSS 3.1HIGH 7.5
- TI-2024-11791 Bypass extraction filter to modify file metadata outside extraction directory CVSS 3.1MEDIUM 5.3
- TI-2024-00411 Quoted zip-bomb protection for zipfile CVSS 3.1MEDIUM 6.2
- TI-2026-13296 `HTTPPasswordMgr` can send saved HTTPS credentials via HTTP because of incorrect scheme matching CVSS 4.0MEDIUM 6.0
- TI-2024-06422 Email header injection due to unquoted newlines CVSS 3.1MEDIUM 5.5
- TI-2026-04606 Possible to hijack modules in current working directory CVSS 4.0MEDIUM 5.6
Sources
- CVE-2026-115791 · CVE Program
- CVE-2026-115791 · NVD
- FIRST EPSS
- GHSA-mcvr-4p4q-h9hh · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences