{"id":"CVE-2026-52869","aliases":["CVE-2026-52869","GHSA-jpw9-pfvf-9f58","PYSEC-2026-3482"],"related":[],"kind":"vulnerability","state":"published","title":"MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal","summary":"The MCP Python SDK, called mcp on PyPI, is a Python implementation of the Model Context Protocol (MCP). Prior to 1.27.2, the SSE and stateful Streamable HTTP transports mcp.server.sse.SseServerTransport and mcp.server.streamable_http_manager.StreamableHTTPSessionManager route requests to existing sessions using only the session_id query parameter or Mcp-Session-Id header without verifying the authenticated principal that created the session, allowing a different bearer-token-authenticated client with a known session ID to inject JSON-RPC messages into that session. This issue is fixed in version 1.27.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The MCP Python SDK, called mcp on PyPI, is a Python implementation of the Model Context Protocol (MCP). Prior to 1.27.2, the SSE and stateful Streamable HTTP transports mcp.server.sse.SseServerTransport and mcp.server.streamable_http_manager.StreamableHTTPSessionManager route requests to existing sessions using only the session_id query parameter or Mcp-Session-Id header without verifying the authenticated principal that created the session, allowing a different bearer-token-authenticated client with a known session ID to inject JSON-RPC messages into that session. This issue is fixed in version 1.27.2.","source":"cvelist"},{"lang":"en","text":"### Summary\nIn affected versions, the SSE and Streamable HTTP server transports routed incoming requests to an existing session based only on the session identifier, without verifying that the request was authenticated as the same principal that created the session. Anyone who learned or guessed a session ID could send JSON-RPC messages on that session, regardless of which bearer token the request carried.\n\n### Am I affected?\nOnly if a developer's application server uses an HTTP transport (SSE, or Streamable HTTP in stateful mode) **and** authenticates requests. Servers on stdio, stateless Streamable HTTP, or with no authentication configured are not affected.\n\n### Details\nBoth transports look up the target session by its identifier alone — the `session_id` query parameter for SSE (`mcp.server.sse.SseServerTransport`) and the `Mcp-Session-Id` header for Streamable HTTP (`mcp.server.streamable_http_manager.StreamableHTTPSessionManager`). Once the lookup succeeded, the request was handled on that session without comparing its authentication context to the credentials presented when the session was created, so a request authenticated as a different OAuth client could inject messages into the session. On the SSE transport the response is delivered to the original client's event stream; on the Streamable HTTP transport it is returned on the injecting request, so the injecting client can also read the result. The SSE transport has been affected since the first release; the Streamable HTTP transport since version 1.8.0.\n\n### Impact\nServers using either HTTP transport together with the SDK's built-in bearer-token authentication are affected: the per-client isolation that authentication provides can be bypassed for any session whose ID is known. Session IDs are randomly generated UUIDs, so exploitation requires obtaining one out of band (logs, network observation). Servers that do not enable bearer-token authentication have no per-client isolation to bypass and are not addressed by this advisory, and stateless Streamable HTTP deployments do not maintain sessions and are unaffected.\n\n### Mitigation\nUpgrade to version 1.27.2 or later, which records the authenticated principal that created each session — the OAuth client ID together with the token's issuer and subject when the token verifier supplies them — and answers requests presenting a different principal with the same 404 response as for an unknown session.\n\nDeployments where many end users share a single OAuth client (hosted MCP clients, gateways) should ensure their token verifier populates `AccessToken.subject` (e.g. from the token's `sub` claim) so sessions are isolated per user rather than per client. Deployments using a custom authentication backend other than the built-in `BearerAuthBackend` should enforce an equivalent check themselves.","format":"markdown","source":"ghsa"},{"lang":"es","text":"El SDK de Python de MCP, llamado mcp en PyPI, es una implementación en Python del Protocolo de Contexto de Modelo (MCP). Antes de la versión 1.27.2, los transportes SSE y HTTP Streamable con estado mcp.server.sse.SseServerTransport y mcp.server.streamable_http_manager.StreamableHTTPSessionManager enrutaban las solicitudes a sesiones existentes utilizando únicamente el parámetro de consulta session_id o el encabezado Mcp-Session-Id sin verificar el principal autenticado que creó la sesión, permitiendo que un cliente diferente autenticado con token de portador con un ID de sesión conocido inyectara mensajes JSON-RPC en esa sesión. Este problema está solucionado en la versión 1.27.2.","source":"nvd"}],"published":"2026-07-15T20:06:23.604Z","modified":"2026-10-24T21:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"}],"cwes":["CWE-639"],"affected":[{"ranges":[{"version":"< 1.27.2","status":"affected"}],"vendor":"modelcontextprotocol","product":"python-sdk","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.27.2"}],"ecosystem":"PyPI","package":"mcp","purl":"pkg:pypi/mcp","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.27.2"}],"vendor":"lfprojects","product":"mcp_python_sdk","cpe":"cpe:2.3:a:lfprojects:mcp_python_sdk:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.27.2"}],"ecosystem":"PyPI","package":"mcp","purl":"pkg:pypi/mcp","source":"pysec"}],"references":[{"url":"https://github.com/modelcontextprotocol/python-sdk/security/advisories/GHSA-jpw9-pfvf-9f58","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modelcontextprotocol/python-sdk/pull/2690","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modelcontextprotocol/python-sdk/pull/2719","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modelcontextprotocol/python-sdk/commit/1abcca2408a6b50e10ec601181f63f9978705c00","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modelcontextprotocol/python-sdk/commit/ce267b6fc515dc4efc1dc70b6975b16ff0feef0a","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modelcontextprotocol/python-sdk/releases/tag/v1.27.2","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-52869","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/modelcontextprotocol/python-sdk","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/mcp","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-jpw9-pfvf-9f58","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-07-16T13:00:22.816Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-52869","url":"https://www.cve.org/CVERecord?id=CVE-2026-52869","licence":"CVE Terms of Use","modified":"2026-07-16T13:00:37.854Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jpw9-pfvf-9f58","url":"https://github.com/advisories/GHSA-jpw9-pfvf-9f58","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:52.526Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-52869","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-52869","licence":"Public domain","modified":"2026-10-24T21:10:00.130Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3482","url":"https://osv.dev/vulnerability/PYSEC-2026-3482","licence":"CC-BY-4.0","modified":"2026-07-23T15:00:13.853Z"}],"updatedAt":"2026-11-25T22:59:28.340Z","epss":{"score":0.00319,"percentile":0.26898,"date":"2026-12-01T12:00:22.000Z"}}