/

CVE-2026-56246

Severity:

HIGH RISK

(8.1)

Broken Access Control (CWE-285) in Capgo Org API

CVE-2026-56246

Deferred

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-285

Impact:

Cross-Organization Account and Resource Compromise

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Capgo's organization management API contains a broken access control flaw where scoped API keys inherit the full permissions of their owning user, ignoring the key's organization restriction.

In scenarios where a user administers multiple organizations, a write-mode key scoped to one organization can still perform destructive operations against other organizations, leading to cross-tenant impact.

Affected context

This vulnerability appears in Capgo deployments that:

  • Use the organization management API with scoped API keys (limited_to_orgs)
  • Allow users to be admins or owners of multiple organizations
  • Rely on route-level RBAC checks that resolve permissions from the key's owning user

The risk is most pronounced in multi-tenant environments where one user holds administrative roles across organizations and delegates access through write-mode API keys.

Exploit preconditions

  • Attack surface: Capgo organization management HTTP API endpoints (e.g., DELETE /organization, DELETE /organization/members).
  • Required access: Possession of a valid write-mode API key that is nominally scoped to at least one organization via limited_to_orgs.
  • Trigger point: Making destructive organization-management requests with the scoped API key against organizations where the owning user has admin rights, even if those orgs are not listed in the key's scope.
  • Why exploitation is possible: The route-level authorization logic (rbac_check_permission_direct) evaluates the privileges of the API key's owner-user and authorizes the request before enforcing (or instead of correctly enforcing) the API key's limited_to_orgs restriction, effectively bypassing the intended scope.

Why this happens

The underlying issue is a misapplied authorization model, aligning with CWE-285: Improper Authorization.

Instead of binding access decisions strictly to the API key's declared scope, the implementation derives effective permissions from the owning user's RBAC profile at the route level.

This mixes two trust contexts—user-level privileges and key-level restrictions—without a clear precedence rule that favors the more restrictive scope.

As a result, scoped API keys become over-privileged whenever their owner has broader cross-organization permissions, enabling actions outside the intended tenant boundary.

Potential impact

  • Destructive actions (e.g., delete organization) can be performed against other organizations where the user is an admin.
  • Unauthorized removal or modification of members in unrelated organizations.
  • Cross-tenant data and configuration loss or corruption across organizations sharing the same admin.
  • Escalation of delegated access, where a narrowly scoped key effectively grants broad administrative capabilities.
  • Erosion of tenant isolation guarantees, reducing trust in multi-organization and multi-tenant setups.

General mitigation guidance

Effective mitigation focuses on enforcing scope-first authorization and strengthening tenant isolation boundaries.

Common defensive patterns include:

  • Evaluating access decisions against the API key's attributes (such as limited_to_orgs and mode) as the primary authority, treating user-level privileges only as an upper bound, never as a way to broaden key scope.
  • Designing authorization middleware that composes constraints in a "least-privilege" way, always intersecting user permissions with key restrictions instead of taking their union.
  • Normalizing organization tenancy checks so that every sensitive route requires an explicit organization context that must be validated against the key's allowed organizations.
  • Avoiding implicit inheritance of privileges between principals (e.g., from user to API key) without a clear, testable policy.
  • Applying defense in depth with additional checks server-side, such as explicit tenant IDs and ownership verification on destructive operations.

How teams detect issues like this

Detection typically combines code-level review and behavioral monitoring:

  • Static analysis and code review: Look for authorization paths where requests authenticated via API keys still consult user RBAC objects directly (e.g., calls to rbac_check_permission_direct that reference the owning user rather than the key's scope).
  • Policy enforcement checks: Encode authorization rules declaratively (e.g., policy-as-code) and verify that organization-scoped keys can only act within their specified tenants.
  • Unit and integration tests: Add negative tests ensuring that a scoped API key cannot perform actions on organizations outside its limited_to_orgs list, even if the owner has broad privileges.
  • Runtime monitoring: Instrument logs with identifiers for both the API key and target organization; alert on patterns where a key acts on organizations not listed in its configured scope.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-ccm4-hf72-p28m
vulncheck.comvulncheck.com/advisories/capgo-cross-organization-authorization-bypass-via-scoped-api-key-privilege-inheritance

Frequently asked

questions

Yes. Any party that can obtain or is legitimately issued a scoped write-mode API key can invoke the affected organization management endpoints over the network, potentially impacting other organizations administered by the same user.

The attacker must have a valid write-mode API key that belongs to a user who is an admin of multiple organizations.

No separate login to the web interface is required once the key is in hand; the vulnerability lies in how the backend authorizes API key calls.

The safest approach is to refactor authorization so that organization-level actions are always constrained by the API key's own scope and mode, with user privileges serving only as a ceiling, not a fallback.

The effective permissions should be the intersection of user rights and key restrictions, and destructive routes should refuse requests when the target organization is not explicitly allowed for that key.

Future prevention relies on designing a clear, testable authorization model where each credential type (user session, API key, service token) has its own principal and policy rules.

Applying defense-in-depth with policy-as-code, systematic negative testing for cross-tenant access, and code review guidelines that flag mixed user/key authorization paths helps avoid repeating this broken access control pattern.

Find out what's already
exploitable in your codebase.