June 17, 2025

Row-Level Recklessness: Testing Supabase Security

Precursor Security's Joss Sparkes deep dives into common security pitfalls in Supabase apps -from MFA bypasses to misconfigured RLS - and shares practical tips for secure testing.

Get Your 'Vulnerability Management Template' FREE!‍

Your Vulnerability Management Template Includes:

  • Full Vulnerability Identification Process Documents
  • Easy to Follow Process Diagrams
  • System and Data Criticality Definitions
  • Vulnerability Triage Process
  • Remediation Allocation Process
  • Root Cause Analysis Process

Secure your organisation today by completing the form for your Vulnerability Management Template.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Download the, 'How to secure Microsoft Office Desktop Deployments Technical Guide' - FREE

  • 15 Technical Controls to help secure your users and keep your business safe.
  • 100’s of reference group policy objects to implement the controls
  • Reference material to learn more about each control

Complete the form to download your free technical guide and secure your organisation today.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Download the Cyber Essentials Template Policy Pack - FREE

Complete the form to download your FREE Cyber Essentials Template Pack today, including:

  • User Management Policy
  • Patch Management Policy
  • Mobile Device Management Policy
  • Information Security Policy
  • Device Build Policy
  • Credential Management Policy
  • Account Usage Policy
  • Registers for all of the above policies

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Download the Microsoft 365 Security Guide  - FREE

Complete the form to download your FREE Microsoft 365 Security Guide today, including:

  • A checklist to ensure your organisation is protected.
  • Top tips you can distribute to employees to keep your data safe.
  • Recommended secure configuration settings for your environment.

Sign up on the form and receive the guide instantly.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

I’ve tested a dozen Supabase apps in the past six months. Most were built fast. Some were built well. Few were built securely.

TLDR

  • Supabase is an open-source Firebase alternative built on Postgres with a RESTful API layer.
  • It’s easy to set up but has configuration depth that can introduce serious security issues.
  • Key areas to test: authentication quirks, row level security (RLS), and exposed frontend logic.
  • Supabase’s Security Advisor tool can help validate findings.

What is Supabase?

Supabase logo

If you’ve been anywhere near technology since the advent of large language models, you have likely heard Supabase mentioned. Often, this is currently marred with the brush of “Vibe Coding”, which rightfully has some critics. However, I would argue that Supabase’s popularity in this space comes from its ease to set up and get going, and its scalability if your app is successful. Add in that Supabase is open source so should be here for the future, and I think it is quite a good choice to back your application for most people. In this article, we will be focusing on the hosted version of Supabase at https://supabase.com, not on the self-hosted offering.

Supabase is billed as an open source competitor to Google’s offering Firebase. It provides a complete backend stack for developers, leveraging PostgreSQL as the database and PostgREST middleware for API queries. It includes built-in authentication, authorisation, and logging.

What the hell is PostgREST?

PostgREST logo

You heard right, Supabase uses a piece of technology called PostgREST, a portmanteau of Postgres and REST. PostgREST builds a fully RESTful API from an existing PostgreSQL database without any configuration needed. Each DB table becomes an API endpoint which can be refined with query parameters. It is an elegant solution when tied with Row Level Security (RLS), which allows the developer to specify which users can access/modify which pieces of data — essentially acting as authorisation.

Testing a Supabase Application

Now we know what Supabase is — how can we break it to our advantage? Over the last 6 months, I have tested multiple Supabase apps for customers as a penetration tester and contributed multiple issues to the Supabase vulnerability disclosure program.

Through this, I have gained some knowledge which I feel applies to most applications built on Supabase, which I will try to distill below. I have tried to write this as a primer and keep the tips basic but useful. This will in no way be comprehensive, but I hope it will allow you to start testing with confidence and avoid the overwhelm of a new tech stack.

Authentication

Supabase provides a solid authentication base. Email/password authentication works and is secure with the flick of a switch. OAuth requires some config but has sensible defaults that make common pitfalls hard to fall down.

This does not mean it is simple. As always, there is enough rope for a developer to hang themselves with in the config. Everything from JWT signing keys to rate limits are configurable in the UI. It is worth creating a free account on Supabase and going through these options to understand what a developer could have changed and may be vulnerable.

Authentication Dashboard Screenshot
Rate Limits Screenshot

One common issue I’ve run into with Supabase is MFA. In my opinion, it is not as deeply integrated with the platform as the rest of the authentication options. Although it is a toggle to turn on, it has to be manually applied to each endpoint using row level security. In my experience, this has led to MFA bypasses and just broken MFA functionality in general. I would advise testing this extensively.

Supabase’s handling of password resets and email verification has some quirks worth understanding. Unusually, Supabase allows you to bypass authentication with a forgot password link. They act essentially like magic links which act as one-time login links bypassing traditional auth. From here, a developer must create a frontend which hits an endpoint to change the password. This can also be used instead of email verification when creating an account. Although this is unusual and feels like it could be wrong, I have not yet found an instance where this causes any security issues.

A final quirk on forgot password is that the old password is not required in the normal Supabase flow. This leads to a potential issue: if an attacker could gain access to a valid bearer token, they can change the user’s password to create persistence and possibly block the user from accessing their account.

Authorisation

If we’re talking about authorisation, we are mostly talking about row level security (RLS). It has already been mentioned, but in this section, we will go into it in detail. RLS is the single most important part of Supabase when it comes to information security. If RLS is off, every authenticated (or even unauthenticated) user can read or write to any table in your database, a catastrophic failure point. Supabase will strongly warn users when they have it switched off, so I have not often seen it off entirely. However, due to its potential complexity, I have seen it implemented with holes in.

RLS Policy Screenshot

Test every endpoint that can be found and try to retrieve all information. Ensure that excessive data exposure or Indirect Direct Object References (IDOR) are not possible. You can find the different ways to query the PostgREST API in the documentation. An interesting trick to return all accounts when a table is being queried with UUIDs is to use the greater than (gt) or less than (lt) operator. Although a UUID is not commonly seen as numerical, it is possible to use gt and a UUID with all 0’s and it will show all UUIDs it can access.

id=gt.00000000-0000-0000-0000-000000000000

A final thing to understand about authorisation on Supabase is the difference between an anon and service key (Soon to be refined for clarity by Supabase). Both are in the JWT format. An anon key is public and will be sent with every request whether you are authenticated or not. A service key on the other hand allows a user to bypass all RLS policies and gain full read/write access to the database.. Therefore this key is considered incredibly secret and if found allows full access to the database.

API Key Screenshot

Testing the frontend

The frontend is entirely disconnected from Supabase and should be threat modelled separately. That said, I have found that a lot of people that use Supabase are inclined to use hosted options and modern frameworks. I would expect a Supabase user to use something like Vercel, or something AI-powered like Lovable, if going the hosted route. If going the self-hosted route, I would expect a modern framework like Vue or React. Go forth, figure out the weaknesses, and find an XSS or even cooler a CSPT!

Security Advisor

Finally, let’s talk about Security Advisor. This is a tool Supabase includes within its dashboard. It will try to warn developers about common security pitfalls they are running into and how to fix them. In my experience, developers will either:

  1. Follow this correctly and have quite a hardened setup
  2. Get swamped early by alerts they don’t understand, have notification fatigue, and ignore it entirely

This is invaluable when trying to explain to a client how to fix issues. If you’re reporting it, it’s likely Security Advisor will have a notification that you can point to. It’s no silver bullet, but resolving all these issues will go a long way for application security.

Security Advisor Screenshot

Conclusion

At its core, testing Supabase is like testing any other modern backend, but its unique blend of Postgres, REST, and frontend-centric workflows makes it easy to overlook critical misconfigurations. As always, it is worth noting where the shared responsibility lies between the developer and the Supabase project. Spend most of your time on the parts of the application that the developer is responsible for. This includes all configuration, and importantly, authentication and authorisation. When a dev veers off Supabase’s beaten track, your testing instincts should kick in, that’s often where the fun starts.

Supabase is free, fast to spin up, and well worth a tester’s time. A bit of hands-on exploration goes a long way and might just net you your next bug.

Happy hacking!

Ready for a true 24x7 cyber risk management solution from a CREST-Accredited SOC?

Get Your CREST 'What is a Security Operations Centre?' Guide!

It’s important to know what you’re getting, what’s not included and what else is available. This starts with understanding a SOC and it’s critical functions. CREST has recently published a guide to the critical functions of a SOC which aligns with the CREST SOC standard.

Enter your details here and to get the complete guide instantly sent to your inbox.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Why choose us?

Choose Precursor Security for penetration testing excellence—where industry-leading expertise, CREST accreditation, and a client-focused approach converge to fortify your digital defences with precision and reliability.

Written by

Precursor Security

Welcome to Precursor Security, where the forefront of cybersecurity and penetration testing expertise meets unmatched dedication and innovation. We are the architects of robust digital defences, committed to safeguarding the online realm.

menu