fix(keeper): override ws to 8.21.0, closing two reachable memory-exhaustion CVEs - #371
fix(keeper): override ws to 8.21.0, closing two reachable memory-exhaustion CVEs#371Morenikeoa wants to merge 1 commit into
Conversation
…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.
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Problem
pnpm auditflags two distinctwsadvisories — 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.jsfor 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.overridesentry inpnpm-workspace.yamlforcingwsto^8.21.0across the whole resolved tree:overrides: vite: 8.0.8 + ws: ^8.21.0pnpm why wsconfirms a single deduplicated8.21.0(patched for both advisories) now replaces the previously-resolved7.5.10and8.20.0.Proof of Fix
pnpm install— clean;pnpm auditno longer lists eitherwsadvisory.pnpm why ws— "Found 1 version of ws" (8.21.0), used by both therpc-websocketsandjayson/isomorphic-wspaths.pnpm build— clean, zero errors.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