Summary
In multi-tenant mode, an authorization flaw in madong-admin-saas may let an authenticated tenant user access platform management APIs using a tenant login token. Depending on the exposed controllers and deployment controls, this could enable creation of platform administrator accounts, access to tenant database settings, and compromise across tenants.
Affected context
The issue is reported in AccessTokenMiddleware in madong-admin-saas through 5.1.4, when the application runs in multi-tenant mode. It occurs if authorization checks allow tenant-authenticated requests to reach platform management controllers without verifying that the token has the required platform-level privileges.
Exploit preconditions
- Attack surface: Platform management API endpoints, including
/platformapicontrollers - Required access: An authenticated tenant user with a valid tenant login JWT
- Trigger point: A request to a platform management endpoint using the tenant JWT
- Why exploitation is possible: Authorization middleware may fail to enforce the boundary between tenant-level and platform-level permissions
Why this happens
The middleware applies insufficient authorization checks when deciding whether a request may access platform management functionality. This maps to CWE-863: Incorrect Authorization, where a system does not correctly enforce the intended permissions for a user or request. In a multi-tenant application, failing to distinguish tenant credentials from platform-level privileges can expose privileged operations across trust boundaries.
Potential impact
- A tenant user could gain platform-level privileges
- Platform administrator accounts could be created without appropriate authorization
- Tenant database settings could be exposed
- Multiple tenants could be affected if platform-level control is obtained
General mitigation guidance
Defensive patterns focus on enforcing authorization at every privileged API boundary:
- Apply explicit role and permission checks for platform management operations
- Treat tenant and platform identities as separate security principals
- Derive authorization decisions from verified claims and server-side policy, not token presence alone
- Deny access by default when identity scope or required privileges are unclear
- Limit the privileges of platform services and administrative accounts
- Minimize exposure of sensitive tenant configuration data
How teams detect issues like this
- Review middleware and controller code for checks that distinguish tenant roles from platform roles
- Use static analysis and code review to identify endpoints relying only on authentication rather than authorization
- Test authorization policies across tenant and platform identities, including negative access cases
- Monitor logs for tenant identities accessing platform management endpoints or attempting administrative actions
- Enforce API policies that require explicit platform-level permissions for privileged routes

