fix(javascript-npm-packages): harden npm publish on the token bootstrap path#20
Merged
Merged
Conversation
…ap path Pass --ignore-scripts --access public to npm publish. Defense in depth against postinstall-worm supply-chain attacks: install-time scripts are already skipped by pnpm install --frozen-lockfile --ignore-scripts in javascript/base; the publish flag now also skips prepack / postpack / publish / postpublish while the long-lived bootstrap token is in env. prepublishOnly still runs (known npm publish behavior), but it invokes our own gates from the frozen lockfile that already ran in the base action. The bootstrap token's exposure narrows to one publish — switch to OIDC + provenance via Trusted Publisher for 1.0.1+ to eliminate the long-lived token entirely. Bumps 0.1.10 to 0.1.11 and prepends the changelog entry.
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.
Summary
Pass
--ignore-scripts --access publictonpm publishon the token bootstrap path. Defense in depth against postinstall-worm supply-chain attacks (Shai-Hulud-class).pnpm install --frozen-lockfile --ignore-scriptsinjavascript/base—--ignore-scriptsonpublishadds belt-and-suspenders by skippingprepack/postpack/publish/postpublishwhile the long-lived bootstrap token is in env.prepublishOnlystill runs — knownnpm publishbehavior, the flag does not cover it. Accepted: it invokes our own gates which already ran in the base action against the frozen lockfile.--access publicis explicit even though consumerpublishConfig.accessis set.pnpm publish --provenance --no-git-checks) is unchanged.1.0.1+eliminates the long-lived token entirely.Test plan
v0to this commit.coroboros/uri: re-tag1.0.0, re-push. Token branch runsnpm publish --ignore-scripts --access publicand succeeds (token regenerated with@coroboros/*scope-create permission).ci.ymldoes not forwardNPM_PACKAGE_REGISTRY_TOKEN,pnpm publish --provenance --no-git-checksruns via corepack-pinned pnpm 11.x and emits provenance.