Summary
Casdoor contains an authorization bypass in the /api/mcp endpoint that can let a user with valid client credentials from one application access user administration across other organizations. Depending on deployment permissions, an attacker may enumerate sensitive user data, create administrator accounts, alter users, or delete accounts without the required organization-level authorization.
Affected context
The issue affects Casdoor deployments where the /api/mcp endpoint accepts a valid application's clientId and clientSecret but does not correctly enforce organization or resource-level authorization. The risk is greatest when application credentials are exposed to untrusted users, broadly distributed, or permitted to invoke user-management operations beyond their owning application's organization.
Exploit preconditions
- Attack surface: The network-accessible
/api/mcpendpoint - Required access: A valid
clientIdandclientSecretfor any application, or access to credentials that can be used by the attacker - Trigger point: Requests to user-administration operations through the MCP endpoint
- Why exploitation is possible: Authentication of the application credential is not sufficiently matched with organization-level authorization for the requested user-management action
Why this happens
The vulnerability is an authorization enforcement failure mapped to CWE-863: Incorrect Authorization. The endpoint appears to treat valid application authentication as sufficient authority for operations affecting users in other organizations, rather than independently verifying tenant ownership, resource scope, and administrative privileges for each request. This insecure pattern allows an authenticated principal to cross an authorization boundary.
Potential impact
- Attackers may enumerate user records across organizations
- Password salts and email addresses could be exposed
- Unauthorized administrator accounts may be created
- Existing users may be modified or deleted
- Organizations may experience account takeover or administrative lockout
- Sensitive identity data may be used for follow-on attacks
General mitigation guidance
Mitigation generally focuses on enforcing authorization independently of authentication at every user-management operation.
Common defensive patterns include:
- Binding application credentials to an explicit organization and narrowly defined operation scopes
- Performing server-side tenant, resource-ownership, and role checks for every request
- Applying deny-by-default authorization policies for administrative actions
- Avoiding reliance on client-supplied organization identifiers or roles
- Limiting application credential distribution and protecting secrets from end users
- Reducing administrative privileges and separating read, write, create, and delete permissions
- Minimizing sensitive fields returned by user-enumeration APIs
- Logging and reviewing cross-organization access attempts
How teams detect issues like this
Detection can combine static analysis, authorization-focused code review, and runtime monitoring.
Useful approaches include:
- Reviewing endpoint handlers for missing tenant, ownership, role, or scope checks
- Searching for authorization decisions based solely on successful client authentication
- Testing each administrative operation with credentials from a different organization
- Adding policy tests that verify cross-tenant reads and writes are denied by default
- Monitoring audit logs for unusual enumeration, administrator creation, bulk modification, or deletion activity
- Enforcing centralized authorization policies and automated security checks in CI pipelines

