π‘οΈ Sentinel: [CRITICAL] Fix internal error leakage via JSON-RPC responses#243
π‘οΈ Sentinel: [CRITICAL] Fix internal error leakage via JSON-RPC responses#243davidruzicka wants to merge 1 commit into
Conversation
β¦nses π¨ Severity: CRITICAL π‘ Vulnerability: The HTTP transport layer in `handleOtherRequest` was catching exceptions and returning the raw error message to the client in the JSON-RPC response body for `prompts/get`, `resources/read`, and `completion/complete` methods, as well as `ListToolsRequestSchema`, `ListPromptsRequestSchema`, and `GetPromptRequestSchema` handlers. π― Impact: Internal error details, such as file paths, database connection strings, or stack traces masquerading as messages, could be exposed to end users via API responses. π§ Fix: Updated error handling to use `formatErrorForClient(error, correlationId)` which categorizes errors as "safe" (client errors) vs "unsafe" (server errors) and provides a generic message with a correlation ID for unsafe errors. β Verification: Ran `npm run test:unit` and verified `mcp-server-apps.test.ts` and `mcp-server.test.ts` pass. Co-authored-by: davidruzicka <14172985+davidruzicka@users.noreply.github.com>
|
π 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Reportβ
All modified and coverable lines are covered by tests. π’ Thoughts on this report? Let us know! |
π‘οΈ Sentinel: [CRITICAL] Fix internal error leakage via JSON-RPC responses
π¨ Severity: CRITICAL
π‘ Vulnerability: The HTTP transport layer in
handleOtherRequestwas catching exceptions and returning the raw error message to the client in the JSON-RPC response body forprompts/get,resources/read, andcompletion/completemethods, as well asListToolsRequestSchema,ListPromptsRequestSchema, andGetPromptRequestSchemahandlers.π― Impact: Internal error details, such as file paths, database connection strings, or stack traces masquerading as messages, could be exposed to end users via API responses.
π§ Fix: Updated error handling to use
formatErrorForClient(error, correlationId)which categorizes errors as "safe" (client errors) vs "unsafe" (server errors) and provides a generic message with a correlation ID for unsafe errors.β Verification: Ran
npm run test:unitand verifiedmcp-server-apps.test.tsandmcp-server.test.tspass.PR created automatically by Jules for task 15701848798307156278 started by @davidruzicka