Skip to content

chore(security): resolve pnpm audit vulnerabilities (1 critical, 3 moderate)#387

Merged
tkislan merged 1 commit into
mainfrom
tk/resolve-vulnerabilities-2026-06-03
Jun 3, 2026
Merged

chore(security): resolve pnpm audit vulnerabilities (1 critical, 3 moderate)#387
tkislan merged 1 commit into
mainfrom
tk/resolve-vulnerabilities-2026-06-03

Conversation

@tkislan

@tkislan tkislan commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves all 4 vulnerabilities reported by pnpm audit (1 critical, 3 moderate). Each finding was researched independently to confirm the dependency could be updated, verify the patched version exists, and check for breaking changes. Following the convention established in #376, transitive deps are pinned via pnpm.overrides; directly-declared deps are bumped in place.

After these changes:

  • pnpm auditNo known vulnerabilities found
  • pnpm typecheck → passes
  • pnpm test2200 tests / 127 files pass
  • pnpm build → all packages build

Findings

Package Severity Advisory Installed → Patched Fix
vitest 🔴 Critical GHSA-5xrq-8626-4rwp 4.0.5 → 4.1.8 direct devDep bump
ws 🟡 Moderate GHSA-58qx-3vcg-4xpx 8.19.0 → 8.21.0 range bump + override
qs 🟡 Moderate GHSA-q8mj-m7cp-5q26 6.14.2 → 6.15.2 new override
brace-expansion 🟡 Moderate GHSA-jxxr-4gwj-5jf2 5.0.5 → 5.0.6 override bump

vitest 4.0.5 → 4.1.8 (critical)

Vitest UI server could read/execute arbitrary files when listening; fixed in >=4.1.0. vitest and @vitest/coverage-v8 are directly-declared, pinned devDependencies, so they are bumped in place (not via an override) and move in lockstep (coverage peer-requires the exact vitest version). 4.0 → 4.1 is an additive minor — the breaking restoreAllMocks/poolOptions changes landed in the 4.0.0 major, which the repo already runs. The bump also resolves a latent vite 8 peer mismatch (4.1.x widens the vite peer range to include ^8). This repo runs vitest run without --ui/--api, so real-world exposure was low, but the bump cleanly eliminates the advisory.

ws 8.19.0 → 8.21.0 (moderate)

Uninitialized memory disclosure in websocket.close() when passing a TypedArray reason; fixed in >=8.20.1. ws appears at two edges — runtime-core's direct dep and a transitive @jupyterlab/services > ws. The runtime-core declared range is bumped ^8.18.0 → ^8.20.1 (it's a published package, so this makes the security floor explicit downstream) and a ws: ">=8.20.1" override is added to unconditionally cover the transitive edge. No ws API is imported directly in source — it's the WebSocket impl consumed by @jupyterlab/services — so no behavior change.

qs 6.14.2 → 6.15.2 (moderate)

Remotely-triggerable DoS: qs.stringify crashes on null/undefined entries in comma-format arrays with encodeValuesOnly; fixed in >=6.15.2. Transitive via packages/mcp > @modelcontextprotocol/sdk > express > qs. express@5.2.1 is already the latest express and declares qs: ^6.14.0 (which 6.15.2 satisfies), so an override is the correct fix. 6.14 → 6.15 is a non-breaking minor (one opt-in strictMerge option + fixes).

brace-expansion 5.0.5 → 5.0.6 (moderate)

A large numeric range defeats the documented max DoS protection; fixed in >=5.0.6. Transitive via license-checker-rseidelsohn > … > minimatch. The existing override is bumped >=5.0.5 → >=5.0.6; the fix is an internal loop guard with no API change. The separate @isaacs/brace-expansion override is left unchanged — it's a different fork covered by a different, already-patched advisory (<=5.0.0, patched 5.0.1) and is not actually installed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated testing framework and code coverage analysis tooling to the latest stable versions to improve development workflow efficiency
    • Updated WebSocket runtime library dependency to the latest compatible version for enhanced reliability
    • Refined build infrastructure dependency constraints for better cross-environment compatibility

Review Change Stack

…derate)

Resolve all 4 vulnerabilities reported by `pnpm audit`. After these
changes `pnpm audit` reports no known vulnerabilities, and typecheck,
the full test suite (2200 tests), and the package builds all pass.

- vitest (CRITICAL, GHSA-5xrq-8626-4rwp): bump root devDependency
  vitest and @vitest/coverage-v8 4.0.5 -> 4.1.8. Vitest UI server could
  read/execute arbitrary files; fixed in >=4.1.0. These are directly
  declared (not transitive) so they are bumped in place rather than via
  an override, and must move in lockstep. 4.0->4.1 is an additive minor
  (the breaking restoreAllMocks/poolOptions changes landed in 4.0.0,
  already in use); the bump also resolves a latent vite 8 peer mismatch.

- ws (MODERATE, GHSA-58qx-3vcg-4xpx): uninitialized memory disclosure in
  websocket.close(), fixed in >=8.20.1. Bump the runtime-core declared
  range ^8.18.0 -> ^8.20.1 (published package, makes the floor explicit)
  and add a `ws: ">=8.20.1"` override to also cover the transitive
  @jupyterlab/services > ws edge. Resolves to 8.21.0.

- qs (MODERATE, GHSA-q8mj-m7cp-5q26): remotely triggerable DoS in
  qs.stringify, fixed in >=6.15.2. Add override `qs: ">=6.15.2"`
  (transitive via packages/mcp > @modelcontextprotocol/sdk > express).
  express@5.2.1 declares qs ^6.14.0, which 6.15.2 satisfies. Resolves
  to 6.15.2.

- brace-expansion (MODERATE, GHSA-jxxr-4gwj-5jf2): large numeric range
  defeats the documented `max` DoS protection, fixed in >=5.0.6. Bump
  the existing override >=5.0.5 -> >=5.0.6 (transitive via
  license-checker-rseidelsohn). The separate @isaacs/brace-expansion
  override is left unchanged: it is a different fork covered by a
  different, already-patched advisory and is not installed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cfbf5876-4992-4109-bec3-26b15907d1d0

📥 Commits

Reviewing files that changed from the base of the PR and between d6d6944 and f1529e9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • packages/runtime-core/package.json

📝 Walkthrough

Walkthrough

Root package.json updates Vitest coverage tooling and related test infrastructure from 4.0.5 to 4.1.8, adjusts the pnpm override constraint for @isaacs/brace-expansion from >=5.0.5 to >=5.0.6, and maintains ws override alignment. Simultaneously, packages/runtime-core/package.json bumps the ws dependency from ^8.18.0 to ^8.20.1.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • saltenasl
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Updates Docs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: resolving pnpm audit vulnerabilities with specific counts (1 critical, 3 moderate) that align with the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@tkislan tkislan marked this pull request as ready for review June 3, 2026 11:15
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.35%. Comparing base (d6d6944) to head (f1529e9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #387      +/-   ##
==========================================
+ Coverage   82.24%   83.35%   +1.10%     
==========================================
  Files         144      145       +1     
  Lines        5868     7988    +2120     
  Branches     1096     2158    +1062     
==========================================
+ Hits         4826     6658    +1832     
- Misses       1042     1329     +287     
- Partials        0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tkislan tkislan requested a review from a team as a code owner June 3, 2026 11:15
@tkislan tkislan merged commit ed2e587 into main Jun 3, 2026
21 checks passed
@tkislan tkislan deleted the tk/resolve-vulnerabilities-2026-06-03 branch June 3, 2026 13:52
tkislan added a commit that referenced this pull request Jun 8, 2026
Resolve 4 moderate pnpm audit vulnerabilities in hono (transitive via
packages/mcp > @modelcontextprotocol/sdk > hono), all fixed in 4.12.21:

- GHSA-xrhx-7g5j-rcj5 (CVE-2026-47674, CVSS 5.3): ip-restriction middleware
  bypasses static deny rules for non-canonical IPv6.
- GHSA-3hrh-pfw6-9m5x (CVE-2026-47675, CVSS 4.3): cookie helper does not
  sanitize sameSite and priority, allowing Set-Cookie injection.
- GHSA-f577-qrjj-4474 (CVE-2026-47673, CVSS 4.8): jwt/jwk middleware
  accepts any Authorization scheme, not only Bearer.
- GHSA-2gcr-mfcq-wcc3 (CVE-2026-47676, CVSS 5.3): app.mount() strips
  mount prefix using undecoded path, causing incorrect routing for
  percent-encoded paths.

Bump the existing pnpm.overrides floor for hono >=4.12.18 -> >=4.12.21
following the established convention in this repo (see #387, #368, #307,
#295, #292). pnpm install resolves hono to 4.12.23. After this change
`pnpm audit` reports no known vulnerabilities. `pnpm typecheck`,
`pnpm test` (2242 tests), and `pnpm prettier:check` all pass.
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.

2 participants