Skip to main content

CPython tarfile CVE-2026-11940

| EUVDEUVD-2026-38490 HIGH
Path Traversal (CWE-22)
2026-06-23 PSF GHSA-9mc4-rqmq-h467
7.8
CVSS 4.0 · Vendor: PSF
Share

Severity by source

Vendor (PSF) PRIMARY
7.8 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
8.2 HIGH

Requires a victim app to extract an attacker-supplied archive (UI:R, AV:L for archive-as-input); scope changes to filesystem outside dest (S:C) enabling arbitrary read/write.

3.1 AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
SUSE
9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat
7.3 HIGH
qualitative

Primary rating from Vendor (PSF).

CVSS VectorVendor: PSF

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

2
Source Code Evidence Fetched
Jun 23, 2026 - 17:01 vuln.today
Analysis Generated
Jun 23, 2026 - 17:01 vuln.today

DescriptionCVE.org

tarfile.extractall() with the 'data' or 'tar' filter could be bypassed by a crafted archive where a hardlink references a symlink stored at a deeper name than the hardlink itself. The extraction fallback validated the symlink at it's archived location but recreated it at the hardlink's shallower path, letting a relative target the filter judged contained escape the destination directory. This allowed a malicious tar archive to create a symlink pointing outside the destination, enabling out-of-destination file reads or writes. This was an incomplete fix of CVE-2025-4330.

AnalysisAI

Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filters and create a symlink pointing outside the destination directory, enabling out-of-destination file reads or writes when extractall() is later used or the resulting symlink is followed. The flaw is an incomplete fix of CVE-2025-4330: a hardlink referencing a symlink stored at a deeper path than the hardlink itself causes the fallback to validate the symlink at its archived (deep) location but recreate it at the hardlink's shallower path, making a previously 'contained' relative target escape the extraction root. No public exploit identified at time of analysis, and the issue is not listed in CISA KEV.

Technical ContextAI

The vulnerable code lives in Lib/tarfile.py inside the link-extraction fallback (makelink_with_filter), which is invoked when the underlying filesystem cannot create a hardlink and tarfile must emulate it by copying or by re-creating the link target. The 'data' and 'tar' filters added in PEP 706 (Python 3.12+, backported to 3.8.17/3.9.17/3.10.12/3.11.4) are designed to prevent path traversal during tarfile.extractall(). Per the CWE-22 root cause and the upstream patch (python/cpython#151559), the filter only checked the symlink relative to its archived deep location (e.g. a/b/s with target ../escape resolves inside the destination), but the fallback then materialized the same relative symlink at the hardlink's shallower path (s -> ../escape), which now escapes. The fix re-runs the filter on the rewritten TarInfo (unfiltered.replace(name=tarinfo.name, deep=False)) against the extraction root so the symlink is judged at its actual on-disk location. CPE data scopes the issue to python_software_foundation:cpython.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply the CPython update that incorporates pull request https://github.com/python/cpython/pull/151559 as soon as your distribution publishes it, and consult the PSF advisory at https://mail.python.org/archives/list/security-announce@python.org/thread/LD6QIISNQFQYOIEPJNEUIPV7S3V76FZH/ for the exact patched minor versions. Until you can upgrade, do not extract untrusted tar archives with tarfile.extractall(); if you must, pre-scan the archive and reject any TarInfo whose type is hardlink (LNKTYPE) whose linkname resolves to a symlink entry inside the same archive, or extract into a disposable directory on a filesystem that supports hardlinks (so the vulnerable fallback path is not taken) and then move only regular files out. As a stronger compensating control, extract inside a container, chroot, or unprivileged sandbox with no sensitive paths reachable via '..' traversal - the trade-off is added operational complexity and, for the hardlink-rejection workaround, breakage of legitimate archives that use hardlinks.

CVE-2026-6100 CRITICAL
9.1 Apr 13

CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a

CVE-2026-3298 HIGH
8.8 Apr 21

Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo

CVE-2026-11972 HIGH
8.2 Jun 23

Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted

CVE-2026-9669 HIGH
8.2 Jun 08

Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen

CVE-2026-4786 HIGH
7.0 Apr 13

Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR

CVE-2026-4519 HIGH
7.0 Mar 20

The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l

CVE-2026-7774 MEDIUM
6.9 Jun 04

Path traversal in CPython's tarfile module allows malicious tar archives to bypass the data_filter safety mechanism and

CVE-2026-19672 MEDIUM
6.3 Aug 19

CPython's tarfile module on POSIX platforms creates empty directories outside the intended extraction destination when p

CVE-2026-7210 MEDIUM
6.3 May 11

XML parsers in CPython's xml.parsers.expat and xml.etree.ElementTree modules use insufficient entropy for Expat hash-flo

CVE-2026-3276 MEDIUM
6.3 Jun 03

Denial-of-service via quadratic algorithmic complexity in CPython's unicodedata.normalize() affects all CPython versions

CVE-2026-17084 MEDIUM POC
6.0 Aug 18

Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international

CVE-2026-15806 MEDIUM
6.0 Aug 18

Credential disclosure in Python's urllib.request HTTPPasswordMgr class family enables scheme-downgrade attacks that expo

Vendor StatusVendor

SUSE

Severity: Critical
Product Status
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP6-CHOST-BYOS Affected
SLES15-SP6-CHOST-BYOS-Aliyun Affected
SLES15-SP6-CHOST-BYOS-Azure Affected

Share

CVE-2026-11940 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy