CVE-2026-140249 — Tar — CWE-22 · CWE-59
### Summary Summary With default options, tar.x() in tar 7.5.5 through 7.5.23 (the latest release) creates a symbolic link that points outside the extraction directory, and raises no warning. The archive needs only a directory and two symlinks. This breaks the README's listed protection that "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder." This is not the TOCTOU case (no one but tar touches the extraction folder) and not an old version: it reproduces on 7.5.23 and on main (eb92e17), with default options. ### Details x/ Directory x/y -> .. (resolves to cwd: allowed) l -> x/y/../secret.txt (checked as cwd/x/secret.txt; really cwd/../secret.txt) - [STRIPABSOLUTEPATH] validates the lexically normalized linkpath, x/secret.txt, which is inside cwd. - [SYMLINK] runs ENSURE_NO_SYMLINK on path.resolve(...) of the linkpath, which also removes y/.. before checking, so it never sees that x/y is a symlink. - [LINK] then creates the link with the raw linkpath, x/y/../secret.txt. The kernel resolves x/y first (to cwd), then applies .., so l points to cwd/../secret.txt. Repeating the x/y/ step reaches any absolute path: x/y/ × 8 followed by ../ × 16 and etc/hostname fits in the 100-byte ustar linkpath field and points at /etc/hostname. Entry order does not matter; the link can come before or after x/y. This is the same chain as the proof of concept in GHSA-83g3-92jg-28cx (CVE-2026-26960).
### Summary Summary With default options, tar.x() in tar 7.5.5 through 7.5.23 (the latest release) creates a symbolic link that points outside the extraction directory, and raises no warning. The archive needs only a directory and two symlinks. This breaks the README's listed protection that "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder." This is not the TOCTOU case (no one but tar touches the extraction folder) and not an old version: it reproduces on 7.5.23 and on main (eb92e17), with default options. ### Details x/ Directory x/y -> .. (resolves to cwd: allowed) l -> x/y/../secret.txt (checked as cwd/x/secret.txt; really cwd/../secret.txt) - [STRIPABSOLUTEPATH] validates the lexically normalized linkpath, x/secret.txt, which is inside cwd. - [SYMLINK] runs ENSURE_NO_SYMLINK on path.resolve(...) of the linkpath, which also removes y/.. before checking, so it never sees that x/y is a symlink. - [LINK] then creates the link with the raw linkpath, x/y/../secret.txt. The kernel resolves x/y first (to cwd), then applies .., so l points to cwd/../secret.txt. Repeating the x/y/ step reaches any absolute path: x/y/ × 8 followed by ../ × 16 and etc/hostname fits in the 100-byte ustar linkpath field and points at /etc/hostname. Entry order does not matter; the link can come before or after x/y. This is the same chain as the proof of concept in GHSA-83g3-92jg-28cx (CVE-2026-26960).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140249
CVSS 7.2/10 · HIGH · 01.12.2026
CWE: CWE-22, CWE-59
Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Path Traversal / LFI
Summary: ### Summary
Summary
With default options, tar.x() in tar 7.5.5 through 7.5.23 (the latest release) creates a symbolic link that points outside the extraction directory, and raises no warning. The archive needs only a directory and two symlinks. This breaks the README's listed protection that "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder."
…
Affected: tar
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · user interaction required (UI:R) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); data can be modified or deleted; reduced availability or partial DoS (A:L).
🛡️ REMEDIATION
→ Apply vendor security update for tar.
→ Use realpath() canonicalization, implement allowlists.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
⚠️ This week (7 days) — High risk, anonymous remote.
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]