/

CVE-2026-56230

Severity:

HIGH RISK

(8.8)

Broken Object Auth (CWE-639) in Capgo limited keys

CVE-2026-56230

Deferred

Vulnerability type

Category:

Broken Object Level Authorization

CWE:

CWE-639

Impact:

Cross-tenant Access Control Bypass

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 a broken object level authorization flaw where middlewareKey() trusts a client-controlled header to select limited keys without verifying tenant ownership.

Authenticated users can adopt another tenant's limited key ID via the x-limited-key-id header, bypassing authorization checks and accessing cross-tenant resources across multiple API endpoints.

Affected context

This vulnerability appears in Capgo deployments that rely on middlewareKey() to enforce access control for limited keys.

It is relevant when:

  • API clients can set or override the x-limited-key-id header
  • Limited keys are used to scope access to tenant data or resources
  • Ownership checks between the authenticated user (or tenant) and the provided limited key ID are missing or incomplete

In such contexts, APIs that depend on this middleware for tenant isolation become susceptible to cross-tenant data and resource access.

Exploit preconditions

  • Attack surface: Capgo HTTP APIs that rely on middlewareKey() and accept the x-limited-key-id header
  • Required access: Valid authenticated account on the platform (any tenant)
  • Trigger point: Sending requests with a forged or stolen x-limited-key-id value referencing another tenant's limited key
  • Why exploitation is possible: The middleware trusts the client-provided header and associates the request with the referenced limited key without verifying that it belongs to the authenticated user or tenant, causing broken object-level authorization.

Why this happens

The root cause is a missing ownership and authorization check for object references provided by the client.

middlewareKey() directly uses the x-limited-key-id header to select a limited key, treating the ID as trusted input.

This maps to CWE-639: Insecure Direct Object Reference (IDOR) / Broken Object Level Authorization, where an application exposes internal identifiers and fails to verify whether the requester is permitted to access the referenced object.

At a pattern level, the code couples authentication to object lookup but omits per-object authorization, allowing any authenticated user to operate on another tenant's scoped key.

Potential impact

  • Authenticated users may access other tenants' data through mis-scoped limited keys
  • Attackers could invoke privileged operations bound to another tenant's limited key
  • Cross-tenant resource exposure and information leakage can occur across affected endpoints
  • Abuse of limited keys could lead to data tampering or unauthorized actions within victim tenants
  • Regulatory or compliance impact due to violation of tenant isolation guarantees

General mitigation guidance

Effective mitigation focuses on enforcing strict object-level authorization and reducing trust in client-supplied identifiers.

Common defensive patterns include:

  • Always verifying that any referenced limited key (or similar object) belongs to the authenticated user or tenant before use
  • Resolving key associations server-side based on authenticated context, rather than accepting arbitrary client-provided IDs
  • Centralizing authorization checks so that all middleware and endpoints consistently validate ownership and permissions for referenced objects
  • Designing APIs to avoid direct exposure of sensitive internal identifiers where possible, or scoping identifiers so they are only meaningful within a tenant context
  • Applying least-privilege principles to limited keys, ensuring they cannot grant broader access than intended even if misused

How teams detect issues like this

Detection usually involves analyzing both code and runtime behavior for missing authorization around object references.

Useful approaches include:

  • Static analysis rules that flag uses of client-controlled IDs (headers, path params, query params) when used directly in object lookups without prior authorization checks
  • Code review practices that require explicit ownership validation whenever limited keys, tenant IDs, or other access-scoping objects are resolved
  • API security testing that attempts cross-tenant access by manipulating headers like x-limited-key-id and other ID-bearing fields
  • Logging and monitoring that correlate limited key usage with tenant context, alerting on anomalies such as keys crossing tenant boundaries
  • Policy-based enforcement in CI/CD pipelines to ensure authorization middleware is consistently applied to all endpoints using scoped keys

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-cppm-733w-hg86
vulncheck.comvulncheck.com/advisories/capgo-broken-object-level-authorization-via-x-limited-key-id-header

Frequently asked

questions

It can be exploited by any authenticated user who can control the x-limited-key-id header on affected endpoints, making it broadly applicable across tenants where keys are guessable, discoverable, or leaked.

The attacker needs a valid account in the system and the ability to send API requests with custom headers; they do not need access to the victim tenant's credentials, only to a limited key ID associated with that tenant.

The safest fix is to enforce strict ownership validation on every use of limited key IDs: the server must confirm that the referenced key belongs to the authenticated user or tenant before applying it, and should prefer server-side resolution of keys over accepting arbitrary IDs from clients.

Prevention relies on designing APIs with robust authorization checks, treating all client-supplied identifiers as untrusted, standardizing an authorization layer for object access, and integrating security-focused code review and automated testing that explicitly validate cross-tenant isolation.

Find out what's already
exploitable in your codebase.