Skip to content

fix(deps): bump the npm wrapper's tar to v7 and document npm 12's allowScripts gate - #136

Merged
dipto0321 merged 1 commit into
mainfrom
fix/deps/tar-v7-and-npm12-docs
Nov 2, 2026
Merged

dipto0321 merged 1 commit into
mainfrom
fix/deps/tar-v7-and-npm12-docs

Conversation

@dipto0321

Copy link
Copy Markdown
Owner

Summary

Two problems found while verifying the v1.2.2 npm channel.

1. tar was pinned to a version with published advisories

nodeup-npm pinned tar@6.2.1, which npm itself flags:

npm warn deprecated tar@6.2.1: Old versions of tar are not supported,
and contain widely publicized security vulnerabilities

npm audit against the published wrapper reported 1 critical and 1
high
vulnerability, every one of them in tar — the hardlink path
traversal, symlink poisoning, and PAX file-smuggling advisories. All
of them sit on the archive-extraction path, which is the one place
the wrapper touches untrusted bytes.

Bumped to tar@7.5.22, past the advisory range (<= 7.5.20).
npm audit is now clean: 0 vulnerabilities.

The bump raises the wrapper's Node floor from 14 to 18, because
tar@7 declares engines: { node: ">=18" }. The wrapper's own code
is unchanged and still runs on Node 14 — the floor comes from the
dependency, so engines and the docs are updated to match.

2. npm 12 blocks the wrapper's install script

npm 12 added allowScripts, which blocks install scripts for
packages that aren't on an allowlist. nodeupx needs its
postinstall to download the binary, so on npm 12+ a fresh
npm install -g nodeupx finishes with the wrapper in place but no
binary
— nodeup never appears on $PATH, and the install log's
warning scrolls past:

npm warn install-scripts 1 package had install scripts blocked because they are not covered by allowScripts:
npm warn install-scripts   nodeupx@1.2.2 (preinstall: node scripts/check.js; postinstall: node scripts/install.js)

The fix is npm install-scripts approve nodeupx. The wrapper README,
the main README, and docs/installation.md now spell it out, with the
permanent ~/.npmrc form for anyone who wants it.

Verification

  • npm audit in nodeup-npm/ → 0 vulnerabilities (was 1 critical + 1 high)
  • The wrapper's real extractTarGz() (with its zip-slip filter
    guard) extracts the actual v1.2.2 release archive under
    tar@7 → nodeup at 8423058 bytes, mode 755
  • A full npm install nodeupx@1.2.2 with the script approved
    downloads the binary → no quarantine attribute, runs 3/3,
    nodeup version reports 1.2.2
  • node nodeup-npm/scripts/install_test.js → 25 tests, 0 issues
  • go build ./..., go vet ./..., gofmt -l . (clean),
    golangci-lint run ./... → 0 issues

🤖 Generated with puku-cli

Closes #135

…owScripts gate

Two problems surfaced while verifying the v1.2.2 npm channel.

**1. `tar` was pinned to a version with published advisories.**

`nodeup-npm` pinned `tar@6.2.1`. npm itself flags it:

    npm warn deprecated tar@6.2.1: Old versions of tar are not
    supported, and contain widely publicized security vulnerabilities

`npm audit` against the published wrapper reports **1 critical and 1
high** vulnerability, every one of them in `tar` — the hardlink path
traversal, symlink poisoning, and PAX file-smuggling advisories. All
of them sit on the archive-extraction path the wrapper uses to unpack
the release tarball, which is the one place the wrapper touches
untrusted bytes.

Bumped to `tar@7.5.22`, past the advisory range (`<=7.5.20`).
`npm audit` is now clean: **0 vulnerabilities**.

The bump raises the wrapper's Node floor from 14 to 18, because
`tar@7` declares `engines: { node: ">=18" }`. The wrapper's own code
is unchanged and still runs on Node 14 — the floor comes from the
dependency, so `engines` and the docs are updated to match.

Verified end-to-end: the wrapper's real `extractTarGz()` (with its
zip-slip `filter` guard) extracts the actual v1.2.2 release archive
under `tar@7`, producing the binary at the expected 8423058 bytes.

**2. npm 12 blocks the wrapper's install script.**

npm 12 added `allowScripts`, which blocks install scripts for packages
that aren't on an allowlist. `nodeupx` needs its `postinstall` to
download the binary, so on npm 12+ a fresh `npm install -g nodeupx`
finishes with the wrapper in place but **no binary** — `nodeup` never
appears on `$PATH`, and the install log's warning scrolls past.

The fix is `npm install-scripts approve nodeupx`. The wrapper README,
the main README, and `docs/installation.md` now spell it out, with the
permanent `~/.npmrc` form for anyone who wants it.
@cocogitto-bot

cocogitto-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

✔️ 01070e0 - Conventional commits check succeeded.

@dipto0321
dipto0321 merged commit 0f2e595 into main Nov 2, 2026
11 checks passed
@dipto0321
dipto0321 deleted the fix/deps/tar-v7-and-npm12-docs branch November 2, 2026 03:54
dipto0321 added a commit that referenced this pull request Nov 2, 2026
Release prep for v1.2.3 — a wrapper-only release. The Go binary is
unchanged from v1.2.2; this republishes the npm wrapper with the
dependency fix and the documentation that landed in #136.

- CHANGELOG.md — new [1.2.3] section covering the tar@7.5.22 bump and
  the npm 12 allowScripts documentation.
- nodeup-npm/package.json — version and binaryVersion both to 1.2.3.
  binaryVersion pins which Go binary the wrapper downloads, so it must
  match the tag or every install 404s on the archive.
- README.md / CLAUDE.md / SPEC.md / docs/managers.md / nodeup-npm/README.md
  — refresh the release references.

Refs #135

Co-authored-by: dipto0321 <dipto@local>
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.

npm wrapper: tar@6.2.1 has 1 critical + 1 high advisory, and npm 12's allowScripts gate silently produces a wrapper with no binary

1 participant