TL;DR: Supabase applications can expose far more than anonymous table reads, according to Oneleet, because public registration, permissive policies, exposed functions and private buckets often become reachable after login. The security boundary shifts from the publishable key to authenticated access control, where identity checks and authorization logic must be correct at every layer.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Oneleet's blog post: Supabase's practical attack surface often shifts from anonymous enumeration to authenticated access, with registration, RLS, functions and storage creating most of the exposure.
Why it matters: Identity and authorization controls, not just exposed keys, decide whether a Supabase app leaks private data once an attacker can create an account or invoke backend logic.
Context
Supabase security is not just a question of whether a client-side key can be found. The deeper governance problem is that modern applications often expose multiple control planes at once: registration, database grants, row-level security, backend functions and storage policies. In that environment, a valid session can matter more than a leaked key, because the authenticated caller often reaches far more data and functionality than an anonymous one.
Row-level security helps only when it is consistently enabled, correctly scoped and paired with strong authorization checks in functions and API handlers. When applications rely on permissive policies, open signup paths or secret-key backed code paths, the security model shifts from deny-by-default to trust-by-implementation. That is a brittle posture for internal tools, customer-facing apps and AI-enabled workflows alike.
Key questions
Q: What should teams do first when Supabase access controls are exposed?
A: Treat the exposure as an access-control incident: identify which tables, policies, and keys are reachable by an authenticated user, then revoke or rotate any exposed secrets and tighten row-level security and API rules. An authenticated user may have broader access than an anonymous visitor, so test session-based access paths, service roles, and default grants immediately.
Q: Why does login often reveal more Supabase data than anonymous access?
A: Login often reveals more Supabase data because authentication can switch a caller from anonymous to an authenticated role with broader table grants, storage access, or RPC permissions. If authorization is weak, the session token becomes a key to policy gaps rather than a limiter, so row-level security and role mappings must be checked together.
Q: How does row-level security work in Supabase?
A: Row-level security is a database access control feature that filters which rows a user can see or change. In Supabase, policies evaluate the current role and request context, so access depends on the policy expression attached to each table rather than on the table alone.
Q: How should internal apps restrict Supabase self-registration?
A: Internal apps should disable open sign-up and require an explicit invitation, SSO, or pre-provisioned account. If self-registration is needed, gate it with backend allowlists, email domain checks, and approval workflows, then bind the new account to a known organisation or tenant. Remove unused accounts quickly.
Technical breakdown
Why the publishable key no longer maps the full Supabase surface
Supabase used to allow a simple discovery path: find the publishable key, fetch the OpenAPI schema and test table access as anon. That pattern no longer holds once anonymous schema access is removed, and it was never enough to model the full environment anyway. Supabase applications can expose tables, database functions, edge functions and storage through different enforcement paths, so table enumeration alone misses the actual exposure pattern. The key point is that discovery and authorization are separate problems, and an attacker only needs one weak path to move past the surface you intended to expose.
Practical implication: Treat key discovery as only the first step and validate every exposed API, function and storage path under both anonymous and authenticated contexts.
How row-level security and grants interact in practice
Postgres grants govern what a role can do at the object level, while row-level security decides which rows that role can reach. That means RLS is only one layer in a three-layer model that also includes schema exposure and object privileges. A table can have grants that permit access, policies that filter rows, or a permissive policy that effectively removes the row filter. The distinction matters because policy logic is often the only place where the caller's identity can be evaluated, and that logic can be bypassed or weakened if the table is misconfigured. See the PostgreSQL Row-Level Security Guide.
Practical implication: Review table grants, schema exposure and RLS policies together, because a safe policy on a broadly granted table still leaves exposure paths open.
Why authenticated sessions often reveal the real authorization failure
Many Supabase applications are built for internal use or for scoped customer workflows, but they still allow public registration through the Auth API. Once an attacker obtains a valid session, the application frequently treats authentication as sufficient proof of entitlement. That is where the failure appears: the app may let a logged-in user read another user's records, call a backend function with a different identifier or access storage objects that were never meant to be broadly visible. In identity terms, the issue is not login itself but the lack of authorization boundaries after login. Read Supabase Security.
Practical implication: Test the logged-in path as aggressively as the anonymous path, because many Supabase exposures only become visible after session creation.
Threat narrative
Attacker objective: The attacker wants to convert a small public surface into authenticated access that reveals or modifies high-value application data at scale.
- Entry begins with exposed registration, a leaked publishable key or another reachable request path that lets an attacker interact with the Supabase application.
- Credential access is not always required; in many cases the attacker simply creates an account and gains a valid authenticated session that opens wider API and database reach.
- Escalation occurs when permissive policies, insecure backend functions or overbroad storage access let the attacker move from their own data to other users' records, private conversations or internal business objects.
- Impact is bulk exposure or modification of sensitive data such as PII, sales pipelines, payment records, support chats and uploaded documents.
Breaches seen in the wild
- Shai Hulud npm malware campaign: Shai Hulud campaign: npm malware exposed secrets on GitHub.
- Meta Muse agent hijack 2026: An undocumented Muse setting let local malware hijack Meta's personal AI agent, steal its authentication material and abuse user access.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Authenticated access is the dominant risk variable in many Supabase deployments. The article shows that once an attacker can register or log in, the security model often changes more than defenders expect. That makes identity and authorization design the real control plane, not the publishable key alone. Practitioners should assume that any reachable signup path or weak session boundary can turn a narrow public surface into a broad internal one.
Row-level security is necessary but insufficient when the surrounding object model is loose. A table policy can be correct and still be undercut by schema exposure, permissive grants, security definer functions or storage objects that sit outside the same governance discipline. The deeper lesson is that Supabase governance fails when controls are assessed one by one instead of as a compound access path. Teams should review database, function and storage authorization as one system.
Public registration creates an identity governance gap, not just an application feature. When an internal tool or customer portal accepts accounts from anyone, the organisation has effectively externalised trust without a lifecycle model for who should exist, who should be entitled and what they can reach. That gap is often larger than the table exposure itself. Supabase security becomes a governance problem whenever authentication is treated as the end of the control story.
Security definer code turns backend helpers into hidden privilege edges. Functions that execute with the creator's permissions can bypass the caller's RLS context and return data the caller should never see. This is the same structural problem that appears in many identity-adjacent systems: a trusted execution path is allowed to answer on behalf of a less trusted caller without a fresh authorization decision. Practitioners should treat privileged backend logic as part of the access model, not a convenience layer.
Attack surface management tools need authenticated coverage, not just public enumeration. The article's findings show that a scanner that only checks anonymous access, the default schema or direct table reads will miss most real exposure in modern Supabase environments. That is a named concept worth carrying forward: authenticated surface drift, where the reachable data set expands materially after login. Security teams should measure the authenticated path as a first-class exposure domain, not an exception.
What this signals
Authenticated surface drift: the practical risk in Supabase is that the reachable dataset expands sharply once a session exists. Identity and access reviews that focus on anonymous exposure alone will miss the higher-value paths that open after login, especially where helper functions and storage policies sit outside the same review cycle.
The governance lesson is to test access paths by role, not by component. A table that looks safe in isolation can still be reachable through a function, a backend handler or a storage rule, so policy ownership has to follow the whole request path rather than a single control point.
For practitioners
- Test the authenticated attack path first Create a non-admin test account and repeat every exposure check after login, including table reads, writes, functions and storage access.
- Audit signup and registration controls for bypasses Validate backend signup hooks, email-domain restrictions and any allowlist table so they cannot be bypassed through direct API calls or permissive policies.
- Review service_role and security definer usage Inventory functions and handlers that run with elevated privileges, then confirm each one performs explicit authorization before returning user-scoped data.
- Treat storage policies as part of the same access model Check private buckets, object policies and upload paths together, because bucket privacy alone does not prevent overexposure through permissive rules.
- Rebuild discovery around live application behaviour Collect runtime scripts, exposed schemas and exposed API paths from the actual application flow, not from assumptions about anon-only table access.
Key takeaways
- Supabase risk often shifts from public key exposure to what a logged-in caller can reach, which makes authorization the more important control boundary.
- The strongest failures in the findings came from permissive policies, open registration and privileged backend paths, not from disabled RLS alone.
- Practitioners should test the anonymous and authenticated attack surface together, because the wider exposure often appears only after login.
Related NHI Mgmt Group resources: Supabase Security · PostgreSQL Row-Level Security Guide · Cloud Workload Identity Guide · OSINT and Reconnaissance Guide
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 provides the primary governance reference for this term.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-04 — Insecure Authentication | Public signup and weak session boundaries let attackers move into authenticated access paths. |
| Recommendation — Validate registration and session handling so unauthorised users cannot reach authenticated Supabase functions. | ||
Key terms
- Supabase RLS: Supabase RLS is the use of row-level security in a Supabase-backed database to control which rows each caller can read or modify. It works through table policies that evaluate the caller’s role and request context, so access is enforced at the data layer rather than only in the application.
- Security Definer Function: A security definer function is a database function that runs with the privileges of its owner rather than the caller. It is used to expose controlled operations through stored code, so access to underlying tables or actions can be granted indirectly while limiting direct permissions on the data or objects involved.
- Publishable Key: A publishable key is a public-facing API key that identifies an application when it calls a service from client-side code. It is meant to be embedded in browsers or mobile apps and usually grants only limited, non-secret access, with sensitive operations protected by a separate secret or server-side credential.
- Row-Level Security: Row-level security is a database control that restricts which rows a session can read or modify based on policy. For multi-tenant apps, it is valuable because it pushes tenant enforcement below application code, reducing the chance that a forgotten filter exposes another organisation's data.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity and secrets management. It helps practitioners connect identity controls to real application exposure patterns across modern platforms.
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org