Repository navigation
Description
What's broken?
The spec doesn't cover a case it clearly should
Where in the spec or docs?
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 validationWhat 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.
Activity
sattyamjjain commentedon Oct 17, 2026
playb0t commentedon Oct 17, 2026
playb0t commentedon Oct 27, 2026
Ben-Home commentedon Oct 28, 2026
eshaanjain26 commentedon Nov 23, 2026
Supporting the reshaped proposal (the three clause edits plus the shorter subsection), and adding one point that sits next to the token endpoint concern already raised here, in a form that could be a single clause.
The address checks validate where the token request goes. They do not validate the relationship between the token endpoint and the authorization server the user believes they are dealing with. A resource server selects an entry from
authorization_servers; that server's metadata then names thetoken_endpoint. If nothing binds the two, a metadata document can point the bridge at a token endpoint on an unrelated origin, and the bridge will deliver the authorization code and any refresh token there. On a server deployment a user might at least see the authorization interaction. Through a bridge launched from a host's configuration, nobody sees the endpoint choice at all, which is the audience confusion at the heart of this issue: the bridge acts for the user, but the audience for its credentials is chosen by the remote side.Suggested clause, in the style of the other edits, for the bridge subsection or the token-request bullet:
Recording the chosen authorization server and token endpoint alongside the destination logging already proposed would make the check auditable after the fact.
Happy to draft this as exact diff text against the current page, aligned with the three edits above, if the maintainers want it in that form.
— Eshaan Jain, independent researcher (IEEE Senior Member)
playb0t commentedon Nov 24, 2026
eshaanjain26 commentedon Nov 27, 2026
You are right, and the Google example settles it. Same-origin is not the invariant, and a MUST there would break legitimate deployments. I withdraw that formulation.
The concern I was reaching for is narrower. The bridge's credential audience is whatever the metadata says, so the binding that matters is between the metadata and the issuer it was fetched for: RFC 8414 §3.3 issuer matching on the metadata document itself, and the RFC 9700 §4.4 issuer check in the authorization response as the mix-up defence. Where I would still put a clause: a bridge MUST NOT act on a token endpoint from a metadata document whose issuer does not match the issuer identifier the discovery started from, and SHOULD log the token endpoint it used. That keeps the SSRF scoping fix, which is the heart of this issue, free of the over-broad rule.
Happy to draft that as a replacement clause if it is useful.
Eshaan Jain, independent researcher (IEEE Senior Member)
playb0t commentedon Nov 27, 2026
eshaanjain26 commentedon Nov 27, 2026
Thanks, that settles the remaining clause. You are right that a pointer to RFC 8414 §3.3 is the right size here. The section already says the whole document must not be used when the issuer does not match, so a token endpoint only MUST would restate a weaker version of that rule. I will drop the replacement clause.
One small addition I would still offer, as a sentence rather than a clause: name the failure mode explicitly, so a reader implementing the check knows a mismatch means discard the metadata document, not just the token endpoint. Happy to put that in as a short PR against the subsection if you want it.
Eshaan Jain, independent researcher (IEEE Senior Member)