CVE-2025-66416: Mcp Model Context Protocol (MCP) Python Vulnerability

HIGH
Advisory Identifier: GHSA-9h52-p55h-vw2f
CWE-1188 CWE-350
Published
Advisory Summary

CVE-2025-66416 is a HIGH model context protocol (mcp) python vulnerability (CWE-1188: Initialization of a Resource with an Insecure Default) affecting Mcp libraries in the PyPI ecosystem. The issue involves model context protocol (mcp) python sdk does not enable dns rebinding protection by default. Remediation is available by upgrading affected packages to version 1.23.0.

CVE-2025-66416 at a Glance

CVE Identifier CVE-2025-66416
GHSA Identifier GHSA-9h52-p55h-vw2f
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1188: Initialization of a Resource with an Insecure Default
Affected Product Mcp
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-66416

To remediate this vulnerability, upgrade all affected Mcp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mcp fixed: 1.23.0
pip install mcp>=1.23.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show mcp

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-66416, inspect your installed packages using pip:

pip show mcp

Analyze the terminal output to locate any version of Mcp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.23.0), your application is affected.

Note: The pip show mcp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1188: Initialization of a Resource with an Insecure Default, where the product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure. In Mcp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2025-66416 Affected Mcp Versions

1 component(s)
Fixed Versions:
1.23.0
Product / Package Ecosystem Affected Versions Fixed Version
mcp
PyPI
< 1.23.0
1.23.0

References

Frequently Asked Questions

What is CVE-2025-66416?
CVE-2025-66416 is a security vulnerability in Mcp involving Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection by default under CWE-1188: Initialization of a Resource with an Insecure Default.
Which Mcp versions are affected?
Affected versions include releases prior to 1.23.0 across affected packages: mcp.
What version fixes CVE-2025-66416?
Upgrading to 1.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mcp affected?
Yes, mcp is affected in releases prior to 1.23.0. Upgrade your dependency to 1.23.0 or later.
What CWE is associated with CVE-2025-66416?
CVE-2025-66416 is classified under CWE-1188: Initialization of a Resource with an Insecure Default (The product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure.).
How can I check PyPI dependencies for CVE-2025-66416?
Run the dependency tree command: 'pip show mcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9h52-p55h-vw2f",
  "modified" : "2026-07-16T18:30:59Z",
  "published" : "2025-12-02T16:52:08Z",
  "aliases" : [ "CVE-2025-66416" ],
  "summary" : "Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection by default",
  "details" : "### Description\n\nThe 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.\n\nNote 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.\n\nServers 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/python-sdk/security/advisories/GHSA-9h52-p55h-vw2f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66416"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/python-sdk/commit/d3a184119e4479ea6a63590bc41f01dc06e3fa99"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-9h52-p55h-vw2f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modelcontextprotocol/python-sdk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mcp/PYSEC-2026-1617.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://pypi.org/project/mcp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1188", "CWE-350" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-02T16:52:08Z",
    "nvd_published_at" : "2025-12-02T19:15:52Z"
  }
}