SAASMENT

Security skill · Find and fix

MCP OAuth authorization review.

Review an MCP server's OAuth and dynamic client registration flow for one-click account-takeover risks—redirect URI matching and registration-time validation, consent that names the registered client and redirect host and is not silently reused across clients, PKCE, state, token audience binding, no token passthrough, scoping, and revocation—then harden gaps. Use when building, auditing, or approving an MCP authorization server or OAuth-protected MCP HTTP transport.

Download .zipInstall via MCPFind and fixMIT
  • Code review
  • Misconfiguration
  • AI security

Facts

Category
Find and fix
License
MIT
Tags
  • Code review
  • Misconfiguration
  • AI security
Version
1.0.0
Last updated
2026-12-04
Folder
mcp-oauth-authorization-review/
MCP resource
skill://mcp-oauth-authorization-review/SKILL.md
Files
  • SKILL.md
  • LICENSE
  • references/oauth-dcr-checklist.md
Standards

Original Saasment content. This skill does not require joining it.

Optional: register for security alerts (confirmation required).

Install via MCP or as files

Connect your client to https://www.saasment.com/api/mcp (see client setup) and call get_skill:

{
  "name": "get_skill",
  "arguments": {
    "slug": "mcp-oauth-authorization-review"
  }
}

Or download the .zip and unpack it into your agent's skills directory:

Terminal, from your project root (user-level: ~/.cursor/skills)

mkdir -p .cursor/skills
curl -fsSL https://www.saasment.com/ai-security/skills/mcp-oauth-authorization-review/download.zip -o /tmp/mcp-oauth-authorization-review.zip
unzip -o /tmp/mcp-oauth-authorization-review.zip -d .cursor/skills
# result: .cursor/skills/mcp-oauth-authorization-review/SKILL.md

Review SKILL.md before enabling a skill. Skills are instructions your agent will follow.

SKILL.md

---
name: mcp-oauth-authorization-review
description: Review an MCP server's OAuth and dynamic client registration flow for one-click account-takeover risks—redirect URI matching and registration-time validation, consent that names the registered client and redirect host and is not silently reused across clients, PKCE, state, token audience binding, no token passthrough, scoping, and revocation—then harden gaps. Use when building, auditing, or approving an MCP authorization server or OAuth-protected MCP HTTP transport.
license: MIT
metadata:
  author: Saasment
  version: "1.0.0"
  category: both
  tags: "code-review, misconfiguration, ai-security"
---

# MCP OAuth authorization review (find and fix)

License: MIT. Copyright (c) 2026 Saasment. Source: https://www.saasment.com/ai-security/skills/mcp-oauth-authorization-review

HTTP MCP servers often sit behind OAuth so an agent can act as a signed-in user. Dynamic client registration (DCR) and related self-asserted client metadata let any party obtain a `client_id` and a `redirect_uri` without prior vetting. If redirect URIs are weakly validated, or consent is missing, forgeable, or reused across clients, a victim who clicks one crafted link can hand the attacker an authorization code and then an access token for that MCP. This skill reviews the registration, authorization, token, and consent path for those one-click account-takeover patterns. For tool, transport, and supply-chain review of the server itself, use `mcp-server-security-review`. For general login and session review, use `auth-session-review`.

## When to use

- You build or operate an MCP server that uses OAuth (authorization code + PKCE) for HTTP transport.
- You enable Dynamic Client Registration, Client ID Metadata Documents, or any open registration path for MCP clients.
- You are responding to findings about MCP OAuth account takeover, weak redirect checks, or consent bypass.
- You map the setup to OWASP LLM Top 10 2026 LLM03 (Excessive Agency) and web A01 / A07, or to agentic identity abuse (ASI03).

## Safe by default

- Only review and test authorization servers and MCP deployments you own or are authorized to assess. Use dedicated test accounts; never phish or click-test real users.
- Do not register attacker-controlled clients against production identity providers as a "proof." Reproduce redirect and consent checks in a staging tenant with synthetic users.
- Do not print full authorization codes, access tokens, refresh tokens, or client secrets in notes. Redact to a few characters.
- Prefer reading registration and consent code and configuration over live exploitation. Stop as soon as a control fails in a safe test environment.

## Procedure

