The vulnerability, as described in the advisory, is a cross-client data leak in @modelcontextprotocol/sdk. It occurs when a single McpServer or StreamableHTTPServerTransport instance is reused across multiple client connections, a common pattern in stateless server deployments. This reuse leads to JSON-RPC message ID collisions, causing the server to route responses to the wrong client.
To identify the vulnerable functions, I first determined the patched version (1.26.0) and the last vulnerable version (1.25.3). By comparing the git tags for these versions, I identified the commits included in the patch. The key commit, a05be176cabeae1f933b676e3ce024bf02e2314d, has a very descriptive message: "fix: add transport isolation guards to prevent cross-client data leaks".
This commit message explicitly states the two main changes made to fix the vulnerability:
Protocol.connect() was modified to throw an error if it's called on an already connected protocol.
StreamableHTTPServerTransport.handleRequest() was modified to throw an error if called more than once on the same instance in stateless mode.
These changes directly address the root cause of the vulnerability, which is the improper reuse of objects. The functions Protocol.connect and StreamableHTTPServerTransport.handleRequest are the points where this reuse manifests and causes the data leak. Therefore, these are the key functions that would appear in a runtime profile during the exploitation of this vulnerability. The exploit scenario involves concurrent calls to these functions on shared objects, leading to the misrouting of data.