CVE-2025-66414: @modelcontextprotocol/sdk TypeScript SDK Lacks Default DNS Rebinding Protection

@modelcontextprotocol/sdk Updated 14 Dec 2025

Summary

02/12/2025
Yes i
High
7.6

CVE-2025-66414: Model Context Protocol (MCP) TypeScript SDK does not enable DNS rebinding protection by default. Affects @modelcontextprotocol/sdk versions < 1.24.0. Fixed in 1.24.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The @modelcontextprotocol/sdk is a TypeScript SDK designed for implementing the Model Context Protocol (MCP), which facilitates communication between clients and servers in a structured manner. This SDK is particularly useful for developers building HTTP-based servers. However, it has a significant security oversight regarding DNS rebinding protection, which can expose local servers to malicious attacks if not properly configured.

Vulnerability Detail

The vulnerability arises from the @modelcontextprotocol/sdk not enabling DNS rebinding protection by default for HTTP-based servers. When an MCP server is run on localhost without authentication using StreamableHTTPServerTransport or SSEServerTransport, and the enableDnsRebindingProtection option is not activated, an attacker can exploit DNS rebinding. This allows the attacker to bypass same-origin policy restrictions, potentially invoking tools or accessing resources on the local MCP server on behalf of the user. This poses a serious risk, especially in scenarios where sensitive operations are performed on the server.

How To Fix

Minimum fixed version

1.24.0

This is the first release that contains the fix.

npm install @modelcontextprotocol/sdk@1.24.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

For users with custom Express configurations who cannot upgrade immediately, it is advised to apply the exported hostHeaderValidation() middleware when running an unauthenticated server on localhost. This can be done by adding the following code to your server setup:

const { hostHeaderValidation } = require('@modelcontextprotocol/sdk');

app.use(hostHeaderValidation());

Conclusion

The @modelcontextprotocol/sdk vulnerability (CVE-2025-66414) highlights the importance of enabling DNS rebinding protection for HTTP-based servers. By updating to version 1.24.0 or later and applying necessary middleware configurations, developers can secure their applications against potential attacks. Utilizing tools like Vulert can further enhance security by providing real-time vulnerability monitoring.

See every vulnerability recorded for @modelcontextprotocol/sdk →

Share this vulnerability

FAQ

DNS rebinding is a technique that allows an attacker to bypass the same-origin policy in web browsers, enabling them to send requests to a local server from a malicious website.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors and alerts for open-source vulnerabilities without requiring any installation.

Running an MCP server without authentication exposes it to potential attacks, including unauthorized access to sensitive resources and operations, especially if DNS rebinding protection is not enabled.

While running MCP servers on localhost can be safe, it is crucial to implement proper security measures, such as enabling DNS rebinding protection and using authentication, to mitigate risks.

If you cannot upgrade immediately, ensure to implement the hostHeaderValidation() middleware in your Express configuration to provide a temporary safeguard against DNS rebinding attacks.

Related vulnerabilities

Recent vulnerabilities recorded for @modelcontextprotocol/sdk.

How To Fix

Minimum fixed version

1.24.0

This is the first release that contains the fix.

npm install @modelcontextprotocol/sdk@1.24.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback