Skip to content

security(release): enable npm provenance, use --frozen-lockfile in deploy/publish workflows, restrict workflow_dispatch #91

Description

@IgorShevchik

Background

Surfaced during the June 2026 multi-angle project audit (security + CTO reviews). Adjacent to #64 but none of these items are covered there (#64 = permissions: blocks, action SHA-pinning, pull_request_target audit, branch protection — not re-reported here).

Scope

1. npm provenance is configured halfway

.github/workflows/npm-publish.yml:8-11 grants id-token: write, but the publish step (lines 72-74) runs pnpm publish --no-git-checks with no --provenance and package.json has no publishConfig.provenance. Result: the elevated OIDC permission is unused and the package ships without a provenance attestation.
Action: add --provenance (or "publishConfig": { "provenance": true }); verify the Trusted Publishing binding on npmjs.com actually exists; otherwise drop the unused id-token: write.

2. pnpm install without --frozen-lockfile at the most sensitive moments

ci.yml:36 correctly uses --frozen-lockfile, but deploy.yml:52 (Pages build) and npm-publish.yml:64 (the publish build) do not. A drifted or tampered lockfile, or an in-range dependency bump, gets silently resolved at build/publish time.
Action: pnpm install --frozen-lockfile in both.

3. workflow_dispatch permits publishing from any ref

Action: restrict the dispatch path to main/tags (guard step comparing github.ref), so a stray branch can't be published manually.

4. Note

The CI gate in npm-publish.yml is a 30-minute polling loop waiting for the ci check on the SHA — works, but consider workflow_run chaining for robustness.

Priority: P2 (§1–§2 quick, high supply-chain value).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions