NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · MCP Rust SDK (rmcp)

CVE-2026-42559: rmcp Streamable HTTP server transport has a DNS rebinding vulnerability

highCVSS 3.1 8.8GHSA-89vp-x53w-74fx

The Rust MCP SDK crate rmcp, before 1.4.0, did not check the Host header on its Streamable HTTP server transport. A malicious web page can use DNS rebinding to call tools on an MCP server running on the victim's loopback or private network. Upgrade to rmcp 1.4.0 or later. stdio and child-process transports are not affected.

Published May 6, 2026 · Updated May 19, 2026 · Analysis Oct 28, 2026

What an attacker can do

A server built on rmcp's streamable_http_server transport accepted requests whatever Host header they carried. In a DNS rebinding attack, the attacker's domain first resolves to their own server, then flips to 127.0.0.1 or a private address. The victim's browser treats the local MCP server as the same origin as the attacker's page and sends requests to it. The attacker never needs to guess a port that is reachable from outside, because the victim's own browser makes the calls.

The attacker needs the victim to visit a page. From there they can list and call every tool the local server exposes, read resources and prompts, and use the MCP session state. MCP servers often run with the user's privileges and expose filesystems, shells or browser control, so the advisory says the practical result can be arbitrary code execution on the developer machine.

The flaw sits in the SDK, so every server built on rmcp's HTTP transport inherits it. Sibling advisories cover the TypeScript, Python, Go and Java SDKs.

Who is affected

Every rmcp release before 1.4.0 that uses the Streamable HTTP server transport. Servers on stdio or child-process transports are not affected. Check which version your project locks:

cargo tree -i rmcp

Also check the binaries you run that embed rmcp, since they need a rebuild against the fixed crate.

rmcp

Ecosystem
Rust (crates.io)
Affected
< 1.4.0
Fixed in
1.4.0
Check
cargo tree -i rmcp

How to fix it

Upgrade to rmcp 1.4.0 or later (1.5.1 was current when the advisory was updated), then rebuild and redeploy:

cargo update -p rmcp

Version 1.4.0 sets StreamableHttpServerConfig::allowed_hosts to a loopback-only default of localhost, 127.0.0.1 and ::1, and validate_dns_rebinding_headers() returns HTTP 403 for other hosts. Public deployments must set their hostnames with StreamableHttpService::with_allowed_hosts(...). disable_allowed_hosts() turns the check off and is not advised without a proxy that validates Host.

If you cannot upgrade, put the server behind a reverse proxy such as nginx or Caddy that rejects unexpected Host values, and do not bind it to 0.0.0.0 without one.

How to tell if you were hit

Check access logs of the MCP server or its proxy for requests whose Host header is not localhost, 127.0.0.1 or ::1, particularly a public-looking domain arriving on a loopback listener. On a patched server such requests appear as HTTP 403. Look in tool-call logs for tool invocations that you did not start, or that happened while a browser was open on an unfamiliar site. Beam logs agent shell commands and MCP tool calls, which helps when a rebinding attack drives tools that run commands.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Prior to version 1.4.0, the rmcp crate's Streamable HTTP server transport (crates/rmcp/src/transport/streamable_http_server/) did not validate the incoming Host header. This allowed a malicious public website, via a DNS rebinding attack, to send authenticated requests to an MCP server running on the victim's loopback or private-network interface — violating the MCP specification's transport security guidance.

Impact

An attacker who convinces a victim to visit a malicious page can:

  • Enumerate and invoke any tool exposed by a locally-running rmcp-based MCP server.
  • Read resources, prompts, and any state accessible via the MCP session.
  • Trigger side effects (file writes, shell execution, API calls, etc.) limited only by what tools the victim's server exposes.

Because MCP servers frequently run with the user's privileges and expose developer tooling (filesystems, shells, browser control, language servers, etc.), the practical impact can extend to arbitrary code execution on the victim's machine.

Affected Versions

rmcp < 1.4.0 — all prior releases of the Streamable HTTP server transport. Non-HTTP transports (stdio, child-process) are not affected.

Patched Versions

rmcp >= 1.4.0 (current: 1.5.1).

Patch

Fixed in PR #764 (commit 8e22aa2), released as v1.4.0 on 2026-04-09:

  • StreamableHttpServerConfig::allowed_hosts now defaults to a loopback-only allowlist: ["localhost", "127.0.0.1", "::1"].
  • All incoming HTTP requests pass through validate_dns_rebinding_headers(), which parses the Host header and returns HTTP 403 if the host is not on the allowlist.
  • Public deployments can configure an explicit allowlist via StreamableHttpService::with_allowed_hosts(...), or opt out (not recommended without an upstream reverse proxy that validates Host) via disable_allowed_hosts().

This fix validates the Host header only. Origin header validation is tracked as a defense-in-depth follow-up in #822 and is not required to block the DNS rebinding attack described here — the browser cannot forge the Host header sent to the rebound server.

Workarounds for Unpatched Users

  • Upgrade to rmcp >= 1.4.0.
  • If upgrade is not possible, place the MCP server behind a reverse proxy (e.g. nginx, Caddy) configured to reject requests whose Host header is not one of your expected hostnames.
  • Do not bind the MCP server to 0.0.0.0 without such a proxy.

Resources

  • PR: https://github.com/modelcontextprotocol/rust-sdk/pull/764
  • Issue: https://github.com/modelcontextprotocol/rust-sdk/issues/815
  • Follow-up (Origin validation): https://github.com/modelcontextprotocol/rust-sdk/issues/822
  • MCP transport security guidance: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#security-warning

Related advisories (same class of vulnerability)

  • TypeScript SDK: GHSA-w48q-cv73-mx4w
  • Python SDK: GHSA-9h52-p55h-vw2f
  • Go SDK: GHSA-xw59-hvm2-8pj6
  • Java SDK: GHSA-8jxr-pr72-r468

Credited to JLLeitschuh.

Questions

Is rmcp 1.3.x affected by CVE-2026-42559?

Yes. All releases below 1.4.0 are affected if they use the Streamable HTTP server transport.

Do stdio MCP servers need to worry?

No. The advisory states that non-HTTP transports, stdio and child-process, are not affected.

Does the patch validate the Origin header too?

No. It validates Host only. The advisory says Origin validation is tracked as a follow-up and is not needed to stop this DNS rebinding attack, because a browser cannot forge the Host header.

Will my public deployment break after upgrading?

It can. The default allowlist is loopback only, so set your real hostnames with with_allowed_hosts, or requests get a 403.

References

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 Rust SDK (rmcp) vulnerabilities

All MCP Rust SDK (rmcp) entries