Lab: MCP OAuth account takeover via dynamic client registration
This lab's shop exposes a Model Context Protocol (MCP) server at /mcp, protected by its own OAuth authorization server. Any MCP client can register itself using dynamic client registration. The official desktop app for the shop, "Shop Assistant", is already registered, and the administrator has already approved it.
The administrator will open any link that you send them from the exploit server, while logged in to the shop.
To solve the lab, obtain an access token for the administrator's account and use it to delete the user carlos through the MCP server.
Hints
-
An unauthenticated request to
/mcptells you where to find the server's OAuth metadata. - Two separate flaws are needed. Think about what a newly registered client is allowed to send as its redirect URI, and about how the server decides whether a user has already given consent.
- The authorization server requires PKCE. Because you choose the code verifier, you can still exchange a code that you steal.
Required knowledge
To solve this lab, you'll need to know:
- How MCP servers use OAuth 2.1 for authorization, including dynamic client registration.
- How the OAuth authorization code flow and PKCE work.
- How to deliver an exploit to a victim using the exploit server.
For more information, see our MCP server vulnerabilities Academy topic and our OAuth authentication topic.
Solution
The solution for this lab will be published shortly. Check back soon.