Skip to content

chore(client): clear 11 devtime advisories via transitive overrides#517

Merged
Detair merged 1 commit into
mainfrom
fix/client-devtime-advisories
Apr 11, 2026
Merged

chore(client): clear 11 devtime advisories via transitive overrides#517
Detair merged 1 commit into
mainfrom
fix/client-devtime-advisories

Conversation

@Detair

@Detair Detair commented Apr 11, 2026

Copy link
Copy Markdown
Owner

Summary

Reduces client bun audit from 17 advisories (10 high, 7 moderate) to 6 (3 unique CVEs, all dev-server only) by adding package.json overrides for transitive devtime dependencies.

11 of 17 advisories cleared. The remaining 3 unique CVEs are all in vite@7.3.1 (nested via vitest@4.1.0 > @vitest/mocker > vite), affect only the dev server, and are documented as accepted exceptions below.

Overrides applied

"overrides": {
  "picomatch": "^4.0.4",
  "rollup": "^4.60.1",
  "flatted": "^3.4.2",
  "brace-expansion": "^1.1.13",
  "lodash-es": "^4.17.24",
  "defu": "^6.1.5"
}

Each clears one or more advisories. Notably, rollup is NOT a no-op — even though this project uses rolldown-vite, @rollup/plugin-commonjs still has a nested rollup that's patched by the override.

Why no vite override

Tested vite: 8.0.0 through vite: 8.0.8 — all fail tests with "Failed to parse source for import analysis" on Toast.tsx. Root cause: vitest@4.1.0 bundles a nested vite@7.3.1 via @vitest/mocker. When bun applies a vite override globally, both the direct vite and the nested one resolve to the same version — and @vitest/mocker@4.1.0's internal API is incompatible with vite 8.x in the nested slot.

Bun 1.3.9 does not support scoped overrides ("vitest>vite": "..."), so we cannot patch only one.

Accepted exceptions (3 unique CVEs, 6 raw reports)

