NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · MCP Python SDK

CVE-2025-66416: Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection by default

highCVSS 4.0 7.6GHSA-9h52-p55h-vw2f

The Python MCP SDK (pip package `mcp`) before 1.23.0 does not turn on DNS rebinding protection for HTTP servers by default. A local, unauthenticated `FastMCP` server using streamable HTTP or SSE can be driven by a hostile web page open in the user's browser. Upgrade to mcp 1.23.0.

Published Dec 2, 2025 · Updated Jul 16, 2026 · Analysis Nov 1, 2026

What an attacker can do

With streamable HTTP or SSE transport, the server used no TransportSecuritySettings unless the developer supplied them, so the Host header was not checked. DNS rebinding abuses that. The victim opens an attacker's site, whose domain is then re-pointed at 127.0.0.1. The browser still thinks it is talking to the attacker's origin, so it lets the page send requests to the MCP server and read the replies.

The preconditions are narrow: the server runs on localhost, has no authentication, and the user visits the page while it is running. CVSS 4.0 therefore marks passive user interaction and some attack requirements.

The attacker can then call any tool or read any resource the server offers, with the user's privileges. For Python MCP servers that wrap files, shells, databases or internal APIs, that means data theft or actions taken in the user's name. The advisory notes that unauthenticated local HTTP servers are already discouraged by MCP security guidance, and that stdio servers are unaffected.

Who is affected

The mcp package on PyPI below 1.23.0, when a server built with FastMCP runs over streamable HTTP or SSE on localhost without authentication and without TransportSecuritySettings. Servers written at the low level with StreamableHTTPSessionManager or SseServerTransport are also in scope, and they need explicit settings even on 1.23.0. stdio servers are not affected.

pip show mcp

mcp

Ecosystem
PyPI
Affected
< 1.23.0
Fixed in
1.23.0
Check
pip show mcp

How to fix it

Upgrade to mcp 1.23.0:

pip install --upgrade "mcp>=1.23.0"

From that version, FastMCP() enables DNS rebinding protection automatically when host is 127.0.0.1 or localhost. If you use StreamableHTTPSessionManager or SseServerTransport directly, configure TransportSecuritySettings yourself for any unauthenticated localhost server. The better fix is to add authentication or use stdio.

How to tell if you were hit

Inventory local Python MCP servers started with transport="streamable-http" or "sse" and check pip show mcp in each environment. In server access logs, requests whose Host is a public-looking domain instead of localhost or 127.0.0.1, or whose Origin is a website, suggest rebinding. So do tool calls that appear while no MCP client was in use.

Beam records MCP tool calls from AI coding agents, which helps when the same server is used by your agents. It does not see requests that a web page sends directly.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Description

The Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection by default for HTTP-based servers. When an HTTP-based MCP server is run on localhost without authentication using FastMCP with streamable HTTP or SSE transport, and has not configured TransportSecuritySettings, a malicious website could exploit DNS rebinding to bypass same-origin policy restrictions and send requests to the local MCP server. This could allow an attacker to invoke tools or access resources exposed by the MCP server on behalf of the user in those limited circumstances.

Note that running HTTP-based MCP servers locally without authentication is not recommended per MCP security best practices. This issue does not affect servers using stdio transport.

Servers created via FastMCP() now have DNS rebinding protection enabled by default when the host parameter is 127.0.0.1 or localhost. Users are advised to update to version 1.23.0 to receive this automatic protection. Users with custom low-level server configurations using StreamableHTTPSessionManager or SseServerTransport directly should explicitly configure TransportSecuritySettings when running an unauthenticated server on localhost.

Credited to JLLeitschuh.

Questions

Are stdio MCP servers affected by CVE-2025-66416?

No. The advisory says servers using stdio transport are not affected. The risk is limited to HTTP-based servers, streamable HTTP or SSE, running on localhost without authentication.

Do I need to change code after upgrading to 1.23.0?

Not if you use FastMCP() bound to 127.0.0.1 or localhost, since protection is automatic. With low-level StreamableHTTPSessionManager or SseServerTransport, you must set TransportSecuritySettings explicitly.

Is this exploited in the wild?

No source for this entry reports exploitation, and it is not in CISA's KEV catalog. It needs a victim who visits a hostile page while running an unauthenticated local server.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More MCP Python SDK vulnerabilities

All MCP Python SDK entries