# CVE-2026-7774: Python CPython path traversal bypass in tarfile.data_filter

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

CVE-2026-7774 · Severity: info · CVSS 6.9 · Published 2026-06-04

A vulnerability exists in the Python 'tarfile' module, which is commonly used by developers to read and extract compressed archive files. A malicious actor could create a specially crafted archive that, when opened, bypasses security filters to write files to unauthorized locations on the computer. This could allow an attacker to overwrite sensitive system files or application data, potentially leading to a full system compromise depending on the permissions of the user running the script.

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-7774 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-7774 being exploited in the wild.

**How severe is CVE-2026-7774?** Informational severity, with a CVSS score of 6.9, published 4 June 2026.

**Which products and versions are affected?** Python Software Foundation CPython 3.12, 3.13, 3.14, 3.15.

**Is there a fix for CVE-2026-7774?** A patch was published on 2026-05-08: 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-7774 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-7774?** 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 (CWE-22) exists in the Python 'tarfile' module's 'data_filter' mechanism. The filter fails to properly validate link entries, specifically symlinks with empty names or directory-like structures, which can be used to redirect subsequent archive members to locations outside the target extraction directory. The root cause is a discrepancy where the filter performed containment checks against un-normalized paths while the extraction process used normalized paths. An attacker can exploit this by providing a malicious TAR archive to an application using 'tarfile.extractall()' with the 'data_filter' enabled. Patches have been developed for CPython versions 3.12 through 3.15.

## Affected products

- Python Software Foundation CPython 3.12, 3.13, 3.14, 3.15

## Timeline

- 2026-05-07: disclosed: Issue reported on GitHub
- 2026-05-08: patched: Fix merged into CPython main branch
- 2026-06-04: advisory: Official security announcement and CVE published

## References

- [https://github.com/python/cpython/issues/149486](https://github.com/python/cpython/issues/149486)
- [https://github.com/python/cpython/pull/149487](https://github.com/python/cpython/pull/149487)
- [https://mail.python.org/archives/list/security-announce@python.org/thread/4FU62L2M6RMMHT2QPGQNPEHHUND7CEX5/](https://mail.python.org/archives/list/security-announce@python.org/thread/4FU62L2M6RMMHT2QPGQNPEHHUND7CEX5/)

## 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)