All three are in nested vite@7.3.1 via vitest > @vitest/mocker > vite. All three require a developer to run bun run dev AND visit a malicious URL in their browser. None affect production builds (bun run build uses rolldown-vite's build path, not the dev server).

CVE Severity Description
GHSA-4w7w-66w2-5vf9 moderate Vite Path Traversal in Optimized Deps .map handling
GHSA-v2wj-q39q-566r high Vite server.fs.deny bypassed with queries
GHSA-p9ff-h696-f583 high Vite Arbitrary File Read via Dev Server WebSocket

Exploitation path: dev-server only. Developer runs bun run dev, malicious URL is visited in the dev server's browser tab, attacker gets file read / path traversal. Production is unaffected.

Developer detection: CI bun audit still reports these (we don't suppress them). A future vitest bump that drops the nested vite pin will auto-clear them.

Why not fix now: would require bumping vitest + vite-plugin-solid in lockstep, which is Plan B scope and out of this PR's scope.

Mermaid load mode

Confirmed lazy-loaded: client/src/components/pages/MarkdownPreview.tsx:21 uses await import("mermaid") inside loadMermaid(). The lodash-es runtime exposure (via mermaid > dagre-d3-es) only triggers when a user views a markdown block that renders a mermaid diagram. The lodash-es ^4.17.24 override still applies for defense in depth.

Test plan

  • bun install — 504 packages, clean
  • bun audit — 6 (was 17), all 3 unique CVEs documented above
  • bun run test:run — 577/577 passing
  • bun run build — succeeds
  • CHANGELOG.md — Security entry added
  • CI Frontend job passes

Refs

🤖 Generated with Claude Code

Adds package.json overrides for picomatch, rollup, flatted,
brace-expansion, lodash-es, and defu to resolve 11 of 17 devtime
advisories reported by bun audit.

vite is NOT overridden. vitest@4.1.0 bundles a nested vite@7.3.1 via
@vitest/mocker, and overriding vite to any version (8.0.0 through
8.0.8) causes vite-plugin-solid JSX regressions ("Failed to parse
source for import analysis" on Toast.tsx) because @vitest/mocker's
internal vite API is incompatible with vite 8.x when used as the
nested dependency. Downgrading direct vite to 7.3.2 would touch a
direct dep (forbidden by spec). Bun 1.3.9 does not honor nested
overrides syntax, so a scoped vitest>vite override is not available.

The 3 remaining vite advisories (GHSA-4w7w-66w2-5vf9,
GHSA-v2wj-q39q-566r, GHSA-p9ff-h696-f583) all affect the vite dev
server's fs.deny handling, .map path traversal, and WebSocket file
read. They are accepted as documented dev-only exceptions: they
only matter when a developer runs `bun run dev` and visits a
malicious URL in their browser. Not applicable to production builds
(bun run build is unaffected, rolldown-vite handles production).

Mermaid is lazy-loaded via dynamic import in MarkdownPreview.tsx, so
the lodash-es runtime exposure (via mermaid > dagre-d3-es) is
minimal even without the lodash-es override — but we apply it anyway
for defense in depth.

Direct dependencies are unchanged. 577/577 client tests pass and
bun run build succeeds.

Refs docs/superpowers/specs/2026-04-11-security-audit-followups-design.md (Topic 1)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Detair Detair merged commit 8d1655e into main Apr 11, 2026
17 checks passed
@Detair Detair deleted the fix/client-devtime-advisories branch April 11, 2026 21:45
Detair added a commit that referenced this pull request Apr 11, 2026
The first-run osv-scan (after flag fix) found 34 vulnerabilities — most
are already accepted via deny.toml / rust-audit ignores or via PR #517
(vite dev-server exceptions nested through vitest). osv-scanner is
stricter than cargo-audit: it flags "unmaintained" crates as errors
where cargo-audit treats them as warnings.

Create .osv-scanner.toml at repo root with an explicit ignore list:

- 3 entries already in deny.toml (rsa Marvin, rand 0.8.5, lru)
- 11 entries for the gtk-rs 0.18 family (Linux-only Tauri deps, blocked
  on Tauri's gtk-rs pin)
- 11 entries for unmaintained-crate advisories (proc-macro-error, paste,
  instant, derivative, fxhash, unic-*, bincode)
- 3 entries for the vite CVEs already documented in PR #517 as accepted
  dev-only exceptions

Also pass --config to scan-args so the scanner picks up the file.

Local verification: osv-scanner --config=.osv-scanner.toml --recursive ./
now reports "No issues found" with 36 filtered vulnerabilities.

When NEW advisories appear, osv-scanner will fail the build and we
investigate, then either fix the dep or add a new entry here.

Refs: first-run findings at https://github.com/Detair/kaiku/actions/runs/24293038310
Detair added a commit that referenced this pull request Apr 11, 2026
* fix(ci): remove invalid osv-scanner flags (--skip-git, --severity)

The osv-scan job failed on first-run with "Incorrect Usage: flag
provided but not defined: -skip-git". Both --skip-git and --severity
were incorrect guesses — osv-scanner v2.3.5 does not accept them.

Strip to minimal known-good flags: --recursive --format=sarif
--output=... ./. The scanner now gates on ANY vulnerability via
its default exit code. SARIF upload still publishes to Code
Scanning for tracking.

If the scan is too noisy post-merge, severity filtering can be
applied via GitHub's Security tab or by post-processing the SARIF.

Refs: first-run failure at https://github.com/Detair/kaiku/actions/runs/24292956710

* ci(security): add .osv-scanner.toml ignore config, pass --config flag

The first-run osv-scan (after flag fix) found 34 vulnerabilities — most
are already accepted via deny.toml / rust-audit ignores or via PR #517
(vite dev-server exceptions nested through vitest). osv-scanner is
stricter than cargo-audit: it flags "unmaintained" crates as errors
where cargo-audit treats them as warnings.

Create .osv-scanner.toml at repo root with an explicit ignore list:

- 3 entries already in deny.toml (rsa Marvin, rand 0.8.5, lru)
- 11 entries for the gtk-rs 0.18 family (Linux-only Tauri deps, blocked
  on Tauri's gtk-rs pin)
- 11 entries for unmaintained-crate advisories (proc-macro-error, paste,
  instant, derivative, fxhash, unic-*, bincode)
- 3 entries for the vite CVEs already documented in PR #517 as accepted
  dev-only exceptions

Also pass --config to scan-args so the scanner picks up the file.

Local verification: osv-scanner --config=.osv-scanner.toml --recursive ./
now reports "No issues found" with 36 filtered vulnerabilities.

When NEW advisories appear, osv-scanner will fail the build and we
investigate, then either fix the dep or add a new entry here.

Refs: first-run findings at https://github.com/Detair/kaiku/actions/runs/24293038310
Detair added a commit that referenced this pull request May 8, 2026
#550)

Phase 2 of the dep-update sweep. Adds transitive overrides for postcss,
uuid, and dompurify. The vite override planned in the spec is dropped:
forcing nested vite to 8.x breaks vitest 4.1.0's @vitest/mocker (the
known issue from PR #517). The 6 vite advisories that remain are
already accepted dev-only exceptions in .osv-scanner.toml; they unblock
in Phase 6c (vitest test-infra majors).

bun audit: 8 → 6 advisories; the 6 remaining are vite/vitest dev-server
paths, all behind .osv-scanner.toml exceptions.

Direct-dep bumps the spec planned for this phase (dompurify 3.3.3 →
3.4.2, @sentry/browser 10.44.0 → 10.52.0, @vitejs/plugin-basic-ssl
2.2.0 → 2.3.0) already landed in Phase 1 via targeted bun update; this
PR only adds the overrides + CHANGELOG.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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