ペンリジェント・ヘッダー

MCP Security Testing: Authorization, Tool Permissions and Data Exfiltration

Buyer evaluation framework for mcp security testing covering scope, evidence and retesting.

MCP security testing should verify every delegation boundary between the user, AI client, MCP server, authorization service, tool and downstream system. A server can implement the protocol correctly and still expose excessive tools, accept over-broad tokens or let untrusted content influence privileged actions.

Map the trust chain

BoundaryFailure to testRequired evidence
User to clientThe client misrepresents which action will occurUser intent, displayed approval and exact tool request
Client to serverA token or session is accepted for the wrong audienceIssuer, audience, scopes and server decision
Server to toolThe server exposes a tool beyond the authorized taskTool allowlist, arguments and policy result
Tool to downstream APIThe tool trusts model-supplied object identifiersPrincipal, resource ownership and downstream authorization
Content to modelDocuments or tool output inject instructionsContent provenance and resulting plan change
Run to audit trailInvestigators cannot reconstruct delegated actionsCorrelated identities, approvals, calls and results
Test each MCP delegation boundary. CLIENT + USER: Connect the actual user intent to a specific authorized operation.. HTTP AUTHORIZATION: Validate resource, audience, scope and token handling.. TOOL + DOWNSTREAM: Enforce ownership and action permissions outside the model.. LOCAL TRANSPORT: Review process identity, environment and inherited credentials.
Conceptual scope and evidence model for the assessment described above.

を使用する。 MCP specification and its authorization guidance as protocol references, then test the actual deployment. Product-specific proxies, local transports, identity brokers and tool wrappers can create security behavior outside the core specification.

The linked authorization specification addresses HTTP-based transports; it does not prescribe the same OAuth flow for STDIO. For a local STDIO server, assess process identity, inherited environment credentials and the caller’s operating-system permissions. Bind every test to the transport and specification version actually deployed.

Audit MCP server provenance before security testing begins

An MCP test inventory should record more than server names, tools and permissions. It should also establish where each server came from, whether the suggested package is still maintained, and whether an official successor has replaced it.

Glow Labs used the name MCPhantom for a failure mode described on a page displaying November 2 and November 3, 2026 dates. In the sessions the researchers reviewed, AI coding agents recommended or installed deprecated or no-longer-maintained MCP servers, with the historical GitHub MCP server used as a central example. The result should not be generalized to every agent, model or prompt: recommendations can change with product versions, network access, registry integration and date. The durable lesson is that an AI-generated installation command is not proof of current stewardship.

Add source and lifecycle fields to the inventory

Inventory fieldWhat to verifyEvidence to retain
Package identityThe package name, repository, publisher and project website refer to the same implementation.Exact names, URLs, publisher and review date
Recommendation sourceThe server came from current vendor documentation, the official MCP Registry, a package page, a search result or untraceable model memory.Original agent output, cited source, product or model context and timestamp
LifecycleThe package is active, deprecated, archived or apparently unmaintained; any official successor has been identified.Deprecation notice, archive status, release history and migration link
Version provenanceThe reviewed server is pinned to a reproducible release or commit rather than a mutable branch or unbounded install.Version, commit, lockfile and integrity data
Effective authorityThe server’s token scopes, file access, network destinations and subprocess capabilities match the stated task.Approved scopes, launch configuration, egress policy and tool schema
Approval and expiryA named owner accepted the dependency and knows when lifecycle and permissions must be reviewed again.Owner, decision, exception if any, and next review date

Keep the terms precise. Deprecated means a maintainer or registry recommends migration. Archived means the repository is read-only. Unmaintained describes an absence of credible maintenance signals. None of those states alone proves that a package is malicious, but each changes the risk and ownership decision.

Verify an AI-recommended server before connection

  1. Capture the untouched recommendation. Save the package, repository, version, command, prompt context and date before correcting it.
  2. Resolve authoritative identity. Cross-check current vendor documentation, the official MCP Registry, the package registry and repository ownership.
  3. Check deprecation and successor notices. Start from the successor’s current documentation instead of adapting a historical command by guesswork.
  4. Pin the review target. Use an inspectable release or commit, retain the lockfile and record integrity information supported by the ecosystem.
  5. Review behavior before credentials. Inspect the launch command, tools and schemas, file boundaries, network destinations, environment variables and subprocess behavior.
  6. Test in isolation. Use synthetic data, a restricted working directory, controlled egress and revocable credentials rather than production secrets.
  7. Record approval and retest triggers. Recheck the server when its publisher, lifecycle, version, tool schema or requested permissions change.

The old GitHub MCP server demonstrates the migration issue. Documentation in the archived Model Context Protocol servers repository states that @modelcontextprotocol/server-github moved to GitHub’s official github/github-mcp-server repository. That is a trustworthy successor signal, but the replacement still requires a new review of installation, toolsets, authentication and GitHub permissions. Do not copy long-lived personal access tokens into committed or shareable configuration.

Provenance review complements the runtime tests in this guide. A maintained official server can still be overprivileged or deployed incorrectly. Continue to enforce MCP’s prohibition on token passthrough, use least-privilege scopes, protect against confused-deputy conditions, and give users visibility and meaningful confirmation for sensitive tool calls.

For the complete source-and-lifecycle decision matrix, see MCPhantom and deprecated MCP servers.

Authorization tests

  • Use a token issued for another resource or audience and confirm rejection.
  • Remove a required scope and verify that discovery and execution are both constrained.
  • Change the user or tenant while reusing client state and confirm isolation.
  • Revoke authorization and verify that cached sessions and long-running tasks stop.
  • Test redirect and callback handling with pre-registered safe values.
  • Confirm that the server does not forward a client token to an unrelated downstream service.

Authorization should be evaluated at the resource server and again at the downstream object or action. Tool names and natural-language descriptions are not access controls.

Tool permission tests

Tool classリスクAcceptance condition
Read-only searchCross-tenant or overly broad retrievalResults are filtered by trusted identity and policy
File accessPath traversal, secret access or unintended workspace scopeResolved paths remain inside explicit roots
Command executionArgument injection or privilege inheritanceAllowlisted operations run in isolated, least-privilege contexts
Messaging and ticketsUnapproved external side effectsThe exact recipient and content require visible approval
Cloud administrationBroad credentials turn planning mistakes into infrastructure changesShort-lived task-bound permissions and independent policy checks
Database actionModel-provided identifiers bypass row or tenant controlsQueries are parameterized and authorization is data-aware

Prompt injection and confused-deputy testing

Place synthetic instructions in documents, issue descriptions, web pages and tool output. Observe whether the client changes its plan, requests new tools or attempts to disclose data. The important result is not that the model repeated the text; it is whether an unauthorized resource or action became reachable.

について OWASP LLM Top 10 provides relevant risk categories, but each MCP finding should identify the concrete authority that was misused.

Secrets and local-server risks

Inspect environment variables, configuration files, logs, crash reports, command history and child processes. Confirm that a local MCP server cannot silently inherit unrelated developer credentials. Separate tools into dedicated workers when their permissions differ materially.

Test install and update provenance for servers and dependencies. A convenient one-line installation can introduce a supply-chain and credential boundary that deserves the same review as any other privileged developer tool.

Approval and stop behavior

For state-changing actions, the approval should show the exact operation, target, identity and material arguments. A generic approval to “continue” should not authorize a later email, cloud change or command. Cancel an active run and verify that queued tool calls, subprocesses and callbacks terminate.

Logging requirements

  • human user and client identity;
  • MCP server and tool version;
  • authorization issuer, audience and effective scopes;
  • tool name, normalized arguments and approval event;
  • downstream principal, resource and result;
  • redacted error and policy decisions;
  • cancellation, timeout and retry behavior.

Engagement acceptance test

Build a synthetic MCP environment with two tenants, a read tool, a state-changing tool and a decoy secret. Seed one excessive-permission condition and one indirect prompt injection. The tester should find the real authorization path, avoid accessing unrelated data, preserve an auditable chain and demonstrate a safe remediation retest.

Keep one auditable MCP action record. PRINCIPAL: Human, client, server and downstream identity.. AUTHORIZATION: Transport, resource, effective scopes and policy decision.. ACTION: Tool name, normalized arguments and required approval.. OUTCOME: Observable effect, cancellation status and safe retest.
Defensive acceptance model; validate the stated security property on the corrected deployment.

Make the purchase measurable

MCP is an integration layer, so its security cannot be assessed by protocol parsing alone. Test delegated identity, resource authorization, tool permissions, content provenance, approvals and downstream effects as one chain. AI security teams can apply the same evidence model when evaluating Penligent or another testing provider.

The following Penligent overview introduces a general authorized testing workflow. It does not demonstrate that every assessment capability discussed in this guide is included in a particular product plan.

MCP security audit: separate authentication from operation permission

A useful MCP security audit records four distinct boundaries: where the server package came from, how the client authenticates, which tool operations the subject may execute, and which downstream objects those operations may access. Passing one boundary does not establish the others.

BoundaryRequired checkClosure evidence
Server provenanceMatch the running server to the reviewed publisher and revisionPackage or image identity, source and update record
Remote HTTP authorizationReject a staging credential for the wrong resource or issuerValidation category and no protected execution
Tool permissionsA read-only subject attempts a controlled writeServer-side denial and unchanged fixture
Object permissionUse the same tool against allowed and forbidden test objectsSubject, object owner and policy result
Local stdio executionInspect effective process, filesystem and credential accessHost capability contract and observed limits

について MCP security guidance treats token passthrough, confused deputy behavior, local server compromise and scope minimization as separate problems. A single successful OAuth login cannot close that list. Nor does hiding a tool from discovery replace execution-time authorization.

For the protocol-specific cases, use the dedicated MCP OAuth security testing guide. It defines audience, scope, delegation, redirect and lifecycle checks without duplicating this article’s broader inventory. Record whether revocation means refresh-token removal, access-token invalidation or application permission withdrawal; test the deployment’s actual propagation contract.

Require an allowed baseline before every rejection claim. If a staging write fails because the downstream service is offline, the result is inconclusive. If the operation occurred before an error response, it is a failed boundary. Retain request IDs and token metadata, with raw bearer tokens excluded from the evidence packet.

記事を共有する
関連記事
jaJapanese