Summary
Capgo exposes sensitive organization and billing information through unauthenticated Supabase PostgREST RPC endpoints.
By abusing these endpoints with only a public key, an attacker can enumerate organizations and infer which ones are paying or trial customers for profiling or targeted abuse.
Affected context
This vulnerability appears in Capgo deployments that expose Supabase PostgREST RPC endpoints is_trial_org and is_paying_org without strong authorization controls.
It is relevant where:
- Public
sb_publishablekeys are usable against backend RPC endpoints - The endpoints return different responses for existing vs. non-existing organizations
- Billing-related flags (e.g., trial vs. paying) are computed and returned to unauthenticated callers
In such setups, calls to these endpoints can leak organization existence and payment status across tenants or customers.
Exploit preconditions
- Attack surface: Publicly reachable Supabase PostgREST API where the RPC endpoints
is_trial_organdis_paying_orgare accessible. - Required access: No authenticated user account; knowledge of the public
sb_publishablekey and the ability to send HTTP requests to the API. - Trigger point: Invoking the RPC endpoints with candidate organization identifiers (IDs, slugs, or similar identifiers).
- Why exploitation is possible: The RPC functions expose distinct return values or error patterns that:
- Reveal whether an organization exists
- Disclose whether the organization is on trial or paying
This logic is reachable without tenant-aware authorization or role checks, allowing enumeration and profiling.
Why this happens
The core issue is an authorization gap in how sensitive business metadata is exposed via API endpoints.
The RPC functions is_trial_org and is_paying_org treat requests authenticated only with a public key as trusted enough to reveal tenant existence and billing status.
This maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where an API provides more information than necessary to unauthenticated or low-privilege callers.
The endpoints are effectively acting as an oracle: their distinguishable outputs for valid vs. invalid organizations, and for paying vs. non-paying accounts, leak sensitive attributes that should be guarded behind access controls.
Potential impact
- Attackers may enumerate valid organizations or tenants within a Capgo deployment.
- Adversaries could build lists of paying vs. non-paying customers for targeted phishing, scams, or competitive intelligence.
- Attackers can infer business relationships and revenue indicators based on who is a paying customer.
- Automated scripts can profile the customer base, aiding in credential stuffing, social engineering, or targeted attacks against high-value organizations.
- Combined with other data, enumeration results can support large-scale reconnaissance and privacy violations.
General mitigation guidance
Effective mitigation focuses on tightening access control around metadata and minimizing what unauthenticated callers can learn:
- Treat billing status, trial flags, and tenant existence as sensitive attributes that require authenticated and authorized access.
- Implement role-based or policy-based checks within RPC handlers so that only users with legitimate relationships to an organization can query its status.
- Normalize error and response behavior so that non-authorized callers see generic, non-enumerable responses that do not distinguish between "not found," "no access," and "exists."
- Avoid exposing "is_*" style helper endpoints that directly reveal internal state; instead, bundle necessary information into authorized business workflows.
- Apply the principle of least privilege at the API layer, ensuring public keys or anonymous roles cannot access tenant-specific or billing-related information.
- Conduct regular design reviews of API contracts to ensure that metadata considered "low risk" in isolation is not exposed in a way that enables large-scale profiling.
How teams detect issues like this
Detection can focus on both code-level patterns and runtime behavior:
- Static analysis / schema review: Identify RPC functions and endpoints that:
- Return billing, subscription, or trial flags
- Perform lookups based on tenant or organization identifiers
- Are mapped to public or anonymous roles in Supabase/PostgREST configuration
- Configuration review: Inspect database security policies, RLS rules, and API role mappings to ensure billing-related RPC calls require authenticated roles.
- Code review cues: Flag endpoints whose names suggest existence or status checks (
is_*,has_*,check_*) and verify they do not respond differently based on resource presence for unauthenticated callers. - Monitoring and logging: Track unusual patterns of requests to these RPC endpoints, such as:
- High-volume queries with varying organization identifiers
- Sequential or pattern-based enumeration of IDs or slugs
Alert on enumeration-like behavior to detect ongoing profiling.
- Automated API security testing tools and open-source scanners can be configured with test cases that probe for tenant enumeration and information disclosure via status endpoints.

