Repository navigation
Supply-chain hardening: patch advisories, install policy, dependency review - #925
Merged
dadadave80 merged 7 commits intoOct 22, 2026
Conversation
|
@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
onyinyechinwokwu-success
force-pushed
the
feat/917-supply-chain-hardening
branch
from
October 22, 2026 14:42
d56a4de to
b23b30c
Compare
dadadave80
reviewed
Oct 22, 2026
dadadave80
left a comment
Contributor
There was a problem hiding this comment.
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.lockchange is a registry version bump with an integrity hash, andlockfile-lintconfirms all 1,213 packages. No new packages enter the tree beyond re-nested@vitest/*andcaniuse-litecopies. The axios copies at 1.16.0 and 1.18.0 now resolve to 1.20.0, which clears the 7 high advisories.nextresolves to 16.4.2, a minor bump rather than only the 16.3.8 patch, andbuildand e2e pass. - New script: the only new
package.jsonscript ispreinstall.scripts/require-bun.mjsonly checksnpm_config_user_agent. audit-gate.mjsfails 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 onlybracesis 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-reviewis read-only.
Please address (follow-ups are fine)
- Deleting
package-lock.jsonblinds GitHub's dependency graph. The graph and the dependency compare API only readpackage-lock.json, notbun.lock: the compare for this PR lists 1,018 entries, all from the file being deleted. After merge,dependency reviewhas nothing to compare and Dependabot alerts lose their data source. Thebun auditgate becomes the real check. Tracked in #928 (submit abun.lockdependency snapshot). - Overrides without an upper bound.
ws,postcss,browserslist,follow-redirects,smol-toml,source-map-jsandlaunch-editoruse>=, so the next lock regeneration could jump to a new major version. Please use^likeaxiosandnanoid. - Overrides that look unnecessary.
launch-editordoesn't appear in the resolved lock, andbaseline-browser-mappingisn't tied to any advisory. Please drop both, or say why they're needed.
Notes
- The
wsoverride moves@walletconnect/jsonrpc-ws-connectionandjaysonfromws7 to 8, which is a major version change. In the browser they use the native WebSocket, so the risk is low. minimumReleaseAgeonly takes effect when the lock is re-resolved. CI installs with--frozen-lockfileon bun 1.2.4, so in practice it protects localbun addandbun update, not CI.
|
Thanks for the PR! A maintainer will take a look shortly. ✨ |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks done
This branch was successfully deployed
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
One PR for the four open supply-chain issues assigned in this repo.
nextmoves to^16.3.8(resolves to 16.4.2).axiosis pinned to^1.20.0throughoverrides, along with other vulnerable transitives.viteandvitestare bumped for their advisories. The stalepackage-lock.jsonis removed and npm/yarn/pnpm lockfiles are gitignored. Dependabot is already on thebunecosystem.bun auditgate; block non-registry sources in bun.lock #917, CI gates. Adependency-reviewworkflow fails PRs that add high-severity or malware advisories. Asupply-chainCI job runsscripts/lockfile-lint.mjs, which asserts everybun.lockentry comes from the npm registry with asha512integrity hash.scripts/audit-gate.mjsrunsbun audit --jsonand fails closed on tool errors, unexpected exit codes and unparseable output. Its exceptions live inscripts/audit-allowlist.json, each with a reason and an expiry date.bunfig.tomlinstall policy — release-age cooldown, explicit trusted-dependency policy, bun-only installs #919, install policy.bunfig.tomlsets[install] minimumReleaseAge = 259200(3 days). Apreinstallguard (scripts/require-bun.mjs) refuses npm, yarn and pnpm installs.trustedDependenciesstays absent. CONTRIBUTING.md documents the policy.Linked issues
Closes #917
Closes #918
Closes #919
Refs #922 (Socket scanner still open, see above)
Audit numbers
bun auditbefore 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 througheslint-config-next. It is allowlisted until 2026-12-31.uuidandstream-json(moderate). Transitive throughjayson. 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
nextresolves to 16.4.2, not 16.3.8.^16.3.8allows 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.minimumReleaseAgeExcludesis empty. Add a package there only with maintainer sign-off.deny-licensesis not set, since no license list was agreed.supply-chainand the dependency review check tomain's required status checks.Test evidence
Run locally with bun 1.3.14 and Node 24, after
bun install --frozen-lockfile:typecheck: passlint: 0 errors, 2 pre-existing warningsformat:check: passtest:coverage: 133 files, 1496 tests passed, 3 expected failsbuildandbundle:check: pass, all routes within budgetscripts/*.test.mjs, 30 tests): lockfile lint, audit gate and the bun-only guard. These run underbun run test.node scripts/lockfile-lint.mjs: 1213 packages OKnode scripts/audit-gate.mjs: no unexcepted high or critical advisoriesnpm run preinstall(npm user agent): refused with a message pointing to CONTRIBUTING.bun run preinstall: passes.bun install: passes through the guard.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 freshadd. The default 3-day window installs.minimumReleaseAgeExcludeslets a named package through the same window.Not verified here:
continue-on-errorin CI).dependency-reviewand Scorecard workflows. These only run on GitHub.Checklist
Closes #…)bun run buildpasses locallybun run lint,bun run format:checkandbun run testpass locallySecuritySupply-chain changes
This PR changes
package.jsonscripts and dependencies,bun.lock, workflows,scripts/andbunfig.toml. Each change is there for the issue it cites:package.json:next,vite,vitest. Version bumps for published advisories (chore: 25 open Dependabot alerts (10 high) and no security-update PRs since September — upgrade now and fix the update pipeline #918).nextresolves to 16.4.2, published 2026-10-15.package.json:overrides. Pins vulnerable transitive packages to patched versions (chore: 25 open Dependabot alerts (10 high) and no security-update PRs since September — upgrade now and fix the update pipeline #918). Each one is listed in the first commit message.package.json:preinstall. The bun-only guard (security: add abunfig.tomlinstall policy — release-age cooldown, explicit trusted-dependency policy, bun-only installs #919). It blocks npm, yarn and pnpm installs, which would read the wrong lockfile and run install scripts.bun.lock. The resolved tree for the changes above.scripts/lockfile-lint.mjschecks it: 1213 packages, all from the npm registry withsha512hashes.bunfig.toml. A 3-day release-age cooldown (security: add abunfig.tomlinstall policy — release-age cooldown, explicit trusted-dependency policy, bun-only installs #919)..github/workflows/dependency-review.yml,scripts/audit-gate.mjs,scripts/audit-allowlist.json,ci.yml(supply-chainjob). The CI gates (ci: add dependency review and a fail-closedbun auditgate; block non-registry sources in bun.lock #917). The audit gate runsbun auditthrough a pinned bun 1.3.14, because CI's bun 1.2.4 has noauditcommand..github/workflows/scorecard.yml. OpenSSF Scorecard (tooling: enable OpenSSF Scorecard and a PR-time package-risk scanner (Socket or equivalent) on the frontend #922). Actions are pinned to commit SHAs.vitest.config.mts. Addsscripts/**/*.test.mjsto the test include, so the new script tests run..gitignore,.prettierignore,CONTRIBUTING.md. Lockfile ignores and the install policy (chore: 25 open Dependabot alerts (10 high) and no security-update PRs since September — upgrade now and fix the update pipeline #918, security: add abunfig.tomlinstall policy — release-age cooldown, explicit trusted-dependency policy, bun-only installs #919).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-reviewedmust be applied before this PR can merge (see thesupply-chain review gatejob).