Repository navigation
Remove vulnerable node-tar dependency from the npm downloader - #39
Merged
cfallin merged 2 commits intoDec 2, 2026
Merged
Conversation
vados-cosmonic
force-pushed
the
fix/npm-downloader-package
branch
from
December 2, 2026 09:54
45c9cea to
1187501
Compare
vados-cosmonic
marked this pull request as ready for review
December 2, 2026 09:55
vados-cosmonic
force-pushed
the
fix/npm-downloader-package
branch
from
December 2, 2026 10:07
1187501 to
09a7c45
Compare
Extract the binary from tar.xz releases with tar-stream (and @napi-rs/lzma for the xz layer) instead of node-tar. - Write the binary to a temporary directory and rename it into place, so a partially written executable is never published. - Accept regular and contiguous tar entries for the binary, and report the entry type when it is a link instead of claiming it is missing. - Remove download-* temp dirs left by interrupted installs. Only dirs older than an hour are removed, so concurrent installs are left alone. Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
vados-cosmonic
force-pushed
the
fix/npm-downloader-package
branch
from
December 2, 2026 10:12
000a774 to
27023fe
Compare
Contributor
Author
|
If this goes in, it would be great to also get a 0.5.2 release out. Bots also found some pre-existing issues which I may open another PR for as well. |
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
cfallin
approved these changes
Dec 2, 2026
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.
The npm wrapper in 0.5.1 installs node-tar 7, which is affected by archive extraction advisories including GHSA-6wwr-g865-f46r and GHSA-25mm-r35j-6hgm.
Use
@napi-rs/tar1.1.3 to read the Linux and macOS release archives. It handles both XZ decompression and tar parsing, so the wrapper can drop the separate LZMA dependency. Windows continues to use fflate for ZIP archives.The downloader accepts regular and contiguous file entries, writes the executable to a temporary directory, and moves the completed file into the cache. It also cleans up stale download directories.
Verified all five official release archives under Node 22 and ran the downloaded Linux binary. A clean npm install reported zero known vulnerabilities. A 0.5.2 npm release would let downstream consumers drop their temporary pins.