/

CVE-2026-56245

Severity:

HIGH RISK

(8.2)

Authorization Bypass (CWE-269) in Supabase Capgo RPC

CVE-2026-56245

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-269

Impact:

Cross-tenant billing manipulation and resource exhaustion

Severity:

HIGH RISK

(8.2)

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

An authorization bypass in Supabase Capgo's SECURITY DEFINER record_build_time RPC function lets unauthenticated callers insert arbitrary build-time records using only a public API key.

When exposed, this can be abused to poison billing and quota data across organizations, enabling cross-tenant resource exhaustion and billing manipulation.

Affected context

This vulnerability appears in Supabase Capgo deployments that expose the record_build_time RPC function over the REST interface via /rest/v1/rpc/record_build_time.

The risk exists when the function runs with elevated privileges under SECURITY DEFINER, while access control relies primarily on a public API key rather than tenant-scoped authorization checks.

In such configurations, the function may accept arbitrary input to create billing-related records that are not reliably bound to the caller's own organization context.

Exploit preconditions

  • Attack surface: Public REST endpoint at POST /rest/v1/rpc/record_build_time
  • Required access: Possession of a public Supabase API key and network reachability to the Capgo backend
  • Trigger point: Invoking the record_build_time RPC with crafted payloads to insert build-time records for chosen organizations or projects
  • Why exploitation is possible: The RPC function runs as a SECURITY DEFINER with elevated privileges and lacks sufficient tenant-aware authorization checks, allowing untrusted callers to perform actions reserved for privileged roles.

Why this happens

The underlying issue is an authorization design flaw where a SECURITY DEFINER function is exposed through a public-facing API without robust access control and tenant scoping.

In database-backed applications, SECURITY DEFINER routines execute with the owner's privileges, which can override row-level security or role-based checks when not carefully constrained.

This maps to CWE-269: Improper Privilege Management, where privileged operations are unintentionally made available to low-privilege or unauthenticated users due to missing or incomplete authorization logic.

Potential impact

  • Attackers may poison billing data by inserting arbitrary build-time records.
  • Attackers could manipulate quotas, leading to incorrect enforcement for affected organizations.
  • Tenant isolation can be undermined, enabling cross-tenant billing and usage manipulation.
  • Target organizations may suffer unexpected resource exhaustion or financial impact from falsified usage.

General mitigation guidance

Effective mitigation focuses on tightening authorization checks around privileged routines and avoiding unnecessary use of SECURITY DEFINER for externally accessible functions.

Common defensive patterns include:

  • Ensuring RPC functions that alter billing or quota data are restricted to authenticated, tenant-bound roles, with explicit checks on organization ownership.
  • Applying row-level and tenant-scoped access control that cannot be bypassed by elevated function privileges.
  • Refactoring critical operations to run under SECURITY INVOKER semantics where feasible, so they inherit the caller's permissions.
  • Segregating billing and quota manipulation logic behind internal-only services or admin APIs, rather than public endpoints keyed by project-level API tokens.
  • Adopting least-privilege principles for database roles and functions to minimize the blast radius of any exposed procedure.

How teams detect issues like this

Detection often centers on identifying over-privileged functions and unexpected public access patterns. Potential strategies include:

  • Static analysis or schema review to flag SECURITY DEFINER functions exposed via REST/RPC endpoints, especially for billing or quota operations.
  • Security-focused code review of database functions and access policies to ensure tenant scoping and role checks are applied consistently.
  • Logging and monitoring of calls to sensitive RPC endpoints, alerting on anomalous usage patterns such as high-volume build-time inserts from public keys.
  • Periodic audits of privilege assignments, row-level security, and API exposure policies to catch misconfigurations in multi-tenant environments.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-42f8-v563-5763
vulncheck.comvulncheck.com/advisories/supabase-capgo-unauthenticated-cross-tenant-build-time-accounting-poisoning-via-record-build-time-rpc

Frequently asked

questions

No. Because the affected RPC function can be called with a public API key and operates with elevated privileges, attackers may target billing and quota records associated with multiple organizations, weakening tenant isolation.

An attacker needs network access to the Supabase Capgo backend and a public API key for the project. They do not need authenticated user credentials if the endpoint accepts calls based on the public key alone.

Restrict privileged billing and quota operations to authenticated, tenant-bound roles; remove unnecessary SECURITY DEFINER usage on publicly reachable functions; and enforce explicit authorization checks that validate the caller's ownership of the targeted organization or project.

Adopt a systematic authorization model that combines least privilege, tenant scoping, and row-level security, and ensure all externally exposed RPC/database functions undergo security review. Automated checks for over-privileged routines and consistent policy enforcement in CI/CD can help prevent regressions.

Find out what's already
exploitable in your codebase.