Skip to content

Bump vitest to 3.2.7 and pin vite to 6.4.3, clearing security alerts - #8

Merged
AnderRV merged 1 commit into
mainfrom
fix/vite-vitest-security-patch
Aug 21, 2026
Merged

Bump vitest to 3.2.7 and pin vite to 6.4.3, clearing security alerts#8
AnderRV merged 1 commit into
mainfrom
fix/vite-vitest-security-patch

Conversation

@AnderRV

@AnderRV AnderRV commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

Closes #3 in favor of a targeted fix. #3 (dependabot) proposed vitest/@vitest/coverage-v8 1.6.1 → 4.1.11, which broke CI on Node 18.x and 20.x — vitest 4's new rolldown bundler imports node:util.styleText, unavailable on those runtimes. Confirmed via #3's own failing checks before closing it.

  • Bumps vitest/@vitest/coverage-v8 to 3.2.7 (latest 3.x) instead — clears the critical CVE (advisory range <=3.2.5) without pulling in rolldown, and still declares support for Node 18/20/22.
  • Pins vite to 6.4.3 via overrides — the first patched 6.x release (advisory range <=6.4.2). Pinning is necessary: left to float, vitest 3.2.7's peer range (^5 || ^6 || ^7.0.0-0) resolves to vite 7.x by default, which requires Node ^20.19.0 || >=22.12.0 and would reintroduce the same CI break.
  • vite itself drops out of being a direct concern here (it was never a direct dependency — always transitive via vitest) but the version genuinely matters for the vulnerability fix, hence the explicit pin.

Verification

Went beyond CI — reproduced the exact regression first, then verified the fix directly:

  • Confirmed chore(deps): bump vite, @vitest/coverage-v8 and vitest #3 (vitest 4.1.11) fails build (18.x) and build (20.x) in its own CI run, passes only 22.x — root-caused to rolldown's node:util.styleText import.
  • npm audit before this PR: 2 critical/high findings for vitest+coverage-v8 (<=3.2.5) and vite (<=6.4.2), confirmed against the actually installed tree, not just advisory text.
  • After this PR: npm audit shows those two cleared. Confirmed resolved versions directly: vitest@3.2.7, @vitest/coverage-v8@3.2.7, vite@6.4.3 (no nested 7.x, no rolldown anywhere in the tree).
  • npm run build, npm run lint, npm test (the exact CI commands) all pass locally.
  • tests/integration/lib.test.ts still fails locally with "API key required" — pre-existing, intentional (needs CI_ZENROWS_API_KEY, only set in real CI), not a regression.

Out of scope, flagged not fixed

npm audit still shows extract-zip/@puppeteer/browsers/puppeteer-core (high, runtime dependency chain via Puppeteer) and tsup's own esbuild (low). Separate, pre-existing chain unrelated to vite/vitest — extract-zip's advisory has no upstream patch available at all (first_patched_version: null), so there's nothing to bump to yet. Worth its own look, not folded in here to keep this PR's diff scoped to the actual ask.

https://claude.ai/code/session_01DTXXBERPGEnYiYP4Mt3FjF

Fixes real, currently-open Dependabot alerts confirmed via `npm audit`
against the actual installed tree (not just the advisory text):
vitest/@vitest/coverage-v8 critical (<=3.2.5, we were on 1.6.1) and
vite high (<=6.4.2, we were on 5.4.21 transitively).

Deliberately does NOT take the dependabot-proposed vitest 4.1.11 —
that pulls in vitest 4's new rolldown-based bundler, which imports
node:util.styleText and breaks Node 18.x/20.x (confirmed via that
PR's own failing CI checks). vitest 3.2.7 has no such dependency and
still declares support for Node 18/20/22, matching this repo's CI
matrix.

vite is pinned via `overrides` rather than left to floating
resolution, because vitest 3.2.7's peer range (^5 || ^6 || ^7-0)
otherwise resolves to vite 7.x, which requires Node >=20.19/22.12 and
would reintroduce the same CI break. vite 6.4.3 is the first patched
6.x release and keeps full Node 18/20/22 support.

Remaining npm audit findings (extract-zip, @puppeteer/browsers,
puppeteer-core, tsup's own esbuild) are a separate, pre-existing
dependency chain unrelated to vite/vitest — extract-zip has no
upstream patch available at all — out of scope here.
@AnderRV
AnderRV requested a review from a team as a code owner August 21, 2026 09:03
@AnderRV AnderRV self-assigned this Aug 21, 2026
@AnderRV
AnderRV merged commit 2bf110b into main Aug 21, 2026
3 checks passed
@AnderRV
AnderRV deleted the fix/vite-vitest-security-patch branch August 21, 2026 09:58
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