We were tightening how our MCP server handles the OAuth resource parameter when the SC Media writeup of Moshe Siman Tov Bustan's OWASP Global AppSec talk landed. The headline called MCP security "still a mind-boggling mess."

Bustan, who leads security research at OX Security, called the Model Context Protocol ecosystem a poorly governed mess. He said the official SDK has been downloaded 150 million times, with around 100,000 server configurations in online marketplaces. We run a hosted server at https://mcp.noderings.com/mcp. As he put it: "Own your own infrastructure. [Software] maintainers are not your on-call."
What you still have to build around MCP
MCP authorization is optional. When you protect an HTTP MCP server, the current specification (2026-07-28) gives you real building blocks: OAuth 2.1, Protected Resource Metadata (RFC 9728), resource indicators (RFC 8707), authorization-server discovery, and PKCE. They still leave the process free to open whatever files it can see, and they leave a model free to treat tool output as a command.
Local STDIO transports sit outside that OAuth model. The specification says they should take credentials from the environment, so a local server is only as safe as the command that starts it. A valid access token also leaves the tool choice open. The OWASP MCP Security Cheat Sheet is blunt about this: unlike a traditional API, MCP lets a model choose the tool, the moment, and the parameters. The head of engineering and AI at 1Password told SC Media earlier this year that the deeper issue is "the absence of security primitives in the protocol itself. There's no built-in identity, no least-privilege enforcement, no audit trail." We think that's right, and those controls have to be built around the protocol.
The attacks to plan for
Tool poisoning, rug pulls, and shadowing
OWASP defines tool poisoning as malicious instructions hidden in a tool's description, parameter schema, or return values, written to steer the model. A rug pull is the same idea later on: the server changes its definitions after the user has already approved them. Tool shadowing uses one server's description to change how the agent uses tools from a different, trusted server.
Read the full manifest before you approve it, including schemas and annotations. Pin that definition with a hash, and look at it again when the hash changes. Annotations such as destructiveHint are only hints. The execution layer has to allow or deny a delete.
Prompt injection through tool output
OWASP's write-up of MCP tool poisoning describes a trust gap that's easy to miss. You might review tool descriptions when the agent first connects, but tool responses often go straight into the model context with no equivalent check. Treat every response as untrusted data, even from a server you already approved. Prefer a fixed JSON schema over free text, and authorize the next action in your own code. If a tool just read a file, that result should sit in the context as data. A send or an outbound HTTP call still needs its own check.
Confused deputy and token passthrough
The confused deputy problem, as described in the MCP Security Best Practices, shows up on proxy-style MCP servers that call a third-party API with a static client ID. If the proxy also lets MCP clients register dynamically and skips a fresh consent step for each of those clients, an attacker can reuse a previous consent cookie and catch an authorization code at a malicious redirect URI.
Token passthrough is more straightforward, and the spec forbids it. An MCP server accepts a token without checking that it was issued for that server, then forwards it to a downstream API. Your server should only accept tokens intended for itself. If it calls an upstream API, it should get a separate token issued for that API.
Local STDIO and an unreviewed supply chain
OX Security's research, presented at OWASP Global AppSec and reported by SC Media, is about a sharp edge in local STDIO. A command meant to start a local MCP server can still execute when it isn't a valid MCP command. The interface may return an error, but the process still ran. Anthropic was notified in January 2026 and treated this as expected behavior of the design. They left the SDK architecture as it was.
OX submitted a proof-of-concept configuration to 11 marketplaces; nine accepted it, one put acceptance on hold, and only GitHub's managed environment rejected it. SC Media also reports at least ten associated CVEs in software that uses MCP locally, with patches still missing on some of them. In a scan of more than 15,000 internet-connected MCP servers, OX found 5,095 unique hostnames, more than 100 of them abandoned, and showed that an abandoned hostname could be brought back to leak data from connecting clients. Their mitigations are the ones we'd start with: sandbox every MCP service, allow only reviewed tools and configurations, monitor tool invocations, and treat every external configuration as untrusted. OWASP's guide to using third-party MCP servers covers the same ground if you're consuming servers you didn't write.
Get OAuth right for a remote MCP server
If the server is reachable over HTTP, implement the authorization specification.

Discover the authorization server
A protected MCP server is an OAuth 2.1 resource server. It has to publish Protected Resource Metadata (RFC 9728), including at least one authorization server. Clients usually find that document from a WWW-Authenticate header on a 401, or from the well-known metadata URI, then load authorization server metadata (RFC 8414) or OpenID Connect Discovery.
In practice the 401 looks like this:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="mcp",
resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource/mcp"The client also needs a client ID. The 2026-07-28 specification prefers OAuth Client ID Metadata Documents and still allows Dynamic Client Registration (RFC 7591) for compatibility. We've used dynamic registration, and it works as long as you still do a real consent step for each client. Skipping that consent is how the confused-deputy pattern starts. Clients must use PKCE, with the S256 challenge when they can, and should stop if the server omits code_challenge_methods_supported.
Bind every token to one resource
Clients must send the resource parameter, defined by RFC 8707, on both the authorization request and the token request. The value has to be the canonical URI of the MCP server the client intends to call, for example https://mcp.example.com/mcp. Your server has to check that the access token was issued for that audience.
# Reject anything that was not issued for this server
expected = "https://mcp.example.com/mcp"
audiences = token.aud if isinstance(token.aud, list) else [token.aud]
if expected not in audiences:
raise Unauthorized("token was not issued for this MCP server")Be precise about the URI, and also accept the boring variants of your own server. Clients will send /mcp, /mcp/, the origin, or the origin with a slash. Accept the canonical equivalents of your server and reject everything else. If the MCP server then needs to call an upstream API, it should obtain a separate token for that API and leave the client's token where it arrived.
Scope narrowly and consent clearly
Grant the smallest scope that makes the tool work. Prefer short-lived access tokens, and rotate refresh tokens for public clients, as OAuth 2.1 requires. The consent screen should name the client, show the redirect URI, and list the requested scopes. A proxy that reuses a static upstream client ID still needs a fresh consent record of its own for each MCP client.
Sandbox the runtime and deny tools by default
OAuth names the caller. A sandbox and a deny-by-default tool list are what contain a bad tool, or a model that has been talked into a dangerous argument list.

