MCP SDK localhost server can be tricked into serving requests from malicious websites

HighSE Fix-First Score 43/100CVE-2025-66414SE-AIV-01579Missing or broken access controlAI agents and assistantsMade public 2 Dec 2025

Download as PDF

What this means

A malicious website could make requests to your local MCP server and run tools or read data as if the user had asked for it. This could expose sensitive information, trigger unwanted actions, or allow an attacker to impersonate the user to connected systems.

SecurityElites Manager Brief: the decision in one minute

Local MCP servers without authentication can be attacked from websites using a DNS trick. We need to upgrade the SDK and enable protection, or stop running unauthenticated servers on localhost.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or infrastructure team running MCP servers.
Likely effortAbout 30 minutes: upgrade the SDK package, restart services, and verify protection is on. Longer if you have custom Express configurations that need the middleware added.

Questions to ask your team or supplier

  • Which services in our infrastructure are running unauthenticated HTTP MCP servers on localhost, and do they need to be?
  • Have we tested that DNS rebinding protection is working after the upgrade?

Message you can forward to the owning team

Security notice: MCP SDK localhost server can be tricked into serving requests from malicious websites (CVE-2025-66414)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to @modelcontextprotocol/sdk 1.24.0 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2025-66414-mcp-sdk-localhost-server-can-be-tricked-into-serving/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01579

What is at stake in your AI setup

  • Tools connected to the MCP server: an attacker could invoke them on behalf of the user.
  • Data exposed by the MCP server: an attacker could read it through a malicious website.
  • Provider API keys used by the MCP server: an attacker could use them to make requests to AI services.

Map where your company uses AI

Who is exposed

  • Teams running @modelcontextprotocol/sdk versions before 1.24.0 with HTTP transport on localhost
  • Services using StreamableHTTPServerTransport or SSEServerTransport without authentication
  • Custom Express configurations using the SDK without explicit DNS rebinding protection

Upgrades you need

SoftwareAffected versionsMove to
@modelcontextprotocol/sdk
npm
Every version before 1.24.01.24.0 or later

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededNone. No login is needed
Does a person have to do somethingYes, a small ordinary action by a user
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downNone
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsTotal control of the affected software, according to CISA

Read from the official severity rating: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Kind of coding mistake

  • CWE-1188
  • CWE-350

If you cannot upgrade today

  • Until you can upgrade, disable HTTP transport and use stdio transport instead if possible.
  • If you must use HTTP transport, add manual Host header validation in your reverse proxy or firewall to allow only expected localhost addresses.
  • Require authentication on all unauthenticated HTTP servers as a temporary measure.

Signs it may already have been used against you

  • Check server logs for requests with Host headers that do not match the localhost address the server is bound to.
  • Look for tool invocations or data access that do not correspond to user actions or expected API calls.
  • Monitor for requests arriving when the user's browser is on untrusted websites.

SecurityElites Fix Guide: step by step

  1. Find where the SDK is installedLook for @modelcontextprotocol/sdk in your package.json files and list all services using it. Check the installed version with npm list @modelcontextprotocol/sdk.
  2. Check which services use HTTP transportSearch your codebase for StreamableHTTPServerTransport and SSEServerTransport. For each one, note whether it runs on localhost and whether it has authentication enabled.
  3. Check if DNS rebinding protection is already onLook for enableDnsRebindingProtection: true in the configuration of each HTTP transport server. Also check for hostHeaderValidation() middleware in custom Express setups. If either is present, that server is already protected.
  4. Upgrade @modelcontextprotocol/sdk to version 1.24.0 or laterUpdate package.json to @modelcontextprotocol/sdk@^1.24.0. Run npm install or the equivalent for your package manager. Commit and deploy.
  5. Add DNS rebinding protection to custom Express serversIf you have custom Express configurations, import and apply the hostHeaderValidation() middleware when binding to localhost without authentication. See the official MCP documentation for the exact syntax.
  6. Restart affected servicesRestart all MCP services that use HTTP transport to load the new version and configuration.
  7. Verify the protection is activeCheck the installed version with npm list @modelcontextprotocol/sdk and confirm it shows 1.24.0 or higher. For custom Express servers, review the code to confirm hostHeaderValidation() middleware is in place.
  8. Review if unauthenticated localhost servers should still existMCP security best practices do not recommend running HTTP servers on localhost without authentication. Evaluate whether each unauthenticated server is necessary or if authentication can be added instead.

How to confirm it is fixed: Confirm the installed version of @modelcontextprotocol/sdk is 1.24.0 or higher with npm list, and verify that custom Express servers have the hostHeaderValidation() middleware in place.

SecurityElites Quick Fixes: copy and paste

Upgrade @modelcontextprotocol/sdk with npmupgrade

npm install @modelcontextprotocol/sdk@1.24.0
npm ls @modelcontextprotocol/sdk

Check installed versionfor this issue

npm list @modelcontextprotocol/sdk

Search for HTTP transport usage in TypeScript/JavaScriptfor this issue

grep -r "StreamableHTTPServerTransport\|SSEServerTransport" --include="*.ts" --include="*.js" .

Require sign-in with nginx in front of the servicegeneral hardening

location / {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
    proxy_pass http://127.0.0.1:8080;
}

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2025-66414) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - @modelcontextprotocol/sdk (npm): must be 1.24.0 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What is a DNS rebinding attack and why does it matter for localhost servers?A good answer: DNS rebinding tricks a browser into sending requests to localhost by switching where a domain name points. It matters for localhost servers because browsers normally block websites from talking to localhost for security, but a clever attack
Which transport types in the MCP SDK are affected by this issue?A good answer: HTTP-based transports: StreamableHTTPServerTransport and SSEServerTransport. Stdio transport is not affected.
What does the fix do, and how do I know it is applied?A good answer: The fix enables DNS rebinding protection by default for servers created with createMcpExpressApp() on localhost. For custom Express setups, you must add the hostHeaderValidation() middleware. You can verify by checking the version is 1.24.0
What should we do if we find that an unauthenticated HTTP server was running before the fix?A good answer: Review logs for suspicious tool invocations or data access that do not match user actions, check if any connected tools or APIs were misused, and consider whether authentication should be added before redeploying.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## MCP SDK localhost server can be tricked into serving requests from malicious websites (CVE-2025-66414)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01579 https://securityelites.com/ai-vulnerabilities/cve-2025-66414-mcp-sdk-localhost-server-can-be-tricked-into-serving/

### Why this matters
A malicious website could make requests to your local MCP server and run tools or read data as if the user had asked for it. This could expose sensitive information, trigger unwanted actions, or allow an attacker to impersonate the user to connected systems.

### What to do
1. Find where the SDK is installed
2. Check which services use HTTP transport
3. Check if DNS rebinding protection is already on
4. Upgrade @modelcontextprotocol/sdk to version 1.24.0 or later
5. Add DNS rebinding protection to custom Express servers
6. Restart affected services
7. Verify the protection is active
8. Review if unauthenticated localhost servers should still exist

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2025-66414-mcp-sdk-localhost-server-can-be-tricked-into-serving/

### Done when
- [ ] @modelcontextprotocol/sdk is at 1.24.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm the installed version of @modelcontextprotocol/sdk is 1.24.0 or higher with npm list, and verify that custom Express servers have the hostHeaderValidation() middleware in place.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 2 Dec 2025: Made public
  • 3 Dec 2026: Published

Official record

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.

Weakness type: CWE-1188, CWE-350

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2025-66414

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 3 Dec 2026. Read the vendor advisory before changing a production system.