Skip to content
High 7.2

node-tarに展開先の外へ書き込まれる脆弱性、任意のファイルを読み書きされるおそれ

CVE-2026-140249 First seen on SecPulse

Summary

node-tarの7.5.5から8.0.0までのバージョンには、アーカイブ内のシンボリックリンクの連鎖で展開先の外を指される脆弱性があります。デフォルト設定のtar.x()で細工されたtarballを展開すると、攻撃者は実行ユーザーの権限で任意のファイルを読み書きできるおそれがあり、CVSS v4.0のスコアは7.2です。8.0.0で修正されているため、8.0.0以降へ更新してください。

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

node-tarの7.5.5から8.0.0までのバージョンには、アーカイブ内のシンボリックリンクの連鎖で展開先の外を指される脆弱性があります。デフォルト設定のtar.x()で細工されたtarballを展開すると、攻撃者は実行ユーザーの権限で任意のファイルを読み書きできるおそれがあり、CVSS v4.0のスコアは7.2です。8.0.0で修正されているため、8.0.0以降へ更新してください。

Affected packages

PackageAffected → Fixed
isaacsnode-tar —
npmtar
< 8.0.0→ 8.0.0

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

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). Tha…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details