The vulnerability, identified as GHSA-cr22-wjx7-2w6m, was an access control bypass in mcp-server-kubernetes. The server's configuration allows restricting available tools through environment variables, but this restriction was only enforced at the presentation layer (tools/list) and not at the execution layer (tools/call).
My analysis of the security patch confirms this. The fixing commit, 461b50c5beff2fbcba79e07f3ecb95746b82a093, modifies src/index.ts. The core of the vulnerability was within the anonymous handler function for CallToolRequestSchema, which is registered using server.setRequestHandler. This handler processed tools/call requests without any authorization checks.
The patch remediates this by introducing a new function, isToolAllowed, which encapsulates the access control logic. This function is then called at the beginning of the tools/call handler. If a tool is not allowed, the request is rejected with an error.
Therefore, the primary vulnerable function is the server.setRequestHandler for CallToolRequestSchema, which contained the flawed logic. An attacker would exploit this by sending a direct tools/call request for a restricted tool, which the server would have executed prior to the fix.