/

CVE-2026-56237

Severity:

CRITICAL RISK

(9.1)

Broken Auth (CWE-287) in Capgo API Key Generation

CVE-2026-56237

Deferred

Vulnerability type

Category:

Broken Authentication

CWE:

CWE-287

Impact:

Unauthorized Access to Protected API Endpoints

Severity:

CRITICAL RISK

(9.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 suffers from a broken authentication issue in its API key generation workflow, where API keys are exposed in frontend requests and not reliably bound to the authenticated user.

By tampering with the API key parameter in generation requests, an attacker can create arbitrary keys and gain unauthorized access to protected backend endpoints.

Affected context

This vulnerability appears in Capgo deployments where API keys are generated via a frontend-accessible flow and passed to the backend without robust validation.

It is most relevant when API keys are used as the primary means of authenticating or authorizing requests to sensitive endpoints, and when clients can directly manipulate request parameters involved in key generation.

Exploit preconditions

  • Attack surface: Public-facing API key generation endpoint exposed to frontend clients
  • Required access: Ability to send or intercept API key generation requests (e.g., via browser, script, or proxy)
  • Trigger point: Submission of a crafted API key parameter during the key generation workflow
  • Why exploitation is possible: The backend does not strictly validate that keys are securely generated server-side and bound to the authenticated identity, allowing client-supplied values to be accepted as legitimate keys

Why this happens

The underlying issue is a broken authentication and identity binding pattern aligned with CWE-287, where trust in client-controlled data undermines server-side authentication guarantees.

Instead of generating and enforcing API keys entirely on the server, the system allows the frontend to influence key values and omits strict checks tying those keys to a verified user session.

This insecure design treats client-provided parameters as authoritative for authentication tokens, effectively bypassing intended access controls.

Potential impact

  • Attackers may gain unauthorized access to API endpoints that require valid keys
  • Malicious users could impersonate other tenants or users by crafting keys outside their account scope
  • Service quotas, rate limits, or billing controls can be bypassed or abused
  • Sensitive data exposed via protected APIs may be read or modified
  • Backend operations gated by API keys could be triggered without proper authorization

General mitigation guidance

Robust mitigation focuses on server-centric authentication and key management.

Common patterns include:

  • Generating API keys exclusively on the backend using cryptographically strong randomness
  • Binding each API key to a verified user or service identity and enforcing that mapping on every request
  • Rejecting any client-provided key values during generation, treating them as untrusted input
  • Implementing clear separation between authentication (who the caller is) and authorization (what the key can do), with least-privilege scopes
  • Avoiding exposure of unnecessary authentication details in frontend logic and minimizing key visibility

How teams detect issues like this

Detection efforts can rely on:

  • Code review focused on authentication flows, ensuring keys and tokens are generated and validated server-side only
  • Static analysis rules flagging patterns where authentication credentials are derived from or influenced by client input
  • Runtime logging and anomaly detection for suspicious key creation events (e.g., unusual patterns or high volumes from a single client)
  • Policy-based checks in CI/CD that enforce secure token-generation guidelines and prohibit client-side key construction

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-22w2-mx2h-4fr7
vulncheck.comvulncheck.com/advisories/capgo-unauthenticated-api-key-generation-via-client-side-parameter-manipulation

Frequently asked

questions

It can be exploited by any party able to access the API key generation flow and manipulate requests, making it broadly reachable in typical web or mobile client scenarios.

In many cases, minimal access is sufficient—such as a standard user account or even anonymous access if the key generation endpoint is weakly protected. The core issue is that the backend incorrectly trusts client-supplied values.

Centralize key generation and validation on the backend, ensure keys are cryptographically strong, and tightly bind each key to an authenticated identity and its allowed permissions. Reject all client-influenced key material.

Adopt secure-by-default authentication architectures, mandate server-side generation and enforcement of credentials, and incorporate security reviews and automated checks for any flow that issues or validates tokens or API keys.

Find out what's already
exploitable in your codebase.