# CVE-2026-11940: Python CPython path traversal bypass in tarfile.extractall

Source: https://junglewise.ai/threats/cve-2026-11940-python-cpython-path-traversal-bypass-in-tarfile-extractall  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-23. Updated: 2026-06-23  
License: CC BY 4.0 with a link back

CVE-2026-11940 · Severity: info · CVSS 7.8 · Published 2026-06-23

A vulnerability in Python's standard library for handling compressed archives could allow a malicious file to write or read data outside of its intended folder. This affects applications that use Python to extract TAR files, potentially allowing an attacker to overwrite sensitive system files or access private data. The issue occurs even when security filters are enabled, as a specially crafted archive can bypass these protections.

Technologies: [Python Software Foundation CPython](https://junglewise.ai/threats/technologies/cpython). Vendors: [Python Software Foundation](https://junglewise.ai/threats/vendors/python-software-foundation).

## Quick answers

**Is CVE-2026-11940 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-11940 being exploited in the wild.

**How severe is CVE-2026-11940?** Informational severity, with a CVSS score of 7.8, published 23 June 2026.

**Which products and versions are affected?** Python Software Foundation CPython < 3.16.0.

**Is there a fix for CVE-2026-11940?** A patch was published on 2026-06-23: Fix merged into CPython main branch Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-11940 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-11940?** Check whether you run Python Software Foundation CPython at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A path traversal vulnerability exists in the Python `tarfile` module's `extractall()` function. When using the 'data' or 'tar' filters, a bypass is possible using a crafted archive where a hardlink references a symlink located deeper in the directory structure than the hardlink itself. The extraction fallback mechanism validates the symlink at its original archived location but recreates it at the shallower path of the hardlink; this allows a relative symlink target, previously judged safe by the filter, to resolve to a location outside the intended destination directory. This is an incomplete fix for CVE-2025-4330 and allows for arbitrary file reads or writes upon extraction. The issue is addressed in CPython versions leading up to 3.16.0.

## Affected products

- Python Software Foundation CPython < 3.16.0

## Timeline

- 2026-06-16: disclosed: Issue reported on GitHub
- 2026-06-23: patched: Fix merged into CPython main branch
- 2026-06-23: advisory: Security announcement and CVE published

## References

- [https://github.com/python/cpython/issues/151558](https://github.com/python/cpython/issues/151558)
- [https://github.com/python/cpython/pull/151559](https://github.com/python/cpython/pull/151559)
- [https://mail.python.org/archives/list/security-announce@python.org/thread/LD6QIISNQFQYOIEPJNEUIPV7S3V76FZH/](https://mail.python.org/archives/list/security-announce@python.org/thread/LD6QIISNQFQYOIEPJNEUIPV7S3V76FZH/)

## Related threats

- [Python gzip/tarfile/zipfile CLI module shadowing via sys.path](https://junglewise.ai/threats/cve-2026-115791-when-tarfile-or-zipfile-command-line-interface-cli-is-used-to)
- [Python CPython quadratic complexity in xml.etree XPath index predicates](https://junglewise.ai/threats/cve-2026-6879-python-cpython-quadratic-complexity-in-xml-etree-xpath-index)
- [Python CPython CPU denial of service in html.parser.HTMLParser](https://junglewise.ai/threats/cve-2026-15308-python-cpython-cpu-denial-of-service-in-html-parser-htmlparser)
- [Python CPython improper permission preservation in tarfile.extract](https://junglewise.ai/threats/cve-2026-4360-python-cpython-improper-permission-preservation-in-tarfile-extract)
- [Python CPython infinite loop in tarfile streaming mode](https://junglewise.ai/threats/cve-2026-11972-python-cpython-infinite-loop-in-tarfile-streaming-mode)
