Summary
Coroot's unauthenticated MCP OAuth dynamic client registration endpoint accepts syntactically valid redirect URIs without confirming that they belong to a trusted client. An attacker may register a client using an attacker-controlled host, send crafted authorization links to signed-in users, and capture authorization codes after the users approve access, potentially enabling MCP session hijacking.
Affected context
The issue occurs in Coroot deployments exposing the MCP OAuth dynamic client registration flow. Risk is increased when the registration endpoint is reachable without authentication, redirect URIs are accepted based only on syntax, and signed-in users can be persuaded to approve authorization requests for attacker-registered clients.
Exploit preconditions
- Attack surface: The MCP OAuth dynamic client registration and authorization endpoints
- Required access: Ability to reach the unauthenticated registration endpoint and deliver an authorization URL to a signed-in user
- Trigger point: The user approves an authorization request whose redirect URI targets an attacker-controlled host
- Why exploitation is possible: The server does not adequately bind registered redirect URIs to trusted clients or approved destinations, allowing authorization responses to be sent to an attacker-controlled location
Why this happens
The underlying bug is insufficient validation of OAuth redirect URIs during dynamic client registration. Treating syntactic validity as proof of trust allows an attacker to register a client that redirects authorization responses to an external destination. This behavior maps to CWE-601, which covers unvalidated redirects and forwards, and can also undermine the confidentiality of authorization codes in an OAuth flow.
Potential impact
- An attacker may capture OAuth authorization codes
- Captured codes could be exchanged for access tokens when other OAuth protections do not prevent reuse
- Compromised tokens may enable MCP session hijacking
- Unauthorized parties could access or act through connected MCP resources
- User and service data may be exposed or modified
General mitigation guidance
Mitigation generally focuses on reducing trust in client-supplied redirect
destinations and binding OAuth clients to approved callback locations.
Common defensive patterns include:
- Requiring authentication or administrative authorization for dynamic client registration where appropriate
- Allowing only exact, pre-registered redirect URI matches rather than broad or syntax-only validation
- Restricting callback destinations to trusted origins and approved schemes
- Applying OAuth protections such as PKCE and state validation throughout the authorization flow
- Avoiding authorization-code delivery to unverified external hosts
- Limiting token scopes and service privileges according to least-privilege principles
- Providing clear consent details so users can identify the requesting client and redirect destination
How teams detect issues like this
Detection approaches may include:
- Static analysis and code review checks for redirect URI validation based only on parsing or syntax
- Review of dynamic client registration handlers for missing ownership, origin, or allowlist checks
- Tests that submit external, alternate-host, wildcard, non-HTTPS, and ambiguous redirect destinations
- Monitoring registrations and authorization requests for unusual clients, domains, or redirect targets
- Policy enforcement requiring exact redirect URI registration and authenticated client-management workflows
- Automated application security testing focused on OAuth redirect handling and authorization-code confidentiality

