[P1] Upgrade vitest to clear four dev-tooling npm advisories before the 2026-11-30 exception expiry #46
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/rag-rust#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Outcome and scope
Upgrade the frontend test tooling off the vulnerable
vitest3.2.7 line, remove the four temporary npm exceptions, and keep both frontend gates (type check, 80% line coverage, build) green.The post-merge security workflow (#45) found four advisories in development tooling. They are accepted in
web/audit-exceptions.txtuntil 2026-11-30. After that date the Security workflow fails on the expired entries, so this has to land first or the exceptions must be re-reviewed with a recorded reason.@vitest/mocker@vitest/mockertinypooltinypoolWhy it is not urgent, and why it still matters
These packages are development tooling only:
npm audit --omit=devreports nothing, and none of them is in the production bundle. Exploiting them needs attacker-controlled test configuration, mock registrations or worker options. CI runs only this repository's own tests in a throwaway container with no secrets. The risk is to developer machines and CI if a malicious dependency or test file reaches the test runner, so it is a supply-chain hygiene issue, not an exposure of the running system. Two of the advisories are rated critical, which is why the exception is time-limited.Approach
npm auditoffersvitest5.0.5 as the fix, which it marks as a breaking change. The packages are pinned exactly today (vitest3.2.7,@vitest/coverage-v83.2.7), and@vitest/coverage-v8must move withvitest.web/vitest.config.ts, the jsdom setup, coverage settings) and tests.vitestand@vitest/coverage-v8together, pinned exactly, plus any peer dependencies they now require. Check the supported Node range against.node-version(22.23.2) and the CI image before assuming it fits.web/audit-exceptions.txt(the gate reports an unused exception as a note, so stale entries are visible).Acceptance criteria
npm auditreports no advisories for production or development dependencies, or any that remain are listed inweb/audit-exceptions.txtwith a new reason and review date.web/audit-exceptions.txt, andnode scripts/audit-npm.mjspasses with no "unused exception" notes for them.npm run typecheck,npm test,npm run test:coverage(at least 80% line coverage) andnpm run buildpass inweb/on Node 22.23.2.mainafter merge.package.json,package-lock.jsonand the toolchain notes indocs/operations/ci.mdare updated together, as that guide requires for tool updates.Verification
Run the commands in the root README from
web/, thennode scripts/audit-npm.mjs,node --test scripts/audit-npm.test.mjs, andnpm audit(including dev dependencies). Record exact commands and results in the pull request. Check the Actions page for the completed Web and Security runs.Requirements and references
NFR-MAINT-007 (coverage gates), SRS supply-chain expectations in the decision register (
docs/decisions.md); tool-update rule and security workflow indocs/operations/ci.md. Findings were produced by the first run of.forgejo/workflows/security.ymland confirmed locally withnpm audit.Security impact: development tooling only; no change to the production bundle, authorization or data handling. Synthetic fixtures only.