/

CVE-2026-56242

Severity:

HIGH RISK

(7.5)

Information Disclosure (CWE-200) in Capgo RPC API

CVE-2026-56242

Deferred

Vulnerability type

Category:

Information Disclosure

CWE:

CWE-200

Impact:

User and organization data exposure

Severity:

HIGH RISK

(7.5)

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 exposes an unauthenticated security-definer RPC function that reveals user identifiers for supplied API keys, effectively acting as an API key validity oracle.

An attacker can probe this endpoint with arbitrary keys to test whether they are valid, map them to user accounts, and then chain this information into other RPCs to derive organization membership and management email PII.

Affected context

This vulnerability affects Capgo deployments where:

  • The get_identity_apikey_only RPC function is deployed as a security-definer routine
  • The function is callable without authentication or strict authorization checks
  • API keys exist as a primary authentication or scoping mechanism
  • Additional RPCs (such as get_orgs_v6) can be called with the derived identifiers to return organization or user-related data

The issue is most relevant in environments where API keys are issued to customers or internal systems and are assumed to be secret and unenumerable.

Exploit preconditions

  • Attack surface: Public-facing RPC endpoint accessible over the application API
  • Required access: No prior authentication; network access to the service is sufficient
  • Trigger point: Invoking the get_identity_apikey_only function with arbitrary API key values
  • Why exploitation is possible: The function runs with elevated privileges, trusts the provided API key as input, and returns user identifiers without verifying the caller's identity, effectively creating a validation oracle and identity mapping service.

Why this happens

The root cause lies in an over-privileged, unauthenticated security-definer RPC function that exposes sensitive internal identifiers based solely on user-controlled input.

By returning the owning user_id for any supplied API key, the function leaks information that should remain confidential and unguessable, mapping directly to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.

Architecturally, the pattern reflects a breakdown between authentication and data access control: a backend routine with elevated privileges is made callable without verifying the caller's legitimacy, and there is no output filtering to prevent disclosure of internal identifiers or key validity.

Potential impact

  • Attackers can confirm whether arbitrary API keys are valid or invalid.
  • Attackers can map API keys to specific user_id values, aiding targeted attacks.
  • Attackers can chain the derived identifiers into other RPCs (e.g., get_orgs_v6) to enumerate organization membership.
  • Exposure of management email addresses and related PII tied to organizations.
  • Facilitation of further account takeover attempts, phishing, or social engineering using the leaked identity data.

General mitigation guidance

Effective mitigation focuses on constraining who can call privileged routines and what they can learn from them:

  • Require strong authentication and authorization before allowing access to any security-definer or elevated RPC functions.
  • Avoid designing endpoints that act as key-validity oracles; do not return explicit signals that distinguish valid from invalid credentials.
  • Limit the data returned from internal lookup functions so that they expose only what is strictly necessary for the intended workflow, and avoid leaking internal identifiers.
  • Introduce a clear separation between internal service functions and public API surfaces, ensuring privileged routines are not directly exposed.
  • Apply least-privilege principles to database functions and roles, so that no single function can both validate keys and reveal identity or PII without additional checks.

How teams detect issues like this

Organizations can detect similar issues through:

  • Static and schema-based analysis of RPC definitions to identify security-definer functions accessible without authentication.
  • Code review checklists that flag any endpoint or function that returns user identifiers, organization IDs, or PII without explicit authorization checks.
  • API gateway or service mesh policies that enforce authentication requirements before routing calls to sensitive backend routines.
  • Logging and monitoring for anomalous patterns of API key probing, such as repeated calls to identity-related RPCs with varying keys.
  • Use of automated API security testing tools that look for identifier enumeration and credential oracle patterns in responses.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-fhgj-7376-qxwx
vulncheck.comvulncheck.com/advisories/capgo-unauthenticated-api-key-validity-oracle-and-user-identity-disclosure-via-get-identity-apikey-only-rpc

Frequently asked

questions

Yes. As described, any remote actor with network access to the affected Capgo instance can invoke the unauthenticated RPC function and use it as an API key validity oracle.

The attacker only needs the ability to reach the exposed RPC endpoint over the network; no prior login or valid API key is required. They can then supply arbitrary keys and observe which requests produce valid user mappings.

The safest pattern is to ensure that any function handling sensitive identifiers or credentials is gated by robust authentication and role-based authorization, and that it returns only minimal, non-identifying data. Security-definer routines should not be exposed directly to untrusted callers and should operate under least-privilege roles.

Prevention involves establishing design-time and review-time controls: classify which RPCs handle sensitive data, require explicit security reviews for security-definer functions, enforce authentication at the API boundary, and use automated checks to block introduction of new endpoints that reveal identity or key validity information without authorization. Consistent application of least privilege and defense-in-depth for backend routines greatly reduces the chance of recurrence.

Find out what's already
exploitable in your codebase.