Skip to content

Npm installer fixes - #344

Merged
davidabram merged 6 commits into
mainfrom
npm-installer-nonsense
Nov 4, 2026
Merged

davidabram merged 6 commits into
mainfrom
npm-installer-nonsense

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

davidabram and others added 6 commits November 3, 2026 17:42
Specify the acceptance criteria and task sequence for fixing launcher permissions,
validating signed manifest identity, replacing unrestricted tar extraction with
bounded extraction, and atomically installing the native binary. Include
packed-package smoke coverage, release wiring, and distribution documentation.

Plan: harden-npm-installer
Tasks: T01, T02, T03, T04, T05

Co-authored-by: SCE <sce@crocoder.dev>
Commit the launcher with executable mode so npm pack preserves a runnable
package/bin/sce.js, and add a loopback HTTPS fixture test that packs, installs,
and exercises the launcher against a signed stub release. Record the completed
installer hardening evidence in the plan and npm distribution contract.

Plan: harden-npm-installer
Task: T01

Co-authored-by: SCE <sce@crocoder.dev>
Ensure npm installation accepts only manifests bound to the requested package version and sce binary, with exactly one target artifact using its canonical archive name and lowercase SHA-256 digest. This removes fallback archive/checksum trust and rejects malformed identity metadata before temporary-directory creation or archive download.

Add regression coverage for invalid identity fields, duplicate targets, and canonical archive URL selection.

Plan: harden-npm-installer (T02)

Co-authored-by: SCE <sce@crocoder.dev>
Replace host tar extraction with a bounded ustar/GNU archive reader that validates paths, entry types, sizes, and checksums before staging only bin/sce. Install staged binaries through durable temp-file writes and atomic rename so failed checksum, extraction, or interrupted installs preserve existing runtime state.

Add fixture and installer tests covering malicious archives, GNU tar compatibility, size limits, and failure cleanup, and include the new archive sources in npm checks.

Plan: harden-npm-installer.md (T02, T03)

Co-authored-by: SCE <sce@crocoder.dev>
Validate the npm launcher after `npm pack` so release assets cannot be emitted with a non-executable `bin/sce.js` or a broken offline install. Add the packed-tarball smoke as a flake check, include its fixture inputs in the copied source, and run it from `release-npm-package` before writing metadata.

Plan: context/plans/harden-npm-installer.md (T04)

Co-authored-by: SCE <sce@crocoder.dev>
Document the musl platform targets and the installer's manifest identity checks,
bounded archive extraction, checksum verification, and atomic executable install.
Record completion and validation evidence for the harden-npm-installer plan,
including the completed T05 documentation task and all acceptance criteria.

Plan: harden-npm-installer (T05)

Co-authored-by: SCE <sce@crocoder.dev>
@davidabram
davidabram added this pull request to stack #346 November 3, 2026 19:07
@davidabram
davidabram merged commit d505de5 into main Nov 4, 2026
9 of 11 checks passed
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.

1 participant