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.
Published: 2026-06-04
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The CVE documents a bypass of the tarfile.data_filter mechanism, allowing crafted tar archives that include specially formed link entries—such as symlinks with empty or directory-like names—to redirect subsequent archive members outside the specified extraction directory. When extractall() is called, these redirected members can be written to any location the extracting process can access, resulting in an arbitrary file write that may expose or overwrite critical system files.

Affected Systems

The flaw is present in the CPython implementation of the tarfile module supplied by the Python Software Foundation. Any CPython release that has not yet been updated to include the patch referenced in the Python issue tracker is vulnerable. Specific version numbers are not listed, so all affected releases should be treated as at risk until an official fix is applied.

Risk and Exploitability

The CVSS score of 6.9 indicates a moderate severity, though the EPSS score is not available, making exact exploitation likelihood uncertain. The vulnerability is not listed in CISA’s KEV catalog. Attackers can exploit this by delivering a malicious tar archive to a process running tarfile extraction. If the process has elevated privileges—e.g., root or a user directory that allows writing system files—it can create or overwrite arbitrary files outside the intended extraction tree. The attack requires control over the archive contents, but otherwise has no additional prerequisites beyond possession of tarfile.extractall() usage.

Generated by OpenCVE AI on June 4, 2026 at 16:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade CPython to the latest release that contains the tarfile data_filter fix referenced in the Python issue tracker.
  • If upgrading is not immediately possible, replace tarfile.extractall() with safer extraction that employs a strict data_filter or perform manual extraction of individual members while ensuring target paths remain within the desired directory.
  • Execute extraction under a least‑privileged account or within a confined environment (e.g., container or sandbox) to limit the impact of any file write outside the intended directory.

Generated by OpenCVE AI on June 4, 2026 at 16:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 04 Jun 2026 20:30:00 +0000

Type Values Removed Values Added
References

Thu, 04 Jun 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 04 Jun 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Python
Python cpython
Vendors & Products Python
Python cpython

Thu, 04 Jun 2026 15:45:00 +0000

Type Values Removed Values Added
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.
Title tarfile.data_filter path traversal bypass allows writing outside the extraction directory
Weaknesses CWE-22
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: PSF

Published:

Updated: 2026-06-04T18:45:41.657Z

Reserved: 2026-05-04T14:47:51.154Z

Link: CVE-2026-7774

cve-icon Vulnrichment

Updated: 2026-06-04T18:45:41.657Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-06-04T16:16:42.103

Modified: 2026-06-04T20:16:58.673

Link: CVE-2026-7774

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-04T16:30:06Z

Weaknesses