Summary
Capgo contains an authorization bypass in the app-scoped role binding creation endpoint that fails to verify ownership of the target app_id.
An attacker with admin rights in one organization can create role bindings for applications owned by other organizations, potentially gaining unauthorized read and write access to victim apps.
Affected context
This vulnerability appears in Capgo's multi-tenant access control logic for the POST /private/role_bindings endpoint.
It occurs when app-scoped role bindings can be created without confirming that the requesting administrator's organization actually owns the specified app_id.
Environments where multiple organizations share the same Capgo deployment and rely on strict tenant isolation are most at risk.
Exploit preconditions
- Attack surface: Capgo backend API, specifically POST /private/role_bindings
- Required access: Administrative permissions within any organization on the Capgo instance
- Trigger point: Submission of a role binding creation request referencing an app_id belonging to another organization
- Why exploitation is possible: The authorization check verifies administrative status but does not enforce app ownership, allowing cross-tenant role binding creation.
Why this happens
The root cause is incomplete authorization logic consistent with CWE-639: Insecure Direct Object Reference (IDOR) in access control.
The backend trusts a client-supplied app_id and validates that the caller is an organization administrator, but fails to confirm that the app_id is owned by that administrator's organization.
This missing ownership constraint breaks tenant isolation and allows cross-tenant role assignments, which is a common pattern when object-level access control does not bind resource identifiers to their rightful owner context.
Potential impact
- An attacker may gain unauthorized read access to application configuration or data in other organizations.
- An attacker may modify victim applications, including roles, settings, or deployment parameters.
- The attacker could escalate privileges within another tenant by assigning themselves or others elevated roles on victim apps.
- Tenant isolation can be compromised, leading to broader organizational data exposure.
General mitigation guidance
Effective mitigation centers on enforcing strict object-level authorization tied to tenant ownership.
Common defensive patterns include:
- Validating that any app_id used in role binding operations is owned by the caller's organization before processing the request.
- Implementing centralized authorization checks that combine identity, role, and resource ownership rather than scattering checks across endpoints.
- Designing APIs to derive resource scope from authenticated context (e.g., organization or tenant ID) instead of trusting client-supplied identifiers.
- Applying least-privilege principles to administrative roles so cross-tenant operations are not possible even under misconfiguration.
How teams detect issues like this
Detection typically relies on reviewing authorization logic and monitoring role binding activity:
- Static analysis or architectural reviews focusing on endpoints that accept resource identifiers (such as app_id) and verifying they enforce ownership checks.
- Code review patterns that flag any use of client-supplied IDs in authorization decisions without contextual tenant validation.
- Access control policy audits to ensure multi-tenant boundaries are enforced consistently across all role management APIs.
- Runtime monitoring for anomalous role bindings, such as administrators assigning roles to apps outside their organization, with alerts or periodic reports.

