Skip to content
High 7.2

node-tarに脆弱性、細工したアーカイブで展開先の外へリンクを作られるおそれ

CVE-2026-140248 First seen on SecPulse

Summary

node-tarの7.5.22から8.0.0より前の版では、細工されたtarアーカイブを展開すると、展開先の外を指すシンボリックリンクが作られる脆弱性があります。作られたリンクを後から別の処理が辿ると、展開先の外にアクセスされるおそれがあります。修正版は8.0.0です。node-tarを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.22から8.0.0より前の版では、細工されたtarアーカイブを展開すると、展開先の外を指すシンボリックリンクが作られる脆弱性があります。作られたリンクを後から別の処理が辿ると、展開先の外にアクセスされるおそれがあります。修正版は8.0.0です。node-tarを8.0.0以降に更新してください。

Affected packages

PackageAffected → Fixed
isaacsnode-tar —
npmtar
< 8.0.0→ 8.0.0
Original description The description as published by the source.

Summary

With default preservePaths: false, tar 7.5.22 can extract a symbolic link whose effective target is outside the extraction directory. A crafted archive first creates one in-root symlink and then a second symlink whose target contains that symlink followed by ... The containment check simplifies the target lexically before checking filesystem symlinks, but the stored target is resolved by the OS through the first symlink. A later consumer following the extracted link can access a file outside the intended root.

This was reproduced locally on commit 2a22bfc5d3a432a606d9da0e2d87ba634aa3b1cb (package version 7.5.22). Earlier versions were not assessed. The PoC only reads a marker that it creates in its own temporary directory. No preexisting file is touched.

Root cause

STRIPABSOLUTEPATH accepts a symlink linkpath containing .. if path.posix.normalize(path.posix.join(entryDir, linkpath)) appears to stay inside the extraction root (src/unpack.ts:263-302). Later, SYMLINK derives parts using path.resolve(dirname(entry.absolute), entry.linkpath) (src/unpack.ts:640-659), which also removes b/.. before ENSURE_NO_SYMLINK inspects each component (src/unpack.ts:679-698). LINK then writes the original unsimplified entry.linkpath with fs.symlink (src/unpack.ts:866-880).

For a/b -> ../x and a/c -> b/../.., the lexical check reduces the second target to the extraction root and never checks a/b. Actual filesystem traversal follows…

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