Skip to content

Remediate dependency advisories + add audit CI gate (closes #1728, #1719) - #1745

Merged
mstomar125 merged 1 commit into
mainfrom
worktree-issue-1728-advisory-remediation
Jul 25, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
worktree-issue-1728-advisory-remediation

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

Remediates the pre-existing dependency advisories that blocked the #1719 audit gate, then lands the gate itself (green). Fix what's fixable; allowlist the rest with per-entry justification and a tracked follow-up. Closes #1728 and #1719; supersedes the parked draft PR #1727.

Rust (cargo audit)

  • cargo update: crossbeam-epoch 0.9.20 (RUSTSEC-2026-0204), quinn-proto 0.11.16 (RUSTSEC-2026-0185).
  • .cargo/audit.toml allowlists 6 upstream-blocked vulns with justification: quick-xml×2 (pinned by tauri/plist), rustls-webpki×4 (the vulnerable 0.102.8 is pinned by libsql 0.6.0; the fixed 0.103.13 is already in the tree). Tracked in Bump libsql (rustls 0.23) + tauri/quick-xml to clear the 6 allowlisted Rust advisories #1743.
  • The 25 unmaintained-crate entries are non-failing warnings (no ignore needed).

npm (bun audit)

  • Root package.json overrides pin patched (same-major) versions of the 14 production/framework advisories: critical shell-quote, high @grpc/grpc-js/protobufjs/devalue/lodash-es/form-data, plus @sveltejs/kit, svelte, mermaid, postcss, uuid, ws, js-yaml, and dompurify.
  • dompurify is pinned to 3.4.7 — the highest version DOMPurify still sanitizes correctly under Happy-DOM (our unit-test DOM); >3.4.7 fails-open there and would silently drop sanitizeSvg's coverage. 3.4.7 fixes the cross-realm / IN_PLACE / prototype-pollution advisories; the 4 residual low/moderate ones are allowlisted (dompurify is defense-in-depth over mermaid, which renders securityLevel:'strict', htmlLabels:false). Tracked in Clear the 18 allowlisted npm advisories (dompurify→browser-mode tests, dev-tooling major bumps) #1744.
  • New scripts/audit-npm.ts wraps bun audit and fails on any advisory outside a justified allowlist. 18 entries, every one dev/build/test-only (vitest, @vitest/browser, happy-dom, vite, esbuild, brace-expansion-via-eslint) or upstream-pinned (cookie via SvelteKit, dompurify residuals). A NEW advisory in any non-allowlisted (incl. production) package fails the gate.

Gate

  • .github/workflows/audit.yml — cargo audit (reads .cargo/audit.toml) + bun run audit (the wrapper) on every PR. actions/checkout@v7, oven-sh/setup-bun@v2 pinned 1.3.11.

Verification

  • cargo audit: exit 0. bun run audit: exit 0 (18 allowlisted).
  • bun install --frozen-lockfile: clean. svelte-check: 0 errors.
  • Full frontend suite: 166 files, 4091 tests passing after all dependency bumps (the only initial breakage — mermaid sanitizeSvg under Happy-DOM — is resolved by the dompurify 3.4.7 ceiling).
  • Independent adversarial review: CONFIRMED-GOOD — verified against the live tree that no accepted advisory is a real shipped-to-users risk. Each of the 4 dompurify residuals requires a DOMPurify config option (setConfig / CUSTOM_ELEMENT_HANDLING / SAFE_FOR_TEMPLATES+RETURN_DOM / RETURN_TRUSTED_TYPE) that neither consumer sets (mermaid-render.ts and the primary chat-markdown sanitizer), so none is reachable here. All 14 overrides stay in-major (no surprise prod major bump); .cargo/audit.toml ignores are genuinely upstream-blocked; the gate still fails on any new advisory on both sides. The review's one code finding — audit-npm.ts could fail-open if bun audit itself errored with empty stdout — is fixed (it now checks the exit code and fails closed); the dompurify allowlist comment was tightened to note its primary chat-markdown role.

Closes #1728. Closes #1719.

)

Rust (cargo audit, .cargo/audit.toml):
- cargo update: crossbeam-epoch 0.9.20 (RUSTSEC-2026-0204), quinn-proto 0.11.16
  (RUSTSEC-2026-0185).
- Allowlist 6 upstream-blocked vulns w/ justification: quick-xml x2 (pinned by
  tauri/plist), rustls-webpki x4 (0.102.8 pinned by libsql 0.6.0; fixed 0.103.13
  already in tree). Tracked for follow-up.

npm (bun audit via scripts/audit-npm.ts):
- package.json overrides pin patched versions of 14 prod/framework advisories
  incl. critical shell-quote, high @grpc/grpc-js, protobufjs, devalue, lodash-es,
  form-data; plus dompurify (3.4.7 - the Happy-DOM sanitization ceiling), svelte,
  @sveltejs/kit, mermaid, postcss, uuid, ws, js-yaml.
- scripts/audit-npm.ts wraps bun audit and fails on any advisory outside a
  justified allowlist (dev/build/test-only + upstream-pinned). 18 allowlisted.

Gate (.github/workflows/audit.yml): cargo audit + bun run audit on every PR.
Both exit 0 now; full frontend suite 4091/4091 green after the dep bumps.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE

Independent adversarial review returned CONFIRMED-GOOD after verifying against the live tree (ran the gate script, cross-checked both lockfiles, web-verified each dompurify advisory's preconditions). Key confirmations: no accepted advisory is a real shipped-to-users vulnerability — all 4 dompurify residuals require config options (setConfig / CUSTOM_ELEMENT_HANDLING / SAFE_FOR_TEMPLATES+RETURN_DOM / RETURN_TRUSTED_TYPE) that neither DOMPurify consumer (mermaid-render + chat-markdown) sets; all 14 overrides stay in-major (no surprise prod bump, all resolve in the frozen lockfile); the 6 cargo ignores are genuinely upstream-blocked (libsql 0.6.0 / tauri); and the gate still fails on any NEW advisory on both sides. The review's one finding — a fail-open if bun audit errored with empty stdout — is fixed (now checks exit code, fails closed). Full frontend suite 4091/4091, cargo audit + bun run audit both exit 0, pre-push gate green.

@mstomar125
mstomar125 merged commit cb9f51a into main Jul 25, 2026
2 checks passed
@mstomar125
mstomar125 deleted the worktree-issue-1728-advisory-remediation branch July 25, 2026 09:51
malibio added a commit that referenced this pull request Aug 7, 2026
Reaffirms the standing decision from ci.yml's removal (#1618) — GitHub
Actions is scoped to release.yml only, no workflow runs automatically on
pull_request. audit.yml (dependency-vuln scanning, added #1745) had
re-introduced a PR-triggered hosted workflow; removed to match the
current intended posture. Local pre-push hook remains the sole gate.
Revisit CI/CD on GitHub at a later time — see ADR-047's 2026-08-07
amendment in nodespace-docs.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant