Skip to content

fix(deps): clear 16 vulnerable versions; make vulncheck guards every module - #143

Merged
jayleaton merged 2 commits into
mainfrom
deps/security-updates
Oct 31, 2026
Merged

jayleaton merged 2 commits into
mainfrom
deps/security-updates

Conversation

@jayleaton

@jayleaton jayleaton commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Problem

Same change as jayleaton/sparkrack#33.

The same 16 vulnerable dependency versions (1 critical, 4 high, 4 medium, 3 low, 4 not rated) that Lockpick flagged on sparkrack#28 (generated from this template) are in this repo too. They were spread across go.mod, tools/go.mod, tools/actionlint/go.mod and apps/mobile-app/pnpm-lock.yaml, and nothing in the repo would have stopped a new one landing.

Fix

go.mod                    golang.org/x/net        v0.61.0 -> v0.62.0   GO-2026-6866, GO-2026-6860
tools/go.mod              golang.org/x/net        v0.61.0 -> v0.62.0   GO-2026-6866, GO-2026-6860
                          google.golang.org/grpc  v1.83.1 -> v1.83.2   GO-2026-6443 / GHSA-2v4p-qf9q-27wj (high)
                          github.com/google/cel-go v0.28.0 -> v0.30.0  GO-2026-6094 / GHSA-gcjh-h69q-9w9g
                          + golang.org/x/vuln v1.9.0 (govulncheck, pinned as a tool)
tools/actionlint/go.mod   golang.org/x/sys        v0.42.0 -> v0.44.0   GO-2026-5024
apps/mobile-app           better-auth, @better-auth/expo 1.6.29 -> 1.7.14   critical GHSA-965c-763c-88jm + 3 more
                          pnpm.overrides: node-forge ^1.4.1, glob@^13 -> ^14.0.2, minimatch@^10 -> ^11.0.1

The critical one (better-auth GHSA-965c-763c-88jm, "OAuth state can be used as a Magic Link"), and why we were not exposed. The bug is in better-auth's server handlers. The mobile app imports only the client (better-auth/react, @better-auth/expo/client), and our server is the Go packages/auth, so that code never runs. Because packages/auth is modelled on Better Auth, I checked that it doesn't share the bug's design. It does not: every verification row is namespaced by its purpose (oauth-state:, oauth-handoff:, reset-password:, 2fa:, trust-device:, change-email:), each flow only ever looks up its own prefix, and there is no magic-link flow. Bumped anyway.

better-auth 1.7 API change: authClient.getCookie() is now async. apiFetch (src/lib/api/client.ts) now awaits it; without that it would have sent Cookie: [object Promise]. typecheck caught it. The contract test's three getCookie() checks await it too.

No usable fix, allowlisted in scripts/vulncheck/allowlist.txt. Each entry has a reason and a review date of 2027-01-31.

Advisory Package Why it stays
GO-2026-5932 golang.org/x/crypto (openpgp) The advisory covers the whole package, so every x/crypto version matches it. No module imports openpgp (go list -deps -test finds 0 in every module; govulncheck reports it only at module level). We use argon2, scrypt, chacha20poly1305, hkdf and curve25519.
GHSA-qr28-fpjm-wq7f, GHSA-vcc3-ghjq-m6fr decode-uri-component 0.2.2 expo-router 57 → query-string 7 (CommonJS) requires it as a function, and the fix (0.5.x) is ESM-only. This one ships in the app; the worst case is one device's app instance hanging.
GHSA-mrhx-c7xc-m3w5 zod 3.25.76 Pulled in by @expo/cli (dev-time only), which needs zod 3; the fix is zod 4. The app's own zod is 4.6.7.
GHSA-g3hv-75wg-m249 minimatch 3.1.5 Pulled in by eslint 9 (dev-time only), which needs the v3 CJS function export; the fix is v11.
GHSA-gcqx-w48m-w2h4 deepmerge 4.3.1 Pulled in by @expo/config at build time; no fix has been published.

