Repository navigation
Conversation
β¦et Server Added a 10MB maximum buffer size limit in `skills/brainstorming/scripts/server.js` to protect against unbounded buffer memory exhaustion caused by infinite unclosed frame chunks. Also recorded learning in `.jules/sentinel.md`. Co-authored-by: pakorn269 <[email protected]>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Closing β conflicts due to |
Understood. Acknowledging that this PR is being closed due to conflicts from the rename, and the fix is being applied directly to |
Security: add 10MB MAX_BUFFER_SIZE cap on WebSocket buffer to prevent memory exhaustion DoS (closes duplicate PRs #24 #28 #32 #33 #37 #41 #44). Performance: replace String.prototype.replace() with lastIndexOf+slice in both wrapInFrame and handleRequest for multi-megabyte HTML payloads (closes duplicate PRs #19 #22 #26 #29 #30 #35 #38 #39 #42). Update .jules/sentinel.md and .jules/bolt.md with learnings. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
π¨ Severity: CRITICAL
π‘ Vulnerability: The zero-dependency WebSocket server in
skills/brainstorming/scripts/server.jswas accumulating incoming data chunks (buffer = Buffer.concat([buffer, chunk])) without enforcing any maximum size.π― Impact: A malicious or misconfigured client could send a continuous stream of incomplete data frames to the server. Because the data would never form a valid frame to be extracted and removed from the buffer, the Node.js server would eventually run out of memory and crash (Denial of Service).
π§ Fix: Introduced a
MAX_BUFFER_SIZEof 10MB (10 * 1024 * 1024). After extracting any valid frames in the inner loop, the parser checks the remaining buffer length. If it exceeds 10MB, the server logs an error, instantly destroys the socket connection, and removes the client from its list to reclaim memory. This explicitly follows the codebase security patterns (evaluating limits after pulling out valid frames so we don't accidentally punish a large batch of legitimate valid frames).β Verification: Ran
tests/brainstorm-server/server.test.jsandws-protocol.test.jsusingpnpm test. All 59 tests continue to pass correctly. Evaluated by code review successfully (mostly correct, fixed thepnpm-lock.yamlfile nitpick).PR created automatically by Jules for task 17099074923313103525 started by @pakorn269