MCPSafe.io
RegistryThreatsMethodologyDocsPricingScanSign in
MCPSafe.io

Security checks for MCP servers — public packages and private repos, fast or deep.

Legal

Privacy PolicyCookie PolicyTerms of ServiceSecurity disclosure

Resources

State of MCP SecuritySupportSystem statusMade in Germany 🇩🇪

© 2026 MCPSafe. All rights reserved.

GDPR — Privacy Policy
← Threat Catalog

Interaction & Data Flow

Confused deputy attack

HIGHAIVSS 8.0CWE: CWE-441OWASP: LLM06Agentic: T03Rule: MCP-047

The MCP server has more privilege than the end-user, and an attacker persuades the server to use that privilege on their behalf.

What it is

A confused deputy is a process that holds authority it is supposed to exercise only on instructions from a trusted caller, but that cannot tell which caller is which. When the server acts with its own high privileges instead of the user's limited privileges, any bug becomes a privilege-escalation bug.

Why it matters for MCP

MCP servers typically run with a service-account token that has broad access, then pretend to be acting "as the user." They almost never have a way to downscope: the token for the GitHub API can read every repo, and the only thing standing between the model and that access is the tool's own guardrails.

Vulnerable example

example.py
1
GITHUB_TOKEN = os.environ["GH_TOKEN"]  # org-wide admin token
2
3
@server.tool()
4
def list_my_repos() -> list[str]:
5
    # "my" means the token's, not the user's
6
    r = gh.get("/user/repos", token=GITHUB_TOKEN)
7
    return [repo["full_name"] for repo in r]

Secure example

example.py
1
@server.tool()
2
def list_my_repos(ctx: Context) -> list[str]:
3
    user_token = ctx.principal.github_token  # per-user OAuth token
4
    r = gh.get("/user/repos", token=user_token)
5
    return [repo["full_name"] for repo in r]

How MCPSafe detects this

We flag tool handlers that read tokens or credentials from module-level globals or environment variables rather than from the request context. This is a signal, not proof — some servers legitimately need service-account access — so we tag it as evidence to review.

See the full threat catalog for every documented detection.

Framework alignment

OWASP LLM Top-10 (2025)
LLM06 — Excessive Agency
OWASP Agentic AI Top-10
T03 — Privilege Compromise
AIVSS v0.5
8.0 (HIGH)AIVSS:1.0/S:HIGH/AV:N/AU:M/BR:H/CD:I

Further reading

  • CWE-441: Confused Deputy

Scan an MCP server for this issue

MCPSafe runs this check — and every other rule in the catalog — on any MCP server you paste in.

Scan now