/

CVE-2026-88862

Severity:

HIGH RISK

(8.8)

Broken Access Control (CWE-863) in Capgo API Backend

CVE-2026-88862

Deferred

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-863

Impact:

Privilege Escalation and Unauthorized Application Access

Severity:

HIGH RISK

(8.8)

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 backend can incorrectly honor a user-supplied limited-key identifier without verifying that the referenced key is a valid child of the authenticated key. An authenticated API-key user may therefore have a more privileged same-owner key selected as the effective principal, potentially granting access to application operations that the original key cannot perform.

Affected context

The issue occurs in Capgo backend deployments that process the x-limited-key-id header and use API keys as independent RBAC principals. Risk arises when key lookup validates expiration and ownership but does not validate the parent-child delegation relationship or ensure that the requested key is within the authenticated key's authorized scope. The condition is particularly relevant where keys belonging to the same user have different application or organization permissions.

Exploit preconditions

  • Attack surface: Authenticated Capgo API requests processed by the backend key middleware
  • Required access: A valid API key with permission to authenticate requests, such as an apikey_manager key
  • Trigger point: Processing of the attacker-controlled x-limited-key-id header
  • Required condition: The requester must know or obtain the numeric identifier of another key owned by the same user
  • Why exploitation is possible: Key resolution checks the identifier, expiration state, and user ownership but does not establish that the selected key is a delegated child authorized by the authenticating key

Why this happens

The underlying flaw is an incomplete authorization decision in the limited-key substitution flow. checkKeyByIdPg() resolves a requested key using identity and status attributes, while hasLimitedRbacSubkeyScope() accepts broad non-organization RBAC bindings and validateSubkeyUser() only compares owner IDs. Because API keys are separate RBAC principals, same-user ownership does not prove a valid delegation relationship. This maps to CWE-863: Incorrect Authorization, where the system permits an operation without verifying the required relationship and scope between the requester and the selected principal.

Potential impact

  • An authenticated user may gain permissions associated with a more privileged sibling API key
  • The attacker could access application functions outside the original key's authorized scope
  • Administrative or application-management operations may be performed without the corresponding key secret
  • Application data or configuration could be modified, depending on the substituted key's permissions
  • Audit records may attribute actions to the wrong effective API-key principal

General mitigation guidance

Mitigation generally focuses on making delegation explicit and enforcing authorization at every principal-substitution boundary.

Common defensive patterns include:

  • Require the requested key to be an actual child of the authenticating key, rather than merely sharing the same owner
  • Bind delegated keys to an explicit parent identifier and verify that relationship server-side
  • Enforce application, organization, role, and scope containment when resolving a limited key
  • Avoid treating user ownership alone as sufficient authorization for key substitution
  • Preserve the original authenticated principal unless the delegation relationship has been fully validated
  • Apply least privilege to API-key roles and separate administrative credentials from application-scoped credentials
  • Record both the authenticating key and delegated key in security-relevant audit events

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review checks for authorization decisions based only on resource ownership
  • Tests that attempt to substitute sibling, unrelated, expired, and cross-application key identifiers
  • Review of middleware that replaces authenticated principals or effective secrets from request-controlled identifiers
  • Policy checks requiring explicit parent-child and scope-containment validation for delegated credentials
  • Runtime monitoring for API requests where a low-privilege key selects a different principal or unexpectedly invokes administrative operations
  • Automated security review tools that flag user-controlled identifiers used in authorization or principal-switching logic

Sources

SourceLink
github.comgithub.com/Cap-go/capgo.app/security/advisories/GHSA-5hjr-xhx8-x5j7
vulncheck.comvulncheck.com/advisories/capgo-api-key-manager-authentication-bypass-via-x-limited-key-id

Frequently asked

questions

It can be exploitable through authenticated API requests when the attacker can submit the limited-key identifier header and identify a suitable same-owner key. It does not appear to require knowledge of the selected key's secret.

The attacker needs a valid authenticated API key that is accepted by the backend. The original key may have fewer application permissions than the key selected through the flawed delegation logic.

Validate an explicit parent-child delegation relationship before replacing the authenticated principal, and require the delegated key's roles and resource scope to remain within the parent's authority.

Treat every API key as a distinct security principal, test sibling-key and cross-scope substitutions, enforce least privilege, and ensure authorization checks validate relationships and scope rather than ownership alone.

Find out what's already
exploitable in your codebase.