← Research

APIsec Labs · Excerpt · Original article: 8 min read

Exploiting Broken Access Control in MCP: Cross-Tenant Takeover and The Surface Behind It

A multi-tenant MCP gateway trusted a caller-supplied user_id, turning mass assignment into a full cross-account takeover. We walk the chain, then run a passive survey of 234 public MCP servers to map how often the structural preconditions for BOLA appear across the ecosystem.

mcp cross tenant takeover

On Thursday evening while most were trying the new GTA VI, we decided to lock in and go hunting for vulnerabilities in an MCP gateway. What we found got us thinking about the one vulnerability that does not pop a shell on camera but hands an attacker access to someone else's objects. We found it in the kind of gateway that fronts many users' private tool endpoints behind one URL and forwards each user's upstream credentials. One could say the sacrifice was worth it.

The thing is, everyone auditing MCP servers (us included) wants to talk about command injection and RCE. But could the silent heavyweights of API security be making a comeback in MCP? The bugs that hand a stranger someone else's data with little-to-no detectable exploit signature, that are, BOLA: Broken Object Level Authorization, as well as mass assignment. BOLA has held its throne at #1 on the OWASP API Security Top 10 for years.

In one of our earlier pieces we showed how an MCP tools/list response could expose a big chunk of an MCP's capability (and risk) surface without calling a single tool (full data and methodology here). In this article, we'll examine how a cross-tenant compromise demonstrates what can happen when an MCP gateway trusts caller-controlled identity. Then through a passive survey, we study how frequently the structural conditions that warrant investigating similar authorisation failures appear across the MCP ecosystem. We'll briefly discuss the threat model that makes MCP a fun target, real-world incidents, as well as some pro tips on how to stay ahead of these risks in your own systems.

BOLA in 30 seconds

A tool takes a parameter that names an object like listing_id, run_id, agent_id, owner_key. The server does the lookup, but BOLA is when the server fetches the object the id points at but never checks that this caller is allowed to touch that object. Change the id, get someone else's thing.

For a normal REST API, that is already pretty bad. For MCP it gets worse, because the caller in MCP is often an LLM agent acting on your behalf, frequently behind a proxy or aggregator that forwards credentials. So the question "who is actually asking for this object?" is blurry before anyone does anything wrong.

Where MCP authorization goes to disappear

To understand BOLA in MCP deeper, let's take a step back and ask, in the context of an MCP server, where does identity come from?

Server-derived identity. The server figures out who you are from an authenticated credential (a verified token, a session bound to an account) and scopes every object lookup to that identity. This is the generally correct pattern. Object ids become harmless because the fence is drawn server-side.

Client-asserted identity. The server takes your word for who you are, because identity arrives as a tool parameter or a request field you supply: owner_key, client_id, user_id, a client-chosen session-id. This is the trust-me-bro authorization model, and it is the sharp end of BOLA. You are declaring which tenant you are on your way to it. The user_id field above is exactly this, identity reduced to a field you get to fill in.

That identity model is what decides everything. A tool taking listing_id can be fine if the server already knows you own only listings 1 through 9. A tool taking owner_key as an input is announcing in the schema that it will scope data to whatever key you hand it.

What the data actually says

Across the 234 endpoints, 1,191 of 3,253 tools (36.6%) take at least one object-addressing parameter, and 174 of 234 servers (74.4%) expose at least one such tool. Median object-addressing tools per exposed server is 5 and the max is 127.

The raw count is not the most interesting part though. We found that the parameter names split cleanly into two populations:

Public-catalog identifiers. slug (197 tools), listing_slug (109). These address things meant to be addressable by anyone.

Tenant-scoped and caller-asserted identifiers. owner_key (112), client_id (14), database_id (13). These are the sharp precondition, the same class as the user_id field we abused.

Among some of the miscellaneous ones we have: agent_id (252) and run_id (161) which top the frequency chart, so agent-orchestration surfaces are dense with object references. And database_id (13) and r2path (17) double as backend leakage, naming storage internals right in the parameter list. Free infrastructure recon stapled to your authorization bug.

We need to also note the clustering forces: owner_key, contact_uri, and agent_name each appear on exactly 112 tools. Identical counts across unrelated names may not be coincidence. That could be like a handful of large, templated platforms contributing many tools apiece, not 112 independent design decisions. One misconfigured multi-tenant template could theoretically mint hundreds of BOLA-shaped tools in a single deploy. But this could be a story for another day…

If you build this stuff

Derive identity server-side. Never accept a scoping identifier (owner_key, client_id, user_id, session id) as a caller-supplied tool parameter or an unbound header. Bind every session to an authenticated tenant and to the endpoint.

Scope every object lookup to the authenticated principal, not to the id in the request.

Don't leak ids. Health, debug, and status routes that enumerate sessions or namespaces are recon gifts.

Treat the tool list as documentation an adversary reads first, and don't name your database in a parameter while you are at it. And treat a server definition as hostile input the instant one principal can write it and another can execute it.

The limitations

Surface is not vulnerability. The census was fully passive: no tool was invoked and no authorization check was tested there. A tool taking file_id is a BOLA precondition, but not a confirmed BOLA (yet ;). A readable, unauthenticated tool list also does not mean the tool executes without auth; that would need invocation, which we never did in this passive scan. Because schemas are only capturable where the list was readable, "object-addressing" and "object-addressing and unauthenticated" nearly coincide by construction.

What we do map is the shape of the risk at scale. Confirming any single bug is a separate, hands-on, in-scope job we'll spend more of our evenings on (sorry, GTA!). The shape is still enough to triage, though. Before you touch a thing, sort tools into public-catalog, tenant-scoped, and client-asserted-identity, and spend your effort on that last bucket. The schema already told you where to look.

References

For every application you run

Find what's deployed and prove which exploits are real.

Go to apisec.ai