/

CVE-2026-56226

Severity:

HIGH RISK

(7.5)

Information Exposure (CWE-200) in Capgo Supabase RPC

CVE-2026-56226

Deferred

Vulnerability type

Category:

Information Exposure

CWE:

CWE-200

Impact:

Unauthorized Disclosure of Sensitive Information

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

A Supabase PostgREST RPC function in Capgo is exposed with SECURITY DEFINER privileges and granted to the anonymous role, enabling unauthenticated data access via a publishable API key.

Because the RPC accepts arbitrary user UUIDs without verifying ownership, an attacker can query organization membership, role assignments, subscription metadata, and management email (PII) for any user.

Affected context

The vulnerability appears in Capgo deployments that use Supabase PostgREST and expose the RPC function public.get_orgs_v6(userid uuid) to the anon role.

The function runs as SECURITY DEFINER, meaning it executes with elevated database privileges relative to the caller.

When clients can invoke this RPC using only a publishable API key and supply arbitrary UUIDs, the system may return sensitive user- and organization-related records even when no authenticated user context is established.

Exploit preconditions

  • Attack surface: Public Supabase PostgREST endpoint (POST /rest/v1/rpc/get_orgs_v6)
  • Required access: Possession of the public publishable API key or any ability to call the anonymous API endpoint
  • Trigger point: Invoking the get_orgs_v6 RPC with a chosen userid UUID in the request body
  • Why exploitation is possible: The RPC is SECURITY DEFINER, granted to the anon role, and trusts the caller-provided userid parameter without confirming it matches an authenticated user identity or applying row-level security checks.

Why this happens

The underlying issue is an authorization and data exposure flaw where a high-privilege stored function is bound to an unauthenticated role.

By design, SECURITY DEFINER functions in databases bypass the caller's privilege limitations and can see more data than the invoking role normally would.

In this case, the function accepts a userid parameter directly from the client and uses it to fetch organizational and subscription data without ownership verification or row-level security enforcement.

This maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the system returns confidential records (membership details, roles, subscription status, and PII email addresses) to requestors who lack appropriate authorization.

Potential impact

  • An attacker may retrieve organization membership information for arbitrary users.
  • An attacker could obtain role and permission details that aid in targeted attacks or social engineering.
  • An attacker can access subscription and trial metadata, revealing business-usage patterns.
  • An attacker may view management_email fields, exposing personally identifiable information (PII).
  • Aggregated exposure of user and organization data can weaken privacy guarantees and regulatory compliance posture.

General mitigation guidance

Effective mitigation centers on ensuring that privileged database functions are not callable by unauthenticated or broadly scoped roles, and that every data access path enforces ownership and authorization checks.

Common defensive patterns include:

  • Restricting SECURITY DEFINER RPCs to authenticated roles and integrating them with an identity-aware access control mechanism.
  • Validating that any user identifier parameter matches the currently authenticated user or is constrained by row-level security policies.
  • Minimizing the data fields exposed by RPCs, returning only the information strictly required for the client use case.
  • Applying privacy-by-design principles to segregate PII from general metadata and protecting it with additional access controls.
  • Periodically reviewing database functions and API endpoints for over-privileged roles and inadvertent public access.

How teams detect issues like this

Organizations can detect similar exposure issues by:

  • Reviewing Supabase and database configurations for SECURITY DEFINER functions granted to anonymous or public roles.
  • Using static configuration analysis or schema review tools to flag RPC endpoints that bypass row-level security or ownership checks.
  • Implementing code review checklists that require explicit authorization logic for any function returning user-specific or organizational data.
  • Monitoring API logs for patterns of access where anonymous clients query data associated with multiple distinct user IDs.
  • Applying security policies that prevent publishing RPC endpoints unless they are mapped to well-defined access control rules and identity validation.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-m7mm-35v3-82f4
vulncheck.comvulncheck.com/advisories/capgo-unauthenticated-organization-data-disclosure-via-get-orgs-v6-rpc

Frequently asked

questions

It is broadly exploitable in environments where the Supabase REST RPC endpoint is reachable and the public API key is accessible, because attackers do not need authenticated user credentials to query sensitive data.

An attacker only needs the ability to call the anonymous Supabase API endpoint, typically using the publishable API key. No user login or privileged account is required.

The safest approach is to restrict SECURITY DEFINER functions to authenticated roles, enforce ownership checks on user identifiers, and ensure row-level security policies govern all data returned by the function.

Prevent them by designing APIs with least-privilege access, systematically reviewing database functions and RPC endpoints for authorization gaps, and enforcing mandatory identity and authorization checks for any operation that returns user-specific or organizational data.

Find out what's already
exploitable in your codebase.