[GHSA-92fh-27vv-894w] nanotar is vulnerable to path traversal in parseTar() and parseTarGzip()#7458
Open
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7458from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
Comments
0.0.0is a placeholder with no codeThe
0.0.0tarball on the npm registry (https://registry.npmjs.org/nanotar/-/nanotar-0.0.0.tgz) contains a single file,package.json, whose entire content is{"name":"nanotar","version":"0.0.0"}.There is no
dist/, no JavaScript, and noparseTar/createTarfunctions, so the path-traversal sink described inCVE-2025-69874cannot exist.A PoC against
0.0.0has nothing to call and will always fail. Including it in the affected range produces false positives for downstream consumers.0.1.1is the first release containing the vulnerable codeBetween
0.0.0(2023-12-09 00:17 UTC) and0.1.1(2023-12-09 00:18 UTC), the project published the real implementation.0.1.1is the earliest version that shipsdist/index.{cjs,mjs}and exports:parseTarparseTarGzipcreateTarEvery subsequent affected version inherits that code path from
0.1.1, so0.1.1is the true introduced version.The fix was first released in
0.2.1, then also in0.3.0The advisory currently lists no patched version.
The fix is PR
unjs/nanotar#58("fix: sanitise paths"), merge commit322f9677f12c4a5c15eea223bd51542f35a31219, merged2026-02-11 22:52 UTC.It adds
_sanitizePath(), which:..segmentsIt is called from
parseTarbefore each entry's name is recorded.This code ships in both:
0.3.0— published2026-02-11 22:54:51 UTC(2 minutes after the merge)0.2.1— published2026-02-11 23:03:42 UTC(9 minutes after0.3.0) as a backport to the0.2.xlineA diff of
dist/index.mjsbetween0.2.0and0.2.1shows the same_sanitizePathfunction and the same call-site injection inparseTar.