Regression guard: make vulncheck (scripts/vulncheck).

  • What it scans: govulncheck on all four Go modules (. and deploy with ./...; tools and tools/actionlint with tool), plus pnpm audit on the mobile lockfile.
  • What fails: any finding, called or not. Allowlisted entries are the only exception, and the check also fails on an expired entry, an entry that no longer matches anything, or a listed Go advisory that our code calls.
  • Where it runs: make ci always runs it, so make nightly (feat(ci): make nightly runs the full suite on main #141) picks it up too. make check-fast runs it when a go.mod, go.sum, package.json, pnpm-lock.yaml or the allowlist changes. It only warns there if the scanner can't run (offline or no pnpm, exit 2).
  • Cost: about 8 s warm. Documented in docs/CI.md under "Known vulnerabilities" and in AGENTS.md.

Evidence

Go (govulncheck, 4 modules) npm (pnpm audit) Lockpick
Before (main) 6: tools 4, actionlint 1, root 1 (openpgp) 25: 1 critical, 10 high, 7 moderate, 7 low 16 (same set as sparkrack#28)
After 1, allowlisted (openpgp, module level only) 5, allowlisted: 0 critical, 2 high, 2 moderate, 1 low expected 5 (x/crypto, decode-uri-component, zod, minimatch 3, deepmerge)
  • Before: go run ./scripts/vulncheck on a detached origin/main exits 1 with 29 findings, including GHSA-965c-763c-88jm better-auth@1.6.29 (critical, fixed in >=1.7.7) and tools: GO-2026-6443 google.golang.org/grpc@v1.83.1 (fixed in v1.83.2).
  • After: vulncheck: ok (4 Go modules, 1 lockfiles, 6 allowlisted).
  • Proof the guard fails: an expired review date and an entry that matches nothing each produce a FAIL and exit 1.
  • About root x/net: govulncheck doesn't flag the root module's x/net 0.61.0, because no package in the build graph uses x/net/html. Lockpick reads go.mod, so it was bumped anyway.
  • Mobile checks: pnpm install --frozen-lockfile, tsc, expo lint, expo install --check and pnpm test (18 tests) pass.
  • Not run: pnpm test:contract. It is broken on main for a reason unrelated to this change. Node's fetch sends Sec-Fetch-Mode: cors, and the API's browser gate (apps/web/internal/server/middleware.go, same code as sparkrack; seen there) answers that with a 404, so setup times out waiting on /healthz. That is follow-up work. The getCookie awaits are therefore type-checked but not run against a server.

Merge Danger

Door: two-way. Revert restores the old versions.

Blast Radius: mobile-auth. better-auth 1.7 is a minor-version bump of the mobile auth client; its only API change that affects us (getCookie is now async) is handled. The Go bumps are patch or minor versions of indirect dependencies, and the tools only affect dev tooling.

Local verification

Filled by make ci-local, 2026-10-31T15:47:26Z. Never edit this section by hand.

Head 286ad05b2ec0becc8137b01ad68915e5c537764a · tree bd103431b723 · passed
Attested by JJ Eaton on MacBook-Pro-3.local

Ran: make ci (build, check-generated, lint, test -race + coverage, lint-layering, lint-tests, deploy-check, vulncheck); make admin-build actionlint check-fast; apps/mobile-app: pnpm install --frozen-lockfile, tsc, expo lint, expo install --check, pnpm test (test:contract not run: Node fetch Sec-Fetch-Mode hits the API browser gate, pre-existing)

🤖 Generated with Claude Code

jayleaton and others added 2 commits October 31, 2026 22:39
…dule

x/net v0.62.0 (root, tools), grpc v1.83.2, cel-go v0.30.0 (tools),
x/sys v0.44.0 (tools/actionlint). govulncheck v1.9.0 pinned in tools/go.mod.
GO-2026-5932 (x/crypto/openpgp, no fix) allowlisted: never imported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…forge/glob/minimatch overrides

getCookie() is async in better-auth 1.7: await it in apiFetch, which
would otherwise send 'Cookie: [object Promise]'. Remaining npm advisories
(no compatible fix, dev-time or client-only) allowlisted with reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayleaton
jayleaton merged commit 2d332e0 into main Oct 31, 2026
4 of 7 checks passed
@jayleaton

Copy link
Copy Markdown
Owner Author

Authorized by JJ ("please also merge the PRs on my template"), merged by Captain with --admin after make ci-local attested head 286ad05b2ec0becc8137b01ad68915e5c537764a (local-ci success).

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.

1 participant