MCP SDK localhost server can be tricked into serving requests from malicious websites
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 Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or infrastructure team running MCP servers. |
| Likely effort | About 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-01579What 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.
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
| Software | Affected versions | Move to |
|---|---|---|
| @modelcontextprotocol/sdk npm | Every version before 1.24.0 | 1.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 attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | None. No login is needed |
| Does a person have to do something | Yes, a small ordinary action by a user |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Total 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
- 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.
- 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.
- 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.
- 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.
- 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.
- Restart affected servicesRestart all MCP services that use HTTP transport to load the new version and configuration.
- 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.
- 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/sdkCheck installed versionfor this issue
npm list @modelcontextprotocol/sdkSearch 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.
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.
Related vulnerabilities
In the same software
- MCP servers over HTTP accept unlimited request sizes, causing memory exhaustion High · GHSA-f897-62hf-6gxq
- Model Context Protocol servers can run out of memory from large requests High · CVE-2026-111768
- Model Context Protocol SDK tasks can be read by other clients sharing the store High · CVE-2026-111767
- Model Context Protocol OAuth client sends credentials to wrong authorization server High · CVE-2026-104850
- Model Context Protocol SDK can send client data to the wrong user in shared deployments High · CVE-2026-25536
- Model Context Protocol SDK regex DoS in URI template parsing High · CVE-2026-0621
The same kind of mistake in other AI tools
- Langflow OSS allows authenticated users to access or change other users' flows High · CVE-2026-127067
- BaaRai ARTEX admin account can be claimed without authentication on first setup Critical · CVE-2026-140422
- BaaRai ARTEX admin login can be guessed without limits or lockouts Critical · CVE-2026-140365
- NLTK dependency parser crashes on long sentences High · CVE-2026-129222
- NLTK regex patterns can be made to freeze the server High · CVE-2026-129229
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-66414For 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.