Repository navigation
chore(deps): update dependency mcp to v1.30.0 [security] - #2759
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
2 times, most recently
from
July 30, 2026 16:59
c7d59a0 to
71c5083
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
August 12, 2026 03:43
71c5083 to
db60d1c
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
August 26, 2026 16:20
db60d1c to
cf987e3
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
September 4, 2026 01:49
fa2b525 to
cf987e3
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
2 times, most recently
from
September 7, 2026 22:14
fa2b525 to
1005763
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
September 15, 2026 20:43
1005763 to
b173c0a
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
September 25, 2026 03:45
b173c0a to
f77be20
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
October 13, 2026 14:06
f77be20 to
1440e53
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
October 20, 2026 15:52
1440e53 to
2ad1f65
Compare
renovate
Bot
force-pushed
the
renovate/pypi-mcp-vulnerability
branch
from
October 26, 2026 20:10
2ad1f65 to
44de75d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
1.26.0→1.30.0MCP Python SDK: Experimental task handlers allow any client to access and cancel other clients' tasks
CVE-2026-52870 / GHSA-hvrp-rf83-w775 / PYSEC-2026-3481
More information
Details
Summary
In affected versions, the default request handlers installed by the experimental tasks feature (
server.experimental.enable_tasks()) did not check which session created a task before acting on it. On a server with more than one connected client, any client could observe, read results from, and cancel tasks belonging to other clients.Am I affected?
Only if the developer's application server calls
server.experimental.enable_tasks(). Ifgrep -r enable_tasksover their codebase finds nothing, the application is not affected.Details
When tasks support is enabled on the low-level server, default handlers are registered for
tasks/list,tasks/get,tasks/result, andtasks/cancel. These handlers operated on the task identifier alone and kept no record of the session that created each task. Becausetasks/listreturned every task in the store, a connected client did not need to know any identifiers in advance: it could enumerate all tasks, read any task's status and result viatasks/getandtasks/result, retrieve queued task messages — such as elicitation requests intended for the task's creator, which are removed from the queue on delivery, so the intended recipient never receives them — and cancel any task viatasks/cancel.Impact
Servers that call
server.experimental.enable_tasks()and serve multiple clients are affected: one client can read other clients' task results and elicitation payloads, consume messages meant for them, and cancel their tasks. The feature is experimental and opt-in, so servers that never enable it are unaffected. Servers that registered their own task handlers instead of the defaults are affected only if those handlers have the same omission.Mitigation
Upgrade to version 1.27.2 or later, in which task IDs generated by
run_task()embed an opaque per-session marker and the default handlers restrict each session to its own tasks: requests for another session's task receive "task not found", andtasks/listreturns only the requesting session's tasks. Tasks created with explicitly chosen IDs or written directly through aTaskStoreremain reachable by ID but are not listed. Alternatively, leave the experimental tasks feature disabled, or register task handlers that validate session ownership.Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:LReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal
CVE-2026-52869 / GHSA-jpw9-pfvf-9f58 / PYSEC-2026-3482
More information
Details
Summary
In 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.
Am I affected?
Only 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.
Details
Both transports look up the target session by its identifier alone — the
session_idquery parameter for SSE (mcp.server.sse.SseServerTransport) and theMcp-Session-Idheader 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.Impact
Servers 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.
Mitigation
Upgrade 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.
Deployments 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'ssubclaim) so sessions are isolated per user rather than per client. Deployments using a custom authentication backend other than the built-inBearerAuthBackendshould enforce an equivalent check themselves.Severity
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:LReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
MCP Python SDK: Experimental task handlers allow any client to access and cancel other clients' tasks
CVE-2026-52870 / GHSA-hvrp-rf83-w775 / PYSEC-2026-3481
More information
Details
Summary
In affected versions, the default request handlers installed by the experimental tasks feature (
server.experimental.enable_tasks()) did not check which session created a task before acting on it. On a server with more than one connected client, any client could observe, read results from, and cancel tasks belonging to other clients.Am I affected?
Only if the developer's application server calls
server.experimental.enable_tasks(). Ifgrep -r enable_tasksover their codebase finds nothing, the application is not affected.Details
When tasks support is enabled on the low-level server, default handlers are registered for
tasks/list,tasks/get,tasks/result, andtasks/cancel. These handlers operated on the task identifier alone and kept no record of the session that created each task. Becausetasks/listreturned every task in the store, a connected client did not need to know any identifiers in advance: it could enumerate all tasks, read any task's status and result viatasks/getandtasks/result, retrieve queued task messages — such as elicitation requests intended for the task's creator, which are removed from the queue on delivery, so the intended recipient never receives them — and cancel any task viatasks/cancel.Impact
Servers that call
server.experimental.enable_tasks()and serve multiple clients are affected: one client can read other clients' task results and elicitation payloads, consume messages meant for them, and cancel their tasks. The feature is experimental and opt-in, so servers that never enable it are unaffected. Servers that registered their own task handlers instead of the defaults are affected only if those handlers have the same omission.Mitigation
Upgrade to version 1.27.2 or later, in which task IDs generated by
run_task()embed an opaque per-session marker and the default handlers restrict each session to its own tasks: requests for another session's task receive "task not found", andtasks/listreturns only the requesting session's tasks. Tasks created with explicitly chosen IDs or written directly through aTaskStoreremain reachable by ID but are not listed. Alternatively, leave the experimental tasks feature disabled, or register task handlers that validate session ownership.Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:LReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal
CVE-2026-52869 / GHSA-jpw9-pfvf-9f58 / PYSEC-2026-3482
More information
Details
Summary
In 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.
Am I affected?
Only 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.
Details
Both transports look up the target session by its identifier alone — the
session_idquery parameter for SSE (mcp.server.sse.SseServerTransport) and theMcp-Session-Idheader 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.Impact
Servers 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.
Mitigation
Upgrade 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.
Deployments 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'ssubclaim) so sessions are isolated per user rather than per client. Deployments using a custom authentication backend other than the built-inBearerAuthBackendshould enforce an equivalent check themselves.Severity
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:LReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
MCP Python SDK: WebSocket server transport does not support Host/Origin validation
CVE-2026-59950 / GHSA-vj7q-gjh5-988w / PYSEC-2026-3483
More information
Details
Summary
In affected versions, the deprecated WebSocket server transport (
mcp.server.websocket.websocket_server) accepted the WebSocket handshake without applying anyHostorOriginheader validation. TheTransportSecuritySettingsmechanism that the SSE and Streamable HTTP transports use for this purpose was not wired into the WebSocket transport, so there was no SDK-level way to restrict which origins could connect.Am I affected?
Only if a developer's application server exposes
mcp.server.websocket.websocket_server. This transport has never been part of the MCP specification, is marked deprecated, and is not reachable throughFastMCP— a developer must have wired it into an ASGI application themselves. Servers using stdio, SSE, or Streamable HTTP are not affected by this advisory.Details
websocket_server()constructed a StarletteWebSocketand calledaccept(subprotocol="mcp")immediately, with no inspection of the connection's headers. By contrast,SseServerTransportandStreamableHTTPServerTransportaccept an optionalsecurity_settings: TransportSecuritySettingsand runTransportSecurityMiddleware.validate_request()against the incomingHostandOriginheaders before establishing a session. Because browsers attach anOriginheader to cross-origin WebSocket upgrade requests but do not enforce a same-origin policy on the response, a web page served from any origin could open a WebSocket to a reachable MCP server on this transport, complete theinitializehandshake, and issue JSON-RPC requests on the resulting session.Impact
A user who runs an MCP server on this transport bound to localhost or a LAN address, without a separate authentication or origin gate in front of it, and visits a malicious web page, can have that page enumerate and invoke the server's tools and read its resources. The consequences depend entirely on what the server exposes. The transport itself requires no token or prior session. Some browsers prompt before allowing a public page to open a connection to a local-network address, which adds a user-interaction step but is not a substitute for server-side validation.
Mitigation
Upgrade to version 1.28.1 or later, in which
websocket_server()accepts the same optionalsecurity_settings: TransportSecuritySettingsargument as the other HTTP-based transports and validates theHostandOriginheaders before accepting the handshake; a request that fails validation is rejected with HTTP 403 andValueError("Request validation failed")is raised to the caller. As with the other transports the parameter defaults toNone, which leaves validation disabled, so upgrading alone does not change behaviour: pass aTransportSecuritySettingswithenable_dns_rebinding_protection=Trueand appropriateallowed_hosts/allowed_originsto receive the protection. The recommended path remains to migrate off this deprecated transport to Streamable HTTP, whereFastMCPenables this protection automatically for localhost binds. The WebSocket transport has been removed entirely in v2.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
MCP Python SDK: WebSocket server transport does not support Host/Origin validation
CVE-2026-59950 / GHSA-vj7q-gjh5-988w / PYSEC-2026-3483
More information
Details
Summary
In affected versions, the deprecated WebSocket server transport (
mcp.server.websocket.websocket_server) accepted the WebSocket handshake without applying anyHostorOriginheader validation. TheTransportSecuritySettingsmechanism that the SSE and Streamable HTTP transports use for this purpose was not wired into the WebSocket transport, so there was no SDK-level way to restrict which origins could connect.Am I affected?
Only if a developer's application server exposes
mcp.server.websocket.websocket_server. This transport has never been part of the MCP specification, is marked deprecated, and is not reachable throughFastMCP— a developer must have wired it into an ASGI application themselves. Servers using stdio, SSE, or Streamable HTTP are not affected by this advisory.Details
websocket_server()constructed a StarletteWebSocketand calledaccept(subprotocol="mcp")immediately, with no inspection of the connection's headers. By contrast,SseServerTransportandStreamableHTTPServerTransportaccept an optionalsecurity_settings: TransportSecuritySettingsand runTransportSecurityMiddleware.validate_request()against the incomingHostandOriginheaders before establishing a session. Because browsers attach anOriginheader to cross-origin WebSocket upgrade requests but do not enforce a same-origin policy on the response, a web page served from any origin could open a WebSocket to a reachable MCP server on this transport, complete theinitializehandshake, and issue JSON-RPC requests on the resulting session.Impact
A user who runs an MCP server on this transport bound to localhost or a LAN address, without a separate authentication or origin gate in front of it, and visits a malicious web page, can have that page enumerate and invoke the server's tools and read its resources. The consequences depend entirely on what the server exposes. The transport itself requires no token or prior session. Some browsers prompt before allowing a public page to open a connection to a local-network address, which adds a user-interaction step but is not a substitute for server-side validation.
Mitigation
Upgrade to version 1.28.1 or later, in which
websocket_server()accepts the same optionalsecurity_settings: TransportSecuritySettingsargument as the other HTTP-based transports and validates theHostandOriginheaders before accepting the handshake; a request that fails validation is rejected with HTTP 403 andValueError("Request validation failed")is raised to the caller. As with the other transports the parameter defaults toNone, which leaves validation disabled, so upgrading alone does not change behaviour: pass aTransportSecuritySettingswithenable_dns_rebinding_protection=Trueand appropriateallowed_hosts/allowed_originsto receive the protection. The recommended path remains to migrate off this deprecated transport to Streamable HTTP, whereFastMCPenables this protection automatically for localhost binds. The WebSocket transport has been removed entirely in v2.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
Model Context Protocol Python SDK: HTTP client transports followed cross-origin redirects carrying custom headers and bodies
CVE-2026-116685 / GHSA-5h93-6whr-6q8j
More information
Details
Summary
In affected versions, the SDK's Streamable HTTP and SSE client transports followed HTTP redirects to any host. If the configured MCP endpoint answered with a redirect to a different origin:
X-API-Keycredential) were sent to that origin, and307or308redirect the request body was re-sent there too.The SDK's OAuth client providers followed redirects on their own discovery, registration and token requests in the same way.
A lone
Authorizationbearer header was not exposed; the HTTP library already drops it on cross-origin redirects.Anyone able to make an endpoint you trust redirect elsewhere (a stale redirect to a lapsed domain, a misrouted proxy rule, redirect logic an attacker can influence) could capture that material. A server that is itself malicious gains nothing this way; it already receives your requests directly.
Am I affected?
Yes, if your code uses the SDK as an MCP client over HTTP through any of:
streamable_http_client(on 2.x alsoClientgiven anhttp://orhttps://URL)streamablehttp_clientorsse_clientClientSessionGroupwith HTTP server parameterscreate_mcp_http_clienthelperThis includes an HTTP client you passed in yourself with
follow_redirects=True.Affected versions: 1.8.0 through 1.29.1, and 2.0.0 through 2.1.1.
Not affected:
follow_redirectsleft at its default ofFalseFix
Upgrade to
mcp1.30.0 (1.x) or 2.2.0 (2.x) or later; no code changes are needed.The transports, and the OAuth providers' own requests, now follow a redirect only when it stays on the endpoint's origin (same scheme, host and port, or an
httptohttpsupgrade on the same host) and keeps the request method. Any other redirect is not followed and the request fails with an error naming the target (MCPErroron 2.x,httpx.HTTPStatusErroron 1.x), whichever HTTP client the transport uses. The internalcreate_mcp_http_clienthelper no longer turns redirect following on, so code calling it directly now receives the redirect response instead.If your client currently reaches its server through a redirect to another host, including a server that needs no credentials, it will stop connecting after the upgrade: set the endpoint URL to the redirect's target.
Until you can upgrade, supply your own HTTP client with
follow_redirectsleft atFalse(http_client=onstreamable_http_client;httpx_client_factory=onsse_clientandstreamablehttp_client;ClientSessionGrouphas no such parameter). If a client may already have followed a redirect to a host you do not control, rotate the credentials it carried.If you genuinely need the old behaviour (unsupported)
This restores what this advisory fixes: redirects to any host are followed again, carrying your custom headers and, on
307/308, the request body, OAuth token requests included. Prefer setting the endpoint URL to the redirect's target. If you cannot, and you accept forwarding credentials to the redirect target, give the transport an HTTP client that follows redirects regardless of what the SDK asks for:The redirect handling is then the HTTP library's own, as before the fix: a lone
Authorizationheader is still dropped on cross-origin hops and301/302/303becomeGET. It is not something the SDK supports or tests.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion
CVE-2026-59951 / GHSA-84m7-p3x7-pcfv
More information
Details
Summary
In affected versions, a Streamable HTTP server in stateful mode (the default) never reclaimed session state:
DELETEended the session but left its entry registered;Each session also kept its parsed
initializeparameters, and the number of sessions was unlimited. A client that could reach the endpoint could grow server memory without bound using ordinary short requests; only a restart reclaimed it.Am I affected?
Yes, if you serve MCP over Streamable HTTP in stateful mode and clients you do not fully trust can reach the endpoint. Stateful mode is the default for:
FastMCP(1.x)MCPServerandServer.streamable_http_app()(2.x)StreamableHTTPSessionManagerAffected versions: 1.8.0 through 1.29.1, and 2.0.0 through 2.1.1.
Not affected:
stateless_http=True(no sessions are kept)Authentication limits who can open sessions, not how many a token holder can open.
Fix
Upgrade to
mcp1.30.0 (1.x) or 2.2.0 (2.x) or later. In those versions:session_idle_timeoutseconds (default 1800) is closed and its ID then answers404; open streams and in-progress requests keep it alive;max_sessionssessions exist at once (default 10000); a request that would open another is answered503;DELETE, expiry, or a refused opening request.Both settings are keyword arguments on
FastMCP(...)(1.x),MCPServer.run()/streamable_http_app()(2.x) andStreamableHTTPSessionManager;Nonedisables them.This bounds retention rather than eliminating it: a live session still holds its
initializeparameters (up to roughly twice the 4 MiB body limit), and aninitializewith invalid parameters still opens a session that expires like any other. On a small host, lowersession_idle_timeout,max_sessionsandmax_request_body_sizeto fit.If you cannot upgrade yet, pass
stateless_http=True(1.12.0 or later) where you need no per-session state, or restrict who can reach the endpoint.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Model Context Protocol Python SDK: Client fetched server-chosen $ref URLs while validating tool results against output schemas
CVE-2026-116686 / GHSA-rwrf-2pqf-9j8j
More information
Details
Summary
In affected versions, when a connected MCP server declared an
outputSchemafor a tool, the SDK's client validated eachcall_toolresult withjsonschema's default resolver, which fetches any$refit cannot resolve locally by opening the URL. A server could therefore put anhttp://,https://orfile://reference in a tool's output schema and make the client:Am I affected?
Yes, if your application uses the SDK as an MCP client (
ClientSessionover any transport,ClientSessionGroup, or the 2.xClient) and calls tools on servers you do not fully control. There was no setting that turned the validation off.Affected versions: 1.10.0 through 1.29.1, and 2.0.0 through 2.1.1.
Not affected: applications that only build servers. If nothing in your code uses
ClientSession,ClientSessionGroupor the 2.xClientclass, you are not affected.Fix
Upgrade to
mcp1.30.0 (1.x) or 2.2.0 (2.x) or later. The client now resolves references only within the schema document the server sent (plus the standard JSON Schema metaschemas), so result validation performs no network or file access. A tool whose output schema points outside its own document fails at call time withRuntimeError(Invalid schema for tool ...); in-document references such as#/$defs/...work as before.Until you can upgrade, call tools only on servers you trust. As a partial stopgap, skip tools whose
outputSchemacontains an$id, or a$ref/$dynamicRefthat does not start with#.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Model Context Protocol Python SDK: Server bearer-token authentication accepts tokens issued for a different resource server
CVE-2026-116684 / GHSA-w4fh-qvv9-3v23
More information
Details
Summary
In affected versions, the SDK's server-side bearer authentication had no way to check that a token was issued for your server (its audience). Where one authorization server issues tokens for several services, a valid token for another service was also accepted by your MCP server.
Am I affected?
Yes, if your HTTP server uses the SDK's bearer authentication (
auth=AuthSettings(...)withtoken_verifier=), its authorization server also issues tokens for other services, and yourTokenVerifierdoes not check the token's audience (aud) itself.Affected versions:
mcp1.10.0 through 1.29.1mcp2.0.0 through 2.1.1Fix
Upgrade to:
mcp1.30.0 or latermcp2.2.0 or laterUpgrading alone changes nothing. The patched versions add a
validate_token_resourcesetting that is off unless you set it. To turn the check on, make both of these changes together:validate_token_resource=TrueinAuthSettings, withresource_server_urlset to the audience your authorization server puts in tokens for your server.verify_token()asAccessToken.resource.A token for another service then gets
401. With only the first change, every request gets401.If your
TokenVerifieralready checks the audience, setvalidate_token_resource=Falseto silence the deprecation warning. The setting will default toTruein 3.0.If you cannot upgrade yet, reject any token whose
auddoes not include your server insideverify_token(). That closes the issue on every version.Severity
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
modelcontextprotocol/python-sdk (mcp)
v1.30.0Compare Source
Maintenance release of the 1.x line. 2.x is the current line; 1.x docs are at https://py.sdk.modelcontextprotocol.io/v1/.
A few defaults changed in this release. If you run a server or client on 1.x, skim these first:
Behaviour changes
HTTP client redirects are only followed within the endpoint's origin (#3448)
streamable_http_clientandsse_clientfollow a redirect only if it stays on the same scheme, host and port (or upgradeshttptohttpson the same host).httpx.HTTPStatusError. If that other URL is the server you meant, use it as the endpoint URL.follow_redirectssetting on anhttpx.AsyncClientyou pass in is no longer used for MCP requests, so you don't need it for the trailing-slash redirect any more.OAuthClientProviderapplies the same rule to its own requests.Idle Streamable HTTP sessions now expire (#3426)
FastMCP(..., session_idle_timeout=None, max_sessions=None).The OAuth client checks the authorization server's
issuer(#3431)issuerdoesn't match the server it was fetched for is now rejected withOAuthFlowError: Authorization server metadata issuer mismatch.Two new
DeprecationWarnings (#3431, #3451)ClientCredentialsOAuthProvider/PrivateKeyJWTOAuthProviderwithoutissuer=. Pass your authorization server's issuer URL.AuthSettingswithresource_server_urlset butvalidate_token_resourceunset. Set it toTrueorFalse.New
AuthSettings.validate_token_resource: only accept tokens yourTokenVerifierreports as issued for this server (#3451).issuer=onClientCredentialsOAuthProviderandPrivateKeyJWTOAuthProvider(#3431).session_idle_timeout=andmax_sessions=onFastMCP(#3426).What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.29.1...v1.30.0
v1.29.1Compare Source
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.29.0...v1.29.1
v1.29.0Compare Source
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.28.1...v1.29.0
v1.28.1Compare Source
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.28.0...v1.28.1
v1.28.0Compare Source
Deprecations
Two API surfaces now emit
DeprecationWarningahead of their removal in v2. Nothing is removed in 1.x, and the warnings fire only when the deprecated API is called - importing the modules stays silent.mcp.client.websocket.websocket_clientandmcp.server.websocket.websocket_server. WebSocket was never part of the MCP specification; use the streamable HTTP transport instead. The TypeScript SDK has likewise removed its WebSocket client for v2 (modelcontextprotocol/typescript-sdk#1783).ClientSession.experimental,Server.experimental,ServerSession.experimental, and theexperimental_task_handlers=kwarg onClientSession. Tasks (SEP-1686) were removed from the MCP specification and are expected to return as a separate MCP extension.If your test suite runs with
filterwarnings = ["error"]and exercises these paths, add a scoped ignore such asignore:The experimental tasks API is deprecated:DeprecationWarningorignore:The WebSocket .* transport is deprecated:DeprecationWarning.See #2828
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.