/

CVE-2026-56216

Severity:

HIGH RISK

(8.8)

Authorization Scope Escalation (CWE-269) in Capgo API

CVE-2026-56216

Deferred

Vulnerability type

Category:

Authorization Bypass / Privilege Escalation

CWE:

CWE-269

Impact:

Privilege Escalation to Organization-Wide 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 contains an authorization scope escalation issue in the POST /functions/v1/apikey endpoint that lets app-limited API keys mint new keys without effective restrictions.

If an attacker compromises an app-limited key, they can generate an unrestricted API key with organization-wide access to app listings and other protected resources.

Affected context

The vulnerability appears in Capgo deployments where API keys are used to control access to organizational resources via the POST /functions/v1/apikey endpoint.

It manifests when the backend accepts app-limited keys as sufficient authority to create new keys and fails to enforce or validate scope limits when those limits are omitted or left empty.

Environments that rely on app-limited API keys for isolation between applications and broader organization data are particularly exposed.

Exploit preconditions

  • Attack surface: Capgo HTTP API, specifically the POST /functions/v1/apikey endpoint.
  • Required access: Possession of a valid app-limited API key (e.g., obtained via credential leakage, theft, or misuse).
  • Trigger point: Submitting a key-creation request where limits are empty or otherwise unset, causing the backend to generate an effectively unrestricted key.
  • Why exploitation is possible: The authorization and scoping logic does not correctly constrain what an app-limited key is allowed to create, and it treats empty limits as full access instead of enforcing a minimum or inherited restriction.

Why this happens

This issue stems from flawed authorization logic that fails to maintain consistent privilege boundaries between API key types.

The backend treats an app-limited key as authorized to mint new keys and does not enforce or validate that the resulting key's scope is equal to or narrower than the caller's scope.

In particular, the system interprets empty limit fields as no limitation, effectively granting broad or org-wide access, which maps to CWE-269: Improper Privilege Management.

Conceptually, this is a broken hierarchy of privileges: subordinate credentials can create superior credentials without additional checks or explicit elevation controls.

Potential impact

  • An attacker with an app-limited key could mint an unrestricted API key.
  • Organization-wide access to app listings and other protected endpoints could be obtained.
  • Data from multiple applications under the same organization could be read or modified.
  • Security boundaries between apps within the same organization could be undermined.
  • Further lateral movement within the platform, including abuse of management or administrative APIs, could be enabled.

General mitigation guidance

Effective mitigation generally focuses on enforcing strict privilege boundaries and safe defaults:

  • Ensure that any key-creation operation is either restricted to highly privileged principals or disallowed for low-privilege keys entirely.
  • Enforce that newly created keys cannot have broader scopes than the creating principal; scope should be equal or strictly reduced.
  • Treat missing, null, or empty limit fields as invalid input rather than full access, requiring explicit, validated scopes.
  • Centralize authorization decisions for sensitive endpoints so that scope inheritance and reduction rules are consistently applied.
  • Apply least-privilege design to API keys, separating keys used for application runtime from keys permitted to perform management actions like key minting.

How teams detect issues like this

Detection can combine code-level review and behavioral monitoring:

  • Static analysis / code review: Look for endpoints that allow creation or modification of API keys, tokens, or roles and verify that they:
  • Check the caller's scope against the requested new key scope.
  • Reject empty or missing limit fields rather than treating them as unrestricted.
  • Use centralized authorization utilities instead of ad hoc checks.
  • Policy enforcement: Implement service-level policies that prohibit low-privilege keys from calling key-management endpoints, enforced via middleware or API gateways.
  • Runtime monitoring: Log and alert on unusual key-creation patterns, such as app-limited keys invoking key-minting endpoints or creation of keys with unexpectedly broad scopes.
  • Automated security review tools and linters can help flag routes with key lifecycle operations that lack explicit privilege checks or scope comparisons.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-2ff8-7h96-hwfp
vulncheck.comvulncheck.com/advisories/capgo-scope-escalation-via-api-key-creation-in-functions-v1-apikey

Frequently asked

questions

Exploitability is limited to situations where an attacker already possesses an app-limited API key, but in multi-tenant or multi-app environments that use such keys widely, this can significantly expand practical attack surface.

The attacker must have a valid app-limited API key that can call the POST /functions/v1/apikey endpoint; no direct access to administrative credentials is required if the endpoint does not enforce stronger checks.

Restrict key-minting operations to highly privileged or explicitly administrative principals, and enforce that any new key's scope is equal to or narrower than the creating principal's scope, rejecting empty or ambiguous limit definitions.

Design a centralized authorization model with explicit scope hierarchies, apply least privilege by default, treat omitted limits as invalid, and include systematic tests and security reviews around any endpoint that creates, updates, or manages credentials and API keys.

Find out what's already
exploitable in your codebase.