Run the server as a non-root process in a locked-down container: a read-only root filesystem, dropped capabilities, no host mounts, and tightly limited egress. If you start local STDIO servers at all, start them from a fixed allowlist of commands and arguments. A command string from a marketplace listing, a chat message, or an untrusted config file is the failure OX demonstrated, and sandboxing is the mitigation they recommended.
We treat tools the way we'd treat an internal API surface: default deny. Ship the smallest set that does the job, pin the schemas, and validate arguments on the server. Block command execution, path traversal, and SSRF, including requests to cloud metadata endpoints. For anything destructive, or anything that sends data out of the environment, require a human approval step outside the model's context.
Log the identity, the scope, the tool, and the result that preceded the next invocation. Alert on schema changes, unusual egress, and bursts of scope elevation. If you can't reconstruct an incident from those logs, the server isn't ready.
A pre-production checklist
Check these items before a server is reachable by agents.
Identity and tokens
- Remote HTTP MCP is protected with OAuth 2.1 and PKCE (
S256). - Protected Resource Metadata is published and discoverable (RFC 9728).
- Clients send a
resourceparameter set to the server's canonical URI (RFC 8707). - The server rejects tokens that were issued for a different audience.
- The server keeps the client access token and gets a separate token for any upstream API.
- Scopes are narrow; access tokens are short-lived.
- The consent screen shows the client, the requested scopes, and the redirect URI.
- Each dynamically registered client gets its own consent record.
Runtime, tools, and visibility
- The server runs sandboxed, as a non-root user, with limited egress.
- Local STDIO commands, if used at all, come from a fixed allowlist.
- Tools are deny-by-default; full manifests are reviewed and pinned.
- Destructive or data-exfiltrating actions require human approval.
- Tool output is treated as untrusted data, and the next action is authorized in your own code.
- Inputs are validated; SSRF, path traversal, and command injection are blocked.
- External MCP servers and marketplace configs are allowlisted and reviewed.
- Every invocation is logged, correlated with the previous result, and alertable.
How we apply this on the NodeRings MCP server
NodeRings is a platform for hosting providers, plus a compute marketplace, where users discover, deploy, and manage compute from independent providers through one API. We also expose a hosted MCP server for that same surface.
The server lives at https://mcp.noderings.com/mcp. Clients authenticate with OAuth. Dynamic client registration is available at https://api.noderings.com/oauth/register. Users see a consent page before access is granted. The scope we issue is mcp:tools, and access tokens are audience-bound to https://mcp.noderings.com/mcp through the resource parameter. This week we tightened how that parameter is handled so canonical variants of the server URL are accepted, and anything that isn't this server is still rejected.
That's the OAuth part the specification asks for. Sandboxing, a tight tool list, output handling, and an audit log are what make us willing to expose the endpoint to an agent. See the NodeRings documentation for details.
What to do next
Start with the servers you already run. Put OAuth in front of any remote MCP endpoint, bind tokens to that endpoint's canonical URI, and refuse passthrough. Move the process into a sandbox. Cut the tool list until you can stand behind every item, pin the schemas, treat tool output as data, and log the invocations.
Sources
- Paul Wagenseil, "OWASP Global AppSec: MCP security still a mind-boggling mess," SC Media, 13 November 2026, https://www.scworld.com/resource/owasp-global-appsec-mcp-security-still-a-mind-boggling-mess.
- Model Context Protocol, "Authorization" (specification 2026-07-28), https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization.
- Model Context Protocol, "Authorization Security Considerations" (2026-07-28), https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/security-considerations.
- Model Context Protocol, "Authorization Server Discovery" (2026-07-28), https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/authorization-server-discovery.
- Model Context Protocol, "Security Best Practices" (2026-07-28), https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices.
- IETF, "The OAuth 2.1 Authorization Framework" (draft-ietf-oauth-v2-1-13), https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-13.
- RFC 9728, "OAuth 2.0 Protected Resource Metadata," https://www.rfc-editor.org/rfc/rfc9728.html.
- RFC 8707, "Resource Indicators for OAuth 2.0," https://www.rfc-editor.org/rfc/rfc8707.html.
- RFC 7591, "OAuth 2.0 Dynamic Client Registration Protocol," https://www.rfc-editor.org/rfc/rfc7591.html.
- RFC 8414, "OAuth 2.0 Authorization Server Metadata," https://www.rfc-editor.org/rfc/rfc8414.html.
- OWASP, "MCP Security Cheat Sheet," https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html.
- OWASP, "MCP Tool Poisoning," https://community.owasp.org/attacks/MCP_Tool_Poisoning.
- OWASP GenAI Security Project, "A Practical Guide for Securely Using Third-Party MCP Servers," https://genai.owasp.org/resource/cheatsheet-a-practical-guide-for-securely-using-third-party-mcp-servers-1-0/.
- OX Security, "The Mother of All AI Supply Chains: Technical Deep Dive," https://www.ox.security/blog/the-mother-of-all-ai-supply-chains-technical-deep-dive/.
