fix: stop leaking exception messages to clients via JSON-RPC error data
Tool handler exceptions and anything reaching JsonRpcHandler's blind rescue had their #message echoed into the error data member, exposing internals to untrusted clients (CWE-209). Capability errors keep their client-facing message by re-raising through RequestHandlerError, the one channel whose message is deliberately surfaced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
d51d4a0f91
commit
f379e13b47
1 changed files with 23 additions and 14 deletions
|
|
@ -310,7 +310,6 @@ describe JsonRpcHandler do
|
|||
assert_rpc_error expected_error: {
|
||||
code: -32603,
|
||||
message: "Internal error",
|
||||
data: "Something bad happened",
|
||||
}
|
||||
assert_equal 1, @response[:id]
|
||||
assert_nil @response[:result]
|
||||
|
|
@ -452,7 +451,6 @@ describe JsonRpcHandler do
|
|||
assert_rpc_error expected_error: {
|
||||
code: -32603,
|
||||
message: "Internal error",
|
||||
data: "Something bad happened",
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue