Skip to content

fix(keeper): override ws to 8.21.0, closing two reachable memory-exhaustion CVEs - #371

Open
Morenikeoa wants to merge 1 commit into
dcccrypto:mainfrom
Morenikeoa:fix/ws-dependency-cve
Open

fix(keeper): override ws to 8.21.0, closing two reachable memory-exhaustion CVEs#371
Morenikeoa wants to merge 1 commit into
dcccrypto:mainfrom
Morenikeoa:fix/ws-dependency-cve

Conversation

@Morenikeoa

Copy link
Copy Markdown
Contributor

Problem

pnpm audit flags two distinct ws advisories — both titled "Memory exhaustion DoS from tiny fragments and data chunks" (GHSA-96hv-2xvq-fx4p) — reachable via two separate transitive paths in the resolved dependency tree:

  • rpc-websockets>ws, pulled in via @solana/web3.js for account-subscription websockets (vulnerable >=8.0.0 <8.21.0)
  • jayson>isomorphic-ws>ws, pulled in via @solana/web3.js's JSON-RPC client (vulnerable >=7.0.0 <7.5.11)

Both are on the keeper's live account-watching/RPC hot path, not a dev-only dependency.

Production Impact

A malicious or compromised RPC websocket endpoint could send tiny fragmented frames to exhaust the keeper process's memory, crashing the liquidation/crank loop — availability risk on a 24/7 liquidation bot.

Fix

Added a pnpm.overrides entry in pnpm-workspace.yaml forcing ws to ^8.21.0 across the whole resolved tree:

 overrides:
   vite: 8.0.8
+  ws: ^8.21.0

pnpm why ws confirms a single deduplicated 8.21.0 (patched for both advisories) now replaces the previously-resolved 7.5.10 and 8.20.0.

Proof of Fix

  • pnpm install — clean; pnpm audit no longer lists either ws advisory.
  • pnpm why ws — "Found 1 version of ws" (8.21.0), used by both the rpc-websockets and jayson/isomorphic-ws paths.
  • pnpm build — clean, zero errors.
  • Full test suite: 974 passed, 33 skipped, 1 pre-existing unrelated failure (tests/v17-risk-params.poc.test.ts — stale assertion from fix(keeper): accept maintenanceMarginBps==10000 (valid fast-path) — found in live devnet test #345, out of scope here). No regressions from the version bump across either consuming path.

Test Output

 Test Files  1 failed | 93 passed | 2 skipped (96)
      Tests  1 failed | 974 passed | 33 skipped (1008)

…ustion CVEs

pnpm audit flags two distinct ws advisories (both GHSA-96hv-2xvq-fx4p, memory
exhaustion DoS from tiny WebSocket fragments), reachable via two separate
transitive paths in the resolved dependency tree:
  - rpc-websockets>ws, pulled in via @solana/web3.js for account-subscription
    websockets (vulnerable >=8.0.0 <8.21.0)
  - jayson>isomorphic-ws>ws, pulled in via @solana/web3.js's JSON-RPC client
    (vulnerable >=7.0.0 <7.5.11)

Both are on the keeper's live account-watching/RPC hot path, not a dev-only
dependency. A malicious or compromised RPC websocket endpoint could send
tiny fragmented frames to exhaust the keeper process's memory, crashing the
liquidation/crank loop.

Added a pnpm.overrides entry forcing ws to ^8.21.0 across the whole tree.
`pnpm why ws` confirms a single deduplicated 8.21.0 (patched for both
advisories) replaces the previously-resolved 7.5.10 and 8.20.0. Verified via
`pnpm install` + `pnpm build` (clean) + full test suite: 974 passed, 33
skipped, 1 pre-existing unrelated failure (out of scope here) -- no
regressions from the version bump across either consuming path.

BUG-113 from a clean-room Phase 4 audit pass.
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Morenikeoa, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 32 minutes and 33 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72367318-a82c-473e-8e2a-d3c88c22b878

📥 Commits

Reviewing files that changed from the base of the PR and between 8ee810d and 8fea82b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • pnpm-workspace.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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