1. **Map the authorization surface.** Record which registration approach is in use (pre-registration, Client ID Metadata Documents, DCR), the authorization, token, revocation, and registration endpoints, who can call them, and which MCP resource/audience the tokens are meant for. Note whether the MCP server is the resource server, a proxy to a third-party API, or both. Use `references/oauth-dcr-checklist.md`.
2. **Review client registration.** Confirm open DCR (if enabled) does not accept arbitrary public redirect hosts. At registration time, allow only HTTPS or loopback redirects, parse URIs with a real URL parser, and reject look-alike hosts that merely contain a trusted name as a substring. Prefer Client ID Metadata Documents or pre-registration when the client is known. Treat registration metadata (name, logo, redirect) as attacker-controlled until proven otherwise.
3. **Enforce exact redirect URI matching.** On every authorization request, require a `redirect_uri` that exactly matches a value registered for that `client_id` (MCP authorization guidance requires exact match). Re-check the same URI at the token endpoint when exchanging the code. Reject open redirects, partial-string matches, and scheme or port confusion.
4. **Make consent client-specific and visible.** For each new `client_id`, show a consent screen that names the application and the host of its redirect URI, and bind the approval to that client, redirect, and scope set. Do not silently reuse consent granted to a different client or redirect. Protect the consent POST against CSRF (anti-CSRF token or equivalent, `state`, SameSite session cookies, no framing). A missing or forgeable consent step turns DCR into one-click takeover for an already-logged-in victim.
5. **Require PKCE and `state`.** Clients must use PKCE (`S256` when capable) and verify the authorization server advertises `code_challenge_methods_supported` before starting the flow. Clients must send and verify `state`. Remember: PKCE alone does not stop an attacker who registered their own client and started the flow; it complements redirect and consent controls.
6. **Bind and scope tokens.** Issue short-lived access tokens with least-privilege scopes. Bind tokens to the MCP resource (RFC 8707 resource indicator / audience) and have the MCP server reject tokens issued for other audiences. Do not pass client tokens through to upstream APIs (confused deputy). Support revocation and refresh-token rotation; end sessions when the user revokes the client.
7. **Harder proxy and deputy cases.** If the MCP server forwards to a third-party OAuth API with a static client id, obtain fresh user consent for each dynamically registered downstream client before forwarding. Display extra warnings for localhost-only redirects.
8. **Fix and re-test.** Close gaps in registration policy, redirect matching, consent binding, CSRF protection, audience checks, and revocation, then run the Verification steps in staging.

## Verification

- Register two test clients with different redirect hosts; approve the first; confirm the second still shows a consent screen that names its own client and redirect host (no silent reuse).
- Attempt an authorization request whose `redirect_uri` is a substring or look-alike of an allowlisted host and confirm rejection at registration and/or authorization time.
- Submit the consent decision as a cross-site POST without a valid anti-CSRF/`state` binding and confirm the server refuses to issue a code.
- Exchange a code with the wrong PKCE verifier, wrong `redirect_uri`, or a token meant for a different audience, and confirm each fails.
- Call an MCP tool with a revoked or expired token and confirm denial; confirm logs record client id and outcome without storing full secrets.

## Reporting

Table: control area (registration, redirect, consent, PKCE/state, audience, passthrough, revocation), finding, impact, fix, test. Include the registration mode in use and whether open DCR remains enabled after the review.

## References

- MCP Authorization specification (registration, redirect URI validation, PKCE, token audience): https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization
- Salt Labs — Registered Is Not Trusted: One-Click Account Takeovers Through MCP OAuth (1 Dec 2026): https://salt.security/blog/registered-is-not-trusted-one-click-account-takeovers-through-mcp-oauth
- OAuth 2.0 Dynamic Client Registration Protocol (RFC 7591): https://datatracker.ietf.org/doc/html/rfc7591
- OAuth 2.0 Resource Indicators (RFC 8707): https://datatracker.ietf.org/doc/html/rfc8707
- CWE-601 (URL Redirection to Untrusted Site): https://cwe.mitre.org/data/definitions/601.html
- CWE-352 (Cross-Site Request Forgery): https://cwe.mitre.org/data/definitions/352.html
- CWE-863 (Incorrect Authorization): https://cwe.mitre.org/data/definitions/863.html
- OWASP Top 10 for LLM Applications 2026: https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/
- OWASP Top 10 for Agentic Applications 2026 (ASI03 Identity and Privilege Abuse): https://genai.owasp.org/top-10-for-agentic-applications-2026/
- Companion skills: `mcp-server-security-review`, `auth-session-review`, `agent-tool-permission-review`, `authz-idor-review`.

