CVE-2025-66414: Model Context Protocol (MCP) TypeScript SDK does not enable DNS rebinding protection by default
The MCP TypeScript SDK (@modelcontextprotocol/sdk) before 1.24.0 leaves DNS rebinding protection off by default for HTTP servers. A malicious web page can reach an unauthenticated MCP server on localhost and call its tools as the user. stdio servers are not affected. Upgrade to 1.24.0 and validate Host headers.
Published Dec 2, 2025 · Updated Feb 17, 2026 · Analysis Nov 1, 2026
What an attacker can do
StreamableHTTPServerTransport and SSEServerTransport accept requests without checking the Host header unless enableDnsRebindingProtection is set, and it is not set by default. In a DNS rebinding attack, a page the user visits uses a domain that first resolves to the attacker and then to 127.0.0.1. The browser treats the local MCP server as the same origin as the page, so the same-origin policy no longer blocks the page's requests.
The attacker needs three things: the victim visits their page, the victim runs an HTTP-based MCP server on localhost, and that server has no authentication. The CVSS 4.0 vector marks passive user interaction and attack requirements for this reason.
What the attacker gets is whatever the server exposes. The advisory says they can invoke tools or access resources on the user's behalf. For a filesystem, shell, database or browser-automation MCP server, that can mean reading files, running commands or changing data, from a page in an ordinary browser tab. The MCP security best practices already advise against running unauthenticated HTTP servers locally, so this mostly hits developer setups.
Who is affected
@modelcontextprotocol/sdk before 1.24.0, in servers that use StreamableHTTPServerTransport or SSEServerTransport, listen on localhost, have no authentication, and have not set enableDnsRebindingProtection. Servers using stdio are not affected. Servers built with createMcpExpressApp() get the protection on localhost from the patched version onward. Dependencies often pin the SDK, so check the lockfile.
npm ls @modelcontextprotocol/sdk@modelcontextprotocol/sdk
- Ecosystem
- npm
- Affected
- < 1.24.0
- Fixed in
- 1.24.0
- Check
npm ls @modelcontextprotocol/sdk
How to fix it
Upgrade to @modelcontextprotocol/sdk 1.24.0:
npm install @modelcontextprotocol/[email protected]Servers created with createMcpExpressApp() are protected by default when bound to localhost. If you use a custom Express setup, add the exported hostHeaderValidation() middleware to any unauthenticated localhost server, or set enableDnsRebindingProtection on the transport. Adding authentication, or switching to stdio, also removes the exposure.
How to tell if you were hit
Find locally run MCP servers that use the HTTP or SSE transports without authentication, then check whether they validate Host. In their access logs, look for requests whose Host header is a domain name instead of localhost or 127.0.0.1, and for tool calls you did not start. A rebinding page typically produces many requests from a browser Origin that is not the MCP client. Check the installed SDK version with npm ls @modelcontextprotocol/sdk.
Beam records MCP tool calls made by coding agents, but not calls a web page makes straight to a server, so it helps mainly when the server is also used by your agents.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
The Model Context Protocol (MCP) TypeScript 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 with StreamableHTTPServerTransport or SSEServerTransport and has not enabled enableDnsRebindingProtection, 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 createMcpExpressApp() now have this protection enabled by default when binding to localhost. Users with custom Express configurations are advised to update to version 1.24.0 and apply the exported hostHeaderValidation() middleware when running an unauthenticated server on localhost.
Credited to JLLeitschuh.
Questions
- Does CVE-2025-66414 affect MCP servers that use stdio?
No. The advisory says it does not affect stdio transport. It concerns HTTP-based servers run on localhost without authentication.
- Is 1.24.0 enough on its own?
For servers built with
createMcpExpressApp(), yes, since protection is on by default on localhost. Custom Express setups should also apply thehostHeaderValidation()middleware, as the advisory advises.- Does the attack need a browser?
Yes. DNS rebinding works by getting the victim's browser to treat the local server as the same origin as an attacker's page, so the victim must visit that page.
References
Read for this analysis:
- https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-w48q-cv73-mx4w
- https://github.com/advisories/GHSA-w48q-cv73-mx4w
- https://github.com/modelcontextprotocol/typescript-sdk/pull/1205
- https://github.com/modelcontextprotocol/typescript-sdk/commit/608360047dc6899f1cf4f0226eb62fe7b11b3898
- https://nvd.nist.gov/vuln/detail/CVE-2025-66414
- https://github.com/modelcontextprotocol/typescript-sdk/commit/09623e2aa5044f9e9da62c73d820a8250b9d97ed
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 TypeScript SDK vulnerabilities
All MCP TypeScript SDK entriesGHSA-f897-62hf-6gxq
MCP TypeScript SDK: HTTP server transports and handlers did not limit request body size or JSON-RPC batch length
high7.5Oct 27, 2026CVE-2026-111767
MCP TypeScript SDK: Experimental tasks were not tied to the session that created them
high8.6Oct 20, 2026CVE-2026-111768
MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation
high7.5Oct 20, 2026CVE-2026-111769
MCP TypeScript client SDK: HTTP client transports and OAuth requests followed cross-origin redirects and re-sent custom headers and request bodies
medium6.5Oct 20, 2026CVE-2026-111771
MCP TypeScript SDK: Server bearer authentication accepted tokens issued for another service
medium6.8Oct 20, 2026CVE-2026-104850
MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server
high7.5Oct 6, 2026
