
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-11940 is a path traversal and symlink escape vulnerability in Python's tarfile module affecting CPython versions prior to 3.15.0. When using tarfile.extractall() with the 'data' or 'tar' filter, a crafted tar archive can bypass directory containment by exploiting the hardlink-extraction fallback mechanism. This vulnerability is an incomplete fix of CVE-2025-4330 and was disclosed on June 23, 2026. It carries a CVSS v4.0 base score of 7.8 (High) (Github Advisory, Feedly).
The root cause is classified as CWE-22 (Path Traversal) and CWE-59 (Improper Link Resolution Before File Access). The flaw exists in the makelink_with_filter function within Lib/tarfile.py: when a hardlink references a symlink stored at a deeper path (e.g., a/b/s), the extraction fallback validates the symlink at its archived location but recreates it at the hardlink's shallower path (e.g., s). Because the filter checks containment at the deeper path, a relative symlink target (e.g., ../escape) that appears contained at a/b/s actually escapes the destination directory when placed at s. The fix adds an additional filter check at the hardlink's actual write location before proceeding with extraction (CPython PR #151559, CPython Commit).
Successful exploitation allows an unauthenticated attacker who can supply a crafted tar archive to create symlinks pointing outside the intended extraction directory, enabling arbitrary file reads or writes on the host system. This can lead to sensitive file disclosure (e.g., reading /etc/shadow or application secrets) or arbitrary file write, which may be chained to achieve code execution by overwriting scripts, configuration files, or other writable assets. The impact is primarily on subsequent/downstream systems rather than the vulnerable Python process itself, as reflected in the CVSS v4.0 subsequent system confidentiality and integrity scores of High (Github Advisory, Feedly).
a/b/s) pointing to a relative target that escapes the destination (e.g., ../../etc/cron.d/backdoor), and a hardlink at a shallower path (e.g., s) referencing the deep symlink (a/b/s).tarfile.extractall() with the 'data' or 'tar' filter on untrusted input — for example, via a file upload endpoint, package installation, or build artifact processing.tarfile.extractall(filter='data') on the archive. The filter validates the symlink at a/b/s and judges the relative target ../../etc/cron.d/backdoor as contained (relative to the deep path), passing validation.s within the extraction directory. Because s is at a shallower depth, the relative target now resolves outside the extraction directory (e.g., to /etc/cron.d/backdoor).../../etc/, /tmp/, or other sensitive directories); newly created or modified files in sensitive system directories (e.g., /etc/cron.d/, /etc/passwd, web root) shortly after a tar extraction event.LinkFallbackError / LinkOutsideDestinationError exceptions in application logs (these would appear in a patched system rejecting the attack, but their absence on an unpatched system may indicate silent exploitation).The Python Software Foundation has released patches for all supported branches: the fix is included in CPython 3.10 (backport PR #152080), 3.11 (backport PR #152001), 3.12 (backport PR #152000), 3.13 (backport PR #151999), 3.14 (backport PR #151998), and 3.15 (backport PR #151997). Users should upgrade to a patched release as soon as available for their branch (CPython PR #151559, Github Advisory). As a workaround, avoid extracting untrusted tar archives using tarfile.extractall() with the 'data' or 'tar' filter; instead, validate and sanitize archive contents before extraction, or use sandboxed/containerized extraction environments. Downstream distributions (e.g., Amazon Linux 2023, Buildroot, Debian, SUSE) are also issuing security patches.
The vulnerability was announced via the Python security mailing list and the oss-security list shortly after disclosure on June 23, 2026 (oss-sec, Python Security Announce). Downstream projects including Buildroot and the Yocto Project promptly issued security patches referencing the CVE. Security scanning vendors Nessus (plugin 323882) and Qualys (detection IDs 363085–363093) have added detection coverage. Community reaction has been measured, with the vulnerability noted as a bypass of the prior CVE-2025-4330 fix, highlighting the difficulty of fully securing the tarfile hardlink/symlink interaction.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."