Repository navigation
Clear 17 of 18 allowlisted npm advisories (dompurify browser-mode tests, dev-tooling major bumps) - #1869
Conversation
…1744) Pin brace-expansion to 1.1.17 via overrides (transitive through eslint's minimatch), bump happy-dom 18 -> 20.11.1, and bump vite 6.0.3 -> 6.4.3. Clears 7 of the 18 allowlisted GHSA advisories. The remaining vite/launch-editor/esbuild advisories turned out to be unreachable from our top-level vite (already bumped) - they come from a second and third vite instance vendored inside vitest 2.x's own peer resolution (@vitest/mocker, vite-node), which only clears with the vitest 3.x major bump tracked separately in this issue. Co-Authored-By: Claude <[email protected]>
…ries (#1744) vitest 2.x's own peer resolution (vite-node, @vitest/mocker) vendored a second and third copy of vite (5.4.21, 6.4.1) plus an old esbuild, all independent of our already-bumped top-level vite. Bumping vitest (and @vitest/browser, @vitest/coverage-v8) to 3.2.7 across both workspaces collapses all vite/esbuild instances to the single already-clean version, clearing 7 more GHSA advisories. Bump one test's timeout to 10s: it races a mocked 10s persistence call against the store's own internal 5s flush timeout, which itself races vitest's 5s default testTimeout — a zero-margin double race that the vitest 3.x scheduler now consistently loses. The 5s internal timeout is real production behavior; only the test's outer timeout needed headroom. Co-Authored-By: Claude <[email protected]>
…1744) DOMPurify >3.4.7 fails open under Happy-DOM's DOM approximation (confirmed: bumping first without moving tests silently dropped the <svg> wrapper from sanitized output under Happy-DOM while real Chromium sanitized correctly). sanitizeSvg's own tests, and renderMermaid's tests (which call the real, unmocked sanitizeSvg on every render — only the mermaid module itself is mocked), both needed real-DOM fidelity to mean anything, so the whole file moves to src/tests/browser/mermaid-sanitize.test.ts. Bumps dompurify from the 3.4.7 Happy-DOM ceiling to 3.4.12, clearing the last 4 GHSA advisories that were blocked on this. 17 of the original 18 allowlisted advisories are now cleared; only the cookie advisory remains, genuinely blocked on an upstream @sveltejs/kit bump. Co-Authored-By: Claude <[email protected]>
Code Review SummaryClean, well-scoped dependency-hygiene PR. It clears 17 of 18 npm advisories allowlisted in Requirements Check (issue #1744)
All acceptance criteria that were in scope for this issue are met. FindingsCritical IssuesNone. Suggested Improvements
Nitpicks
Verification Performed (independent, not from PR body)
Recommendation: APPROVEThis is a textbook example of a well-scoped, atomic dependency-hygiene PR: single cohesive purpose, every claim independently verifiable and verified, tests genuinely moved (not deleted) with equivalent-or-better coverage, a real flakiness root-cause fix rather than a timeout band-aid, and an honest, explicitly-flagged open question about test-gating policy left for a human/product call rather than silently resolved either way. Nothing here blocks merge. The one suggested improvement (wire |
malibio
left a comment
There was a problem hiding this comment.
Review recommendation: APPROVE (self-approval blocked by GitHub — same author account). Full report posted above. Net positive, no blockers found; all quantitative claims in the PR body independently re-verified (audit output, all 4 test suites re-run, lockfile inspected directly).
…break test:coverage Supersedes the 1.1.17 -> 1.1.18 bump this branch originally carried. Deleting the override, rather than bumping it, fixes both problems at once. The pin was added in #1869 to clear an advisory, but `overrides` applies to the whole tree and cannot express "1.x here, 5.x there". Three consumers declare incompatible ranges, so all three were forced onto 1.x: [email protected] wants ^1.1.7 ok [email protected] wants ^2.0.2 forced to 1.x [email protected] wants ^5.0.5 forced to 1.x <- broken brace-expansion 1.x is CommonJS exporting only a default; minimatch@10 imports a named `expand`. So `bun run test:coverage` has been dead since #1869 with `TypeError: (0 , brace_expansion_1.expand) is not a function`, reached via test-exclude -> minimatch@10 and a braced include glob (`{test,spec}`). It went unnoticed because test:all runs test, test:scripts, test:skill and rust:test — never test:coverage. Upstream has since caught up, so the override is no longer needed at all. With it removed, natural resolution puts every consumer on its own major, each at or above this advisory's patched floor: [email protected] (floor 1.1.18) [email protected] (floor 2.1.4) [email protected] (floor 5.0.9) Verified in clean clones: `bun run audit` clean, and `test:coverage` runs to completion (172 files / 4112 tests, 88.43% lines). It still exits 1 on the 90% global threshold, which is pre-existing project state and unrelated to this change — the crash is what this fixes. Scoped override keys (`test-exclude/minimatch/brace-expansion`) were tried first and are silently ignored by Bun 1.3.11: accepted into the lockfile, no effect on resolution. Recorded so the next person does not retry it. Co-Authored-By: Claude <[email protected]>
…reaks test:coverage (closes #1950) (#1949) * Bump the brace-expansion override to 1.1.18 to clear GHSA-rgw5-rvv9-x895 `bun audit` has been failing on every PR: the pinned override sat at 1.1.17, one patch short of the fix for GHSA-rgw5-rvv9-x895 (high, DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation). The advisory patches the 1.x line in 1.1.18. The pin itself is load-bearing and stays: three different minimatch versions in the tree ask for `^1`, `^2` and `^5` respectively, and the override flattens all of them to one copy. Bumping the pinned version is therefore the whole fix — nothing else in the manifest needs to move. Verified: `bun run audit` clean, one resolved copy at 1.1.18, frontend suite 172 files / 4112 tests passing. Co-Authored-By: Claude <[email protected]> * Drop the brace-expansion override to clear GHSA-rgw5-rvv9-x895 and unbreak test:coverage Supersedes the 1.1.17 -> 1.1.18 bump this branch originally carried. Deleting the override, rather than bumping it, fixes both problems at once. The pin was added in #1869 to clear an advisory, but `overrides` applies to the whole tree and cannot express "1.x here, 5.x there". Three consumers declare incompatible ranges, so all three were forced onto 1.x: [email protected] wants ^1.1.7 ok [email protected] wants ^2.0.2 forced to 1.x [email protected] wants ^5.0.5 forced to 1.x <- broken brace-expansion 1.x is CommonJS exporting only a default; minimatch@10 imports a named `expand`. So `bun run test:coverage` has been dead since #1869 with `TypeError: (0 , brace_expansion_1.expand) is not a function`, reached via test-exclude -> minimatch@10 and a braced include glob (`{test,spec}`). It went unnoticed because test:all runs test, test:scripts, test:skill and rust:test — never test:coverage. Upstream has since caught up, so the override is no longer needed at all. With it removed, natural resolution puts every consumer on its own major, each at or above this advisory's patched floor: [email protected] (floor 1.1.18) [email protected] (floor 2.1.4) [email protected] (floor 5.0.9) Verified in clean clones: `bun run audit` clean, and `test:coverage` runs to completion (172 files / 4112 tests, 88.43% lines). It still exits 1 on the 90% global threshold, which is pre-existing project state and unrelated to this change — the crash is what this fixes. Scoped override keys (`test-exclude/minimatch/brace-expansion`) were tried first and are silently ignored by Bun 1.3.11: accepted into the lockfile, no effect on resolution. Recorded so the next person does not retry it. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Summary
Clears 17 of the 18 npm advisories tracked in
scripts/audit-npm.ts's allowlist since #1728. Only thecookieadvisory remains, genuinely blocked on an upstream@sveltejs/kitbump (still pinscookie: ^0.6.0as of the latest release).overrides(transitive through eslint'sminimatch).vite-node,@vitest/mocker), which vendored a second and third copy of vite independent of the top-level one — fully resolved by the vitest bump below.packages/desktop-app,packages/skill). This collapsed the extra vendored vite/esbuild instances vitest 2.x was carrying internally.sanitizeSvg's tests (andrenderMermaid's tests, which call the real unmockedsanitizeSvgon every render) moved from the Happy-DOM tier tosrc/tests/browser/mermaid-sanitize.test.ts(real Chromium viatest:browser), since DOMPurify >3.4.7 fails open under Happy-DOM's DOM approximation — confirmed directly: bumping dompurify before moving the tests silently dropped the<svg>wrapper from sanitized output under Happy-DOM, while real Chromium sanitized correctly. dompurify bumped 3.4.7 → 3.4.12.Test fix
shared-node-store-coverage.test.ts's "should handle errors during flush with timeout" test raced a mocked 10s persistence call against the store's own internal 5s flush timeout, which itself raced vitest's 5s defaulttestTimeout— a zero-margin double race vitest 3.x's scheduler now consistently loses. Gave the test a 10s timeout; the 5s internal timeout is real production behavior and didn't change.Note for reviewers
sanitizeSvg/renderMermaidtests now live undersrc/tests/browser/, which is currently not part oftest:allor the pre-push gate (test:browseris available but not wired into the required gate — seevitest.browser.config.tsand the WebKit nightly-tier comments). This PR does not change that gating; flagging it here since it means this security-relevant sanitization coverage only runs when a dev explicitly runsbun run test:browser(or in the nightly WebKit smoke tier, non-blocking). Happy to wiretest:browserintotest:allas a follow-up if that's wanted — it's a broader gating-policy call (ADR-047 territory) beyond this issue's scope.Test plan
bun run test— 170 files / 4097 tests passedbun run test:browser— 7 files / 106 tests passed (incl. 16 inmermaid-sanitize.test.ts)bun run test:skill— 20 tests passedbun run rust:test— all passedbun run quality:check— 0 errors/warningsbun run --cwd packages/desktop-app build— succeedsbun run audit— clean, 1 remaining allowlisted advisory (cookie, upstream-blocked)test:all,cargo build --bin nodespaced,test:e2e, Tauri-seam integration tests) — greenCloses #1744
Co-Authored-By: Claude [email protected]