Security best practices: SSRF section does not cover local stdio-to-HTTP bridges acting as OAuth clients

未关闭
#3,437 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
42/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
markdown

调研方向

The change goes in docs/docs/draft/tutorials/security/security_best_practices.mdx, directly after the "DNS Resolution Considerations" subsection and before "SSRF Against Authorization Servers". Read the existing SSRF mitigations first, since the proposed text refers back to them. Done means the subsection is inserted as written, or revised with maintainers, and the docs build still renders. The issue is open with no comments, and the wording itself is a policy decision, so confirm scope with a maintainer before editing.

由索引模型根据 Issue 内容生成。

描述

What's broken?

The spec doesn't cover a case it clearly should

Where in the spec or docs?

https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices#server-side-request-forgery-ssrf

Security Best Practices, section "Server-Side Request Forgery (SSRF)". Source file: docs/docs/draft/tutorials/security/security_best_practices.mdx. The spot is the end of "DNS Resolution Considerations", right before "SSRF Against Authorization Servers".

What should happen?

The SSRF section should name the local stdio-to-HTTP bridge as a client that runs OAuth discovery on the user's machine. It should say that the section's mitigations apply to it. Proposed subsection below, ready to drop in after "DNS Resolution Considerations". It is 34 lines; nothing existing changes.

#### Local Bridges Acting as Clients

A local bridge that turns a stdio connection into Streamable HTTP runs
the whole OAuth client role on the user's machine. The client in this
section is then the bridge rather than the application the user sees. The
bridge reads `WWW-Authenticate` and fetches the protected resource
metadata. It picks an authorization server from `authorization_servers`.
Then it sends the token request to the `token_endpoint` named in that
server's metadata. The remote server controls each of those values. The bridge makes the requests from inside the user's network.

The mitigations above are written for clients deployed to a server. A
bridge on a laptop or a CI runner needs the same mitigations. The
reachable targets differ in two ways. Loopback and link-local addresses are now
the user's own services and, on a cloud-hosted development machine, the
instance metadata endpoint. A bridge is also usually started from a host
application's configuration, so the user never sees the URLs it was sent
to.

**Bridge Authors**

Bridge authors **SHOULD**:

- Apply the HTTPS, private-range and redirect checks of this section
  before every discovery fetch and before the token request
- Record the destinations they chose where the user can inspect them

**Hosts That Launch a Bridge**

Hosts that start a bridge from their own configuration flows **SHOULD**:

- Pin it to a reviewed version
- Prefer a native remote transport where they have one, so that the host
  itself performs the client-side validation
What actually happens?

The mitigation text reads: "MCP clients deployed to a server MUST consider SSRF risks and implement appropriate mitigations when fetching OAuth-related URLs." A local stdio-to-HTTP bridge runs that same discovery from the user's machine, and nothing in that setup is deployed to a server. It takes resource_metadata, authorization_servers and the token endpoint from the remote server and then sends its requests wherever they point, including the token request. The page does not cover that case. Host applications start such bridges from their configuration flows, for users who never see those URLs.

Anything else?

Why I think it is needed. Five CVE records exist for one such bridge, mcp-remote on npm: CVE-2026-51994, -51995, -51996, -51997 and -52001. MITRE published them on 24 September 2026; the CNA text gives 0.1.16 through 0.1.38 as affected. I reported them. On 15 October I ran the current release, 0.15.1, against loopback canaries with the procedure in my research record. It still followed the server-selected discovery paths of the first two records. Evidence, procedures and limits: https://github.com/playb0t/mcp-remote-oauth-security.

On the channel: the repository lets only collaborators open pull requests at the moment, so this comes as a documentation issue with the text inline. If a maintainer prefers it as a PR, I will open one the moment a fork is allowed to. Happy to move it under another heading or trim it if the docs team prefers a shorter note.

AI disclosure: I drafted this with AI assistance (Claude Code) from my own research notes and reviewed every sentence; the evidence and the rationale are mine.

主要语言
TypeScript
星标
9.8k
派生
1.9k
平均合并
2 天 4 小时
30 天内合并 PR
73

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/modelcontextprotocol 的其他 Issue

查看 modelcontextprotocol/modelcontextprotocol 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。