CVE-2026-7774
Awaiting Analysis Awaiting Analysis - Queue
Path Traversal in Python tarfile Module

Publication date: 2026-06-04

Last updated on: 2026-06-10

Assigner: Python Software Foundation

Description
tarfile.data_filter could be bypassed using crafted link entries, including symlinks with empty or directory-like names, to redirect later archive members outside the intended extraction directory. This allowed a malicious tar archive to cause tarfile.extractall() to write files outside the destination directory, subject to the permissions of the extracting process.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-04
Last Modified
2026-06-10
Generated
2026-06-25
AI Q&A
2026-06-04
EPSS Evaluated
2026-06-23
NVD
EUVD
Affected Vendors & Products
Showing 7 associated CPEs
Vendor Product Version / Range
python python From 3.11 (inc) to 3.15 (inc)
python cpython 3.10
python cpython 3.11
python cpython 3.12
python cpython 3.13
python cpython 3.14
python cpython 3.15
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

CVE-2026-7774 is a security vulnerability in Python's tarfile.data_filter module that allows crafted tar archives to bypass path traversal protections.

Specifically, attackers can create malicious tar archives containing symlinks with empty or directory-like names that redirect files outside the intended extraction directory.

This happens because the data filter normalizes link names but performs containment checks on un-normalized values, allowing the bypass.

As a result, when using tarfile.extractall(), files can be written outside the destination directory, subject to the permissions of the extracting process.

Impact Analysis

This vulnerability can allow a malicious tar archive to write files outside the intended extraction directory.

An attacker could exploit this to overwrite or create files anywhere the extracting process has permission to write, potentially leading to unauthorized file modification or system compromise.

It could also enable replacing the destination directory itself with a symlink, redirecting all further file operations to unintended locations.

Detection Guidance

This vulnerability involves crafted tar archives that use symlinks with empty or directory-like names to bypass path traversal protections during extraction with tarfile.extractall(). Detection involves inspecting tar archives for suspicious or malformed symlink entries that could redirect extraction outside the intended directory.

To detect potential exploitation attempts or malicious tar files on your system or network, you can:

  • Manually inspect tar archives before extraction using commands like `tar -tvf archive.tar` to list contents and look for symlinks with unusual or empty names.
  • Use scripting or tools to parse tar headers and identify symlink entries with empty or directory-like names that could be used to bypass extraction filters.
  • Monitor file system changes after tar extraction for unexpected files outside the intended extraction directory.
  • Example command to list symlinks in a tar archive: `tar -tvf archive.tar | grep '^l'` which shows symbolic link entries.
  • Check for symlinks with empty or suspicious names by further filtering the output, for example: `tar -tvf archive.tar | grep '^l' | awk '{print $6}' | grep -E '^$|/$'` to find empty or directory-like symlink names.
Mitigation Strategies

To mitigate CVE-2026-7774, you should update your Python installations to versions where the vulnerability has been patched. The fix validates the actual link targets being written during tarfile extraction to prevent path traversal bypasses.

  • Apply patches or upgrade to Python versions 3.10 through 3.15 where backports addressing this issue have been prepared.
  • Avoid extracting untrusted tar archives using tarfile.extractall() until the fix is applied.
Compliance Impact

The vulnerability in tarfile.data_filter allows malicious tar archives to write files outside the intended extraction directory, potentially leading to unauthorized file writes. This could result in unauthorized access or modification of sensitive data if exploited in environments handling regulated information.

Such unauthorized file writes and potential data exposure could impact compliance with standards and regulations like GDPR and HIPAA, which require strict controls over data integrity, confidentiality, and access. If exploited, this vulnerability might lead to breaches of protected data or system integrity, thereby violating these compliance requirements.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-7774. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart