Skip to content

Supply-chain hardening: patch advisories, install policy, dependency review - #925

Merged
dadadave80 merged 7 commits into
Heliobond:mainfrom
onyinyechinwokwu-success:feat/917-supply-chain-hardening
Oct 22, 2026
Merged

dadadave80 merged 7 commits into
Heliobond:mainfrom
onyinyechinwokwu-success:feat/917-supply-chain-hardening

Conversation

@onyinyechinwokwu-success

@onyinyechinwokwu-success onyinyechinwokwu-success commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

One PR for the four open supply-chain issues assigned in this repo.

Linked issues

Closes #917
Closes #918
Closes #919
Refs #922 (Socket scanner still open, see above)

Audit numbers

bun audit before this PR: 55 findings (21 high, 31 moderate, 3 low). After: 6 findings (1 high, 4 moderate, 1 low).

Remaining findings:

  • braces (high, GHSA-vfj7-8cjw-p6xm). No patched release exists. It is dev-only, reached through eslint-config-next. It is allowlisted until 2026-12-31.
  • uuid and stream-json (moderate). Transitive through jayson. No fix in the current major.
  • elliptic (low). No fix available.

The Dependabot alert count (25 open at the time of the issue) needs re-checking on the alerts page after merge.

Decisions to review

  • next resolves to 16.4.2, not 16.3.8. ^16.3.8 allows later minor versions, and bun picked the newest. 16.4.2 was published 2026-10-15, and build and tests pass on it. If you want exactly 16.3.8, pin it.
  • Release-age cooldown of 3 days. minimumReleaseAgeExcludes is empty. Add a package there only with maintainer sign-off.
  • Dependency review needs the dependency graph enabled for the repo. deny-licenses is not set, since no license list was agreed.
  • Required checks. Maintainers should add supply-chain and the dependency review check to main's required status checks.
  • Action pinning. Only the new workflows pin actions to SHAs. Existing workflows still use tags, so Scorecard's Pinned-Dependencies check will keep flagging them. That is a follow-up.

Test evidence

Run locally with bun 1.3.14 and Node 24, after bun install --frozen-lockfile:

  • typecheck: pass
  • lint: 0 errors, 2 pre-existing warnings
  • format:check: pass
  • test:coverage: 133 files, 1496 tests passed, 3 expected fails
  • build and bundle:check: pass, all routes within budget
  • New unit tests (scripts/*.test.mjs, 30 tests): lockfile lint, audit gate and the bun-only guard. These run under bun run test.
  • node scripts/lockfile-lint.mjs: 1213 packages OK
  • node scripts/audit-gate.mjs: no unexcepted high or critical advisories
  • npm run preinstall (npm user agent): refused with a message pointing to CONTRIBUTING. bun run preinstall: passes.
  • bun install: passes through the guard.
  • Rebased onto upstream/main (includes ci: supply-chain guardrails for hidden payloads and build scripts (#914, #915, #921, #920) #924). check-hidden-content.mjs: 394 files, no findings.
  • bunfig.toml: a 10-year release-age window blocks a fresh add. The default 3-day window installs. minimumReleaseAgeExcludes lets a named package through the same window.

Not verified here:

  • The Playwright e2e job (continue-on-error in CI).
  • The dependency-review and Scorecard workflows. These only run on GitHub.

Checklist

  • Tied to accepted issues (Closes #…)
  • bun run build passes locally
  • bun run lint, bun run format:check and bun run test pass locally
  • No UI change
  • Changelog updated under Security
  • Docs updated: CONTRIBUTING.md install policy
  • No secrets committed

Supply-chain changes

This PR changes package.json scripts and dependencies, bun.lock, workflows, scripts/ and bunfig.toml. Each change is there for the issue it cites:

Allowlisted advisory: braces (GHSA-vfj7-8cjw-p6xm), dev-only, no patched release. The allowlist entry expires 2026-12-31.

Note for the reviewer: supply-chain-reviewed must be applied before this PR can merge (see the supply-chain review gate job).

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@onyinyechinwokwu-success is attempting to deploy a commit to the David Dada's projects Team on Vercel.

A member of the Team first needs to authorize it.

- Bump next to ^16.3.8 (GHSA-cjq9-62q9-8jv4 SSRF) and pin transitive
  axios to >=1.20.0 via overrides.
- Override vulnerable transitives to patched versions (follow-redirects,
  smol-toml, source-map-js, nanoid, postcss, browserslist, ws,
  launch-editor, baseline-browser-mapping, fflate).
- Bump vite to ^6.4.5 and vitest to ^4.1.12 for their advisories.
- Remove the stale package-lock.json (last touched before Heliobond#600) and
  ignore npm/yarn/pnpm lockfiles so only bun.lock is authoritative.

bun audit goes from 55 findings (21 high) to 6 (1 high with no upstream
fix: braces, dev-only via eslint-config-next).

Closes Heliobond#918
- dependency-review workflow fails PRs that add a dependency with a
  high-severity or malware advisory. The action is pinned to a SHA.
- supply-chain CI job runs scripts/lockfile-lint.mjs, which asserts that
  every bun.lock entry resolves from the npm registry with a sha512
  integrity hash and that no npm/yarn/pnpm lockfile is committed.
- scripts/audit-gate.mjs runs `bun audit --json` and fails closed on tool
  errors, unexpected exit codes and unparseable output. High and critical
  advisories fail unless listed in scripts/audit-allowlist.json with an
  expiry date; expired entries fail the gate.
- Unit tests for both scripts run under `bun run test`.

Closes Heliobond#917
- bunfig.toml sets [install] minimumReleaseAge to 3 days, so bun does not
  install a version published in the last 3 days. minimumReleaseAgeExcludes
  is the documented escape hatch for a hotfix that needs same-day installs.
- scripts/require-bun.mjs runs as preinstall and fails npm, yarn and pnpm
  installs, which would read the wrong lockfile and run install scripts.
- trustedDependencies stays absent; CONTRIBUTING.md documents the policy.
- repoHygiene test: the expected setup-bun step count rises to 5 for the
  new supply-chain job.

Closes Heliobond#919
Adds a Scorecard workflow that publishes results to Security > Code
scanning on push to main, on a weekly schedule and on branch protection
changes. Actions are pinned to commit SHAs so the Pinned-Dependencies
check does not flag this workflow.

The Socket package-risk scanner from the issue needs a Socket GitHub App
install or an API token secret, so it is not part of this change.

Refs Heliobond#922
CI installs bun 1.2.4 from packageManager, which has no `audit` command.
The gate then saw unparseable output and failed closed, as designed. The
gate now runs the audit through bun 1.3.14 via bunx, leaving the repo's
pinned bun version unchanged.

Refs Heliobond#917

@dadadave80 dadadave80 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I reviewed the supply-chain changes for the supply-chain-reviewed label. I found nothing that runs unexpected code, and the gates do what they say. A few things are worth tightening.

Checked

  • Lockfile: every bun.lock change is a registry version bump with an integrity hash, and lockfile-lint confirms all 1,213 packages. No new packages enter the tree beyond re-nested @vitest/* and caniuse-lite copies. The axios copies at 1.16.0 and 1.18.0 now resolve to 1.20.0, which clears the 7 high advisories. next resolves to 16.4.2, a minor bump rather than only the 16.3.8 patch, and build and e2e pass.
  • New script: the only new package.json script is preinstall. scripts/require-bun.mjs only checks npm_config_user_agent.
  • audit-gate.mjs fails closed: a tool error, an unexpected exit code, unparseable JSON, exit 1 with no findings, and an expired allowlist entry all fail the gate. On this PR only braces is allowlisted (dev-only, no fix published yet, expires 2026-12-31).
  • Workflows: Scorecard is pinned to commit SHAs and its permissions are scoped to the job. dependency-review is read-only.

Please address (follow-ups are fine)

  1. Deleting package-lock.json blinds GitHub's dependency graph. The graph and the dependency compare API only read package-lock.json, not bun.lock: the compare for this PR lists 1,018 entries, all from the file being deleted. After merge, dependency review has nothing to compare and Dependabot alerts lose their data source. The bun audit gate becomes the real check. Tracked in #928 (submit a bun.lock dependency snapshot).
  2. Overrides without an upper bound. ws, postcss, browserslist, follow-redirects, smol-toml, source-map-js and launch-editor use >=, so the next lock regeneration could jump to a new major version. Please use ^ like axios and nanoid.
  3. Overrides that look unnecessary. launch-editor doesn't appear in the resolved lock, and baseline-browser-mapping isn't tied to any advisory. Please drop both, or say why they're needed.

Notes

  • The ws override moves @walletconnect/jsonrpc-ws-connection and jayson from ws 7 to 8, which is a major version change. In the browser they use the native WebSocket, so the risk is low.
  • minimumReleaseAge only takes effect when the lock is re-resolved. CI installs with --frozen-lockfile on bun 1.2.4, so in practice it protects local bun add and bun update, not CI.

@github-actions

Copy link
Copy Markdown

Thanks for the PR! A maintainer will take a look shortly. ✨

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
heliobond Ready Ready Preview Oct 22, 2026 3:13pm UTC

@dadadave80
dadadave80 merged commit ec3e7f2 into Heliobond:main Oct 22, 2026
10 of 11 checks passed

This branch was successfully deployed

1 active deployment
Preview — 84a7dd92 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants