fix(deps): resolve open critical/high Dependabot alerts#5
fix(deps): resolve open critical/high Dependabot alerts#5rutvikchandla3 wants to merge 1 commit into
Conversation
Bumps the only direct dev dependency flagged (vitest) to its patched release and refreshes transitive dev dependencies in the lockfile to clear all open critical and high severity Dependabot alerts. Critical: - vitest 3.0.8 -> 3.2.6 (GHSA-5xrq-8626-4rwp: arbitrary file read/exec via Vitest UI server). @vitest/browser bumped to match. High (transitive, resolved via lockfile refresh): - vite -> 7.3.5 (GHSA-p9ff-h696-f583) - rollup -> 4.61.1 (GHSA-mw96-cpmx-2vgc) - lodash -> 4.18.1 (GHSA-r5fr-rjxr-66jc) - minimatch -> 3.1.5 / 5.1.9 / 9.0.9 (GHSA-7r86-cg39-jmmj) - glob -> 10.5.0 (GHSA-5j98-mcp5-4vw2) serialize-javascript is pinned to a vulnerable range by mocha (GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v), so it is forced to 7.0.5 via an npm "overrides" entry. All changes are dev-scope only; the shipped extension dependencies are unchanged. `npm run compile` passes; remaining 3 low-severity advisories (jsdom@16 chain) require a breaking jsdom@29 bump and are out of scope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| "dayjs": "1.11.13" | ||
| }, | ||
| "overrides": { | ||
| "serialize-javascript": "7.0.5" |
There was a problem hiding this comment.
Why an overrides pin instead of just bumping mocha?
serialize-javascript is a transitive dep, reached only through mocha:
@vscode/test-cli@0.0.10 → mocha@10.8.2 → serialize-javascript
mocha@11.0.1 → serialize-javascript
Upgrading mocha does not fix it — every mocha release, including the latest (11.7.6), pins serialize-javascript@^6.0.2:
mocha@10.8.2 -> ^6.0.2
mocha@11.0.1 -> ^6.0.2
mocha@11.7.6 -> ^6.0.2 (latest)
But the advisories (GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v) are patched only in 7.x (7.0.3 / 7.0.5) — there is no fixed 6.x. mocha's ^6.0.2 range excludes that major, so normal semver resolution has nothing safe to pick. That's exactly why npm audit fix reports "No fix available" and Dependabot can't auto-resolve it.
overrides is npm's escape hatch for this case: it force-pins serialize-javascript to 7.0.5 everywhere in the tree, overriding mocha's ^6.
Trade-off / risk: this is a forced cross-major (6→7) bump on a dep mocha declared as ^6. It's acceptable here because (a) it's dev/test-scope only, (b) the serialize(obj, options) API is unchanged between 6 and 7 (the major was mostly dropping old Node support), and mocha only uses it to serialize data for parallel test workers. Caveat: the pin is sticky — if mocha later moves its range to ^7 natively, remove this entry so it doesn't silently mask a future advisory.
Summary
Resolves all open critical and high severity Dependabot alerts on this repo — 2 critical + 8 high as Dependabot counts them (one alert record per manifest / per vulnerable version range). All affected packages are dev-scope only; the dependencies shipped with the published extension are unchanged.
The only directly-declared dependency flagged was
vitest; everything else is transitive and was cleared by refreshing the lockfile (npm audit fix, non-breaking) plus oneoverridespin.Changes
package.jsonvitest3.0.8→3.2.6and@vitest/browser3.0.8→3.2.6(stays within the 3.x major — no breaking jump)overrides: { "serialize-javascript": "7.0.5" }—mocha/@vscode/test-clipin it to a vulnerable range, sonpm auditreports "no fix available" without forcing itpackage-lock.json— transitive dev deps refreshed to patched versions.Alerts addressed (all 10 records: 2 critical + 8 high)
Every copy of each package in the tree was checked (e.g.
minimatchresolves to 3.1.5 / 5.1.9 / 9.0.9 across three majors — all above their respective patch lines; the remainingglob@7.1.6/glob@8.1.0are outside the vulnerable 10.x range).Verification
npm run compile(TypeScript build) passes.npm auditafterwards: 0 critical, 0 high — only 3 low-severity advisories remain (thejsdom@16→http-proxy-agent→@tootallnate/oncechain), which require a breakingjsdom@29bump and are out of scope for this critical/high fix.npm run testFecould not be exercised in this environment due to a pre-existing esbuild sandbox issue (fails identically on the unmodified base branch), so it is not a regression from this change.🤖 Generated with Claude Code