fix(deps): resolve npm audit vulnerabilities (1 critical + 5 moderate)

Merged
LU
5mo ago
+107-124

Summary

npm audit on main reports 1 critical + 11 moderate + 1 low vulnerability in package-lock.json (the lockfile CI actually installs from via npm ci). This PR gets that to 0 vulnerabilities:

  • npm audit fix (non-breaking) resolves the critical (@xhmikosr/decompress, part of the yt-dlp/discord-player decompression chain) plus @babel/core, js-yaml, tar, and the @discordjs/opus/node-pre-gyp chain — no manual intervention needed for these.
  • Adds two targeted overrides: qs (>=6.15.2, DoS fix) and @opentelemetry/core (>=2.8.0, unbounded memory allocation fix) — the two stragglers npm audit fix alone can't reach because they're nested under multiple consumers.

Reverted: an earlier incorrect attempt in this branch's history

A prior commit here bumped undici 7.28.0 → 8.x, based on Dependabot alerts that turned out to reference only the unused, uninstalled pnpm-lock.yaml manifest (a vestigial lockfile — this repo's CI installs via npm ci against package-lock.json only; pnpm-lock.yaml isn't read anywhere in CI except as a runner-shim for a third-party GitHub Action). undici@7.28.0 was already the patched version for every advisory in the 7.x line in the lockfile that matters. The 8.x bump was both unnecessary and broke jsdom at runtime (jsdom reaches into undici/lib/handler/wrap-handler.js, an internal file undici 8.x removed), crashing all 84 frontend vitest suites. This PR reverts that bump entirely.

Test plan

  • npm audit → 0 vulnerabilities
  • npm run type:check clean across all 4 packages
  • packages/shared: 70/70 suites, 1370/1370 tests
  • packages/bot: 209/210 suites, 2852/2853 tests (1 pre-existing skip)
  • packages/backend: 1347/1347 tests (2 files flaked once under full-parallel load, both pass 100% in isolation — tracked separately in #1704, not a regression from this change)
  • packages/frontend: 84/84 suites, 1002/1002 tests

Summary by cubic

Brings npm audit to 0 vulnerabilities by updating patched dependencies and adding targeted overrides. Also restores undici 7.x to fix a jsdom runtime crash.

  • Dependencies

    • Ran npm audit fix to patch @xhmikosr/decompress (+ unzip), @babel/core, js-yaml, tar, and the @discordjs/opus/node-pre-gyp chain.
    • Added overrides: qs >=6.15.2 and @opentelemetry/core >=2.8.0 (lockfile resolves to qs@6.15.3 and @opentelemetry/core@2.9.0).
    • CI installs from package-lock.json (not pnpm-lock.yaml).
  • Bug Fixes

    • Reverted undici 8.x bump; kept undici@7.28.0 (already patched) to prevent jsdom module resolution errors.
    • Verified: npm audit shows 0; typecheck clean; all package tests pass.

Summary by CodeRabbit

  • Chores
    • Updated dependency version constraints to keep key libraries on known compatible versions.
    • This should help improve build reliability and reduce the risk of runtime issues from incompatible transitive packages.