Helper files

LICENSE
MIT License

Copyright (c) 2026 Saasment

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
references/oauth-dcr-checklist.md
# MCP OAuth / DCR review checklist

License: MIT. Copyright (c) 2026 Saasment.

## Authorization profile

- MCP server / resource audience:
- Authorization server (same process, shared IdP, or third party):
- Registration mode (pre-registration / Client ID Metadata Documents / DCR):
- Who may call `registration_endpoint`:
- Grant type (authorization code + PKCE expected):
- Token lifetimes and scopes issued for MCP:

## Registration and redirect URIs

- [ ] Open DCR is off, or restricted to HTTPS / loopback redirects with an explicit host policy
- [ ] Registration-time validation uses a real URL parser (not substring or "contains trusted name" checks)
- [ ] Authorization requests require exact `redirect_uri` match for that `client_id` (CWE-601)
- [ ] Token endpoint re-validates the same `redirect_uri` used to obtain the code
- [ ] Client-supplied name, logo, and metadata are not trusted as proof of identity

## Consent

- [ ] Every new `client_id` gets an explicit consent screen
- [ ] Screen shows application name and redirect URI hostname
- [ ] Approval is stored against that client_id + redirect + scopes (no silent reuse across clients)
- [ ] Consent submission is CSRF-protected (`state`, anti-CSRF token, SameSite cookies, no framing) (CWE-352)
- [ ] Already-logged-in users still see consent for a new or changed client

## PKCE, state, and tokens

- [ ] Clients require PKCE `S256` when capable and refuse AS metadata without `code_challenge_methods_supported`
- [ ] Clients send and verify `state`
- [ ] Access tokens are short-lived and least-privilege scoped
- [ ] MCP resource server validates audience / resource binding (RFC 8707); rejects foreign tokens (CWE-863)
- [ ] No token passthrough to upstream APIs (confused deputy)
- [ ] Refresh tokens rotate; revocation ends MCP access promptly

## Proxy / deputy cases

- [ ] Static upstream client ids still collect per-downstream-client user consent before forwarding
- [ ] Localhost-only redirects show additional warnings

## Staging tests (authorized environments only)

| Test | Expected |
| --- | --- |
| Second client after approving the first | Fresh consent naming the second client and host |
| Look-alike or substring redirect | Rejected |
| Cross-site consent POST without CSRF binding | No authorization code |
| Wrong PKCE verifier / wrong audience | Token or tool call denied |
| Revoked token | Tool call denied |

## Decision

- [ ] Approve
- [ ] Approve with controls (list):
- [ ] Reject (reason):
- Re-review date or trigger (new AS, new redirect policy, DCR toggled):

Related

Companion skills

Related library entries

Questions

How do I install the MCP OAuth authorization review skill?

Download https://www.saasment.com/ai-security/skills/mcp-oauth-authorization-review/download.zip and unzip it into your agent's skills directory (for example .cursor/skills, .claude/skills, .agents/skills, or .github/skills) so that mcp-oauth-authorization-review/SKILL.md exists. Or connect to https://www.saasment.com/api/mcp and call the get_skill tool with the slug mcp-oauth-authorization-review.

What license is the MCP OAuth authorization review skill under?

It is original Saasment content under the MIT license, stated in the SKILL.md frontmatter and in the LICENSE file in the skill folder.

Is it safe to run this skill?

A skill is a set of instructions your agent follows, so read SKILL.md first. It tells the agent to test only systems you own or are authorized to test, to use test environments and synthetic data, and to avoid destructive probes. Downloading it does not run any code on your machine.

Next step.

Saasment is an AI security platform that tests a risk and closes it. Connections, live tests, and automated fixes are available now.

← Saasment Security MCP · all skills

See the demo.

Open the demo workspace with sample data. No login. Register from the banner when you want to get started. No security team. No call.

See the demo