Skip to content

batch_query slot exceptions leak raw ex.Message #2849

Description

@Widthdom

Found during cdidx code-search audit. Evidence: standalone MCP tool failures intentionally sanitize ex.Message before returning JSON-RPC results, but src/CodeIndex/Mcp/McpToolHandlers.cs appends ex.Message directly for batch_query slot exceptions. Impact: a tool that throws inside a batch can expose bound values, local paths, SQL fragments, or content snippets that the standalone tools/call path was designed to suppress. Suggested fix: reuse the sanitized tool error message for batch slot errors while keeping structured category, suggestion, and retry metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions