Skip to content

Zip 9 deflate only - #1611

Open
mentenaz wants to merge 4 commits into
Schniz:masterfrom
mentenaz:zip-9-deflate-only
Open

mentenaz wants to merge 4 commits into
Schniz:masterfrom
mentenaz:zip-9-deflate-only

Conversation

@mentenaz

Copy link
Copy Markdown

UPdated vuln

mentenaz and others added 4 commits October 13, 2026 15:27
The crate now has a library target. `fnm::Fnm` covers listing installed and
downloadable versions, reading the version a directory asks for, installing,
uninstalling, setting the default, and building the PATH for running a child
process under a version. Its functions return values instead of printing and
never exit the process, so another Rust application can manage Node.js
versions without fnm being installed.

The `fnm` program is unchanged and is now a thin layer over the library. It
and the dependencies only it needs (progress bars, shell detection,
completions, the Windows manifest) are behind a `cli` feature that is on by
default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Fnm::resolve_for` and `Fnm::install_for` take a directory and work from its
`.nvmrc`, `.node-version` or `package.json` directly. A `package.json` version
range such as `>=20` can't be written as a single version to ask for, so it
couldn't be passed to `resolve` or `install` by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fnm unpacked whatever the mirror sent. Before unpacking, it now fetches
the release's SHASUMS256.txt from the same mirror, downloads the archive
into a temporary file while hashing it, and unpacks it only if the
SHA-256 matches. A mismatch, or a mirror that publishes no checksum for
the file, stops the install with an error naming the file and both
checksums.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zip 2.6.1 has three advisories (RUSTSEC-2026-0367, -0368, -0369) and its
default zstd feature pulls in zstd and zstd-safe, which have three more
(RUSTSEC-2026-0391, -0398, -0403). Node.js release zips are deflate, so the
other compression features are not needed.

zip 9 returns a Result from mangled_name() and name(); propagate it.
@michaljuris

Copy link
Copy Markdown

@mentenaz thanks for the checksum commit in this PR. I used it (4a35f31, with you as author) as the first commit of #1613, which adds signature verification of SHASUMS256.txt.asc for #1609. I resolved two small conflicts so it applies to master without #1605.

@mentenaz

Copy link
Copy Markdown
Author

Thanks @michaljuris , glad the checksum commit was useful! Happy to help with #1613. I can review or test it, including on Windows, if that's helpful.
Since #1613 now carries the checksum work, I'll rebase this PR so it only contains the remaining commits, and I'll split them up if that's easier to review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants