Thank you, then there will be an extra check that will not be useless soon, and it will be removed.
Point 4 is the best one here, so let me start with it: *you should make it impossible to get wrong, not check it afterwards.* I agree. That's what RLS is moving the boundary out of application code, where every query is a place to forget it, into one place the database enforces. The problem is that "the database enforces it" isn't the same as "it's enforced." A few examples, all standard Postgres: * a view runs with its **owner's** rights unless `security_invoker` is set, so RLS on the base table never applies to the caller * RLS **never** applies to a materialised view, at all * foreign key checks bypass RLS they have to, or you could defeat a constraint by hiding a row * `service_role` bypasses it entirely, which is what your MCP server and half your server-side code connect as So "physically cannot" isn't reachable with RLS alone. You can move the boundary to one place but you still have to verify the constraint is the constraint you think it is. We use type systems and still run the type checker. **"why use RLS then":** on Supabase you don't really choose. PostgREST auto-exposes every table in the schema and the anon key ships in the browser bundle. RLS isn't an architectural preference there, it's the only thing between the two. And I don't encourage anyone to adopt it, the tool is for people already on a platform where it's the default. **"it doesn't catch the common issues":** that one's checkable, so let's check it. The most common real-world failure is RLS off or incomplete on a table PostgREST exposes. That's CVE-2025-48757 (170+ apps, 303 endpoints, CVSS 9.3), and DeepStrike found thousands of instances dumpable with `curl` plus the anon key. That's the first thing `anon-reads` proves, by connecting as `anon` and trying the read. You were partly right until yesterday, though: the second-commonest shape in that survey is *"RLS remembered on* `users`*, forgotten on* `projects` *and* `teams`*"*, and a table with no tenant column fell through every guard I had. I measured it, found four guards reporting `ok` on a table an unauthenticated `curl` could dump, and shipped the fix. It's in the changelog with the numbers. **"your tests should cover this":** they don't, and the reason is structural. An isolation bug doesn't throw. RLS denying a read returns `0 rows`, which is indistinguishable from "no data yet". Your test asserting the list renders passes either way. That's not a discipline failure, it's that the failure mode is silent by construction. I have a good example of this. I recently audited this tool adversarially against a real database — every claim it makes, checked by trying to disprove it. **213 candidates, 107 verified, 105 fixed.** Guards that reported green on proven leaks. One case where whether a real leak failed the build depended on *alphabetical ordering*. One where the recommended fix would have taken a production database down. All of it behind a passing test suite, because I'd written the tests and the code from the same beliefs on the same afternoon. My tests could tell me the code did what I thought. They couldn't tell me whether what I thought was true. That's the gap this fills, and it's why "just write better tests" doesn't close it. Findings and reasoning are in [`AUDIT-BACKLOG.md`](http://AUDIT-BACKLOG.md) and [`THREAT-MODEL.md`](http://THREAT-MODEL.md) if you want to check any of it.
Adding some extra directly from Google: If you scan the main homepage response of [`google.com`](http://google.com) using a security scanner (like [Security Headers](https://securityheaders.com/)), it usually scores a **low grade** because many of those traditional, standard headers appear to be completely missing or look different from industry "best practices". \[[1](https://aiqamonkey.com/blog/security-headers-guide.php)\] However, Google isn't neglecting security; they handle it **differently, at massive scale, using custom mechanisms** rather than relying on standard top-level response headers on their base search page. The reality behind why Google doesn't enforce those exact headers on [`google.com`](http://google.com) breaks down across each item: 1. No `Strict-Transport-Security` (HSTS) Header * **The Observation:** If you curl [`https://www.google.com`](https://www.google.com), you will not see the `Strict-Transport-Security` header in the response. * **The Reality:** Google doesn't need to send it because [`google.com`](http://google.com) **is hardcoded into the browser's source code** via the [HSTS Preload List](https://hstspreload.org/). Sending the header on every single search query would waste massive amounts of cumulative global bandwidth for zero added security benefit. Since the browser already forces HTTPS locally, the network-level header is entirely redundant. \[[1](https://stackoverflow.com/questions/48515902/why-google-com-not-set-includesubdomains-directive-on-hsts-response-header)\] 2. No `Content-Security-Policy` (CSP) * **The Observation:** The main landing page for Google Search often lacks a standard `Content-Security-Policy` header. * **The Reality:** The main Google search page is a highly optimised, hyper-lean, legacy-supporting web application. Implementing a strict CSP on the global search engine is incredibly complex due to the sheer volume of regional variants, dynamic snippets, browser extensions that inject code, and legacy devices they support. * *Note:* While the *main search page* skips it for performance and compatibility, Google relies heavily on custom, strict **Nonce-based CSPs** on their highly sensitive application subdomains (like [`accounts.google.com`](http://accounts.google.com) or `mail.google.com`) where credential management occurs. \[[1](https://security.stackexchange.com/questions/239241/google-com-is-not-hsts-protected)\] 3. No `X-Content-Type-Options: nosniff` * **The Observation:** The server often omits the standard `X-Content-Type-Options: nosniff` header on the main HTML document. * **The Reality:** This header prevents browsers from "MIME-sniffing" a file (e.g., executing a text file as a script). Google avoids this attack vector natively by **never allowing user-uploaded content to execute on the** [`google.com`](http://google.com) **origin**. User assets, files, images, and attachments are strictly forced onto completely separate, sandboxed domains like `*.googleusercontent.com` or `*.gstatic.com`. Because [`google.com`](http://google.com) only serves strictly controlled, server-generated text/html, MIME-sniffing exploits are structurally impossible on that domain. \[[1](https://barrion.io/blog/security-headers-guide), [2](https://zeo.org/resources/blog/security-http-headers-you-need-to-know-for-seo-http-headers-optimization), [4](https://support.google.com/sites/thread/218651173/modify-security-headers-in-google-site?hl=en)\] 4. No `Referrer-Policy` * **The Observation:** You won't find a `Referrer-Policy: no-referrer` or `same-origin` header in the global landing page response. * **The Reality:** Google's entire business model historically relies on outbound referrer data (passing search query parameters or click data to destination sites via analytics tools), but they control this granularly using an internal mechanism. Instead of a global header that blocks or permits everything, Google utilises inline HTML elements (like `<meta name="referrer" content="...">`) and structural link attributes (like `rel="noreferrer"`) built directly into their search result wrappers to dynamically strip or pass referrer data on a link-by-link basis. \[[1](https://zeo.org/resources/blog/security-http-headers-you-need-to-know-for-seo-http-headers-optimization), [2](https://letsgodevops.pl/blog/why-do-we-need-security-headers)\]
Interesting finding as I was sying, I'm running the tests. on the HTTPS flagged as an issue: It seams like the https you see in a browser comes from **HSTS preload**, which is compiled into Chrome and Firefox, not served by Google. That's why curl and your browser disagree, and both are right. So, on this the tool is right and Google itself confirm the finding: https://preview.redd.it/z1bmx1vxa3mh1.png?width=715&format=png&auto=webp&s=d6ff3612a872b6f7f28c64a6627013ede33bdb76
Google is a different type of service, and it is also the reason why most of the services block scans for the majior third parties platforms, and I'm not aware of Google using Supabase as a DB either. F grade with 0 critical findings on a search engine that, by their own mission statement, is to organise the world's information and make it universally accessible and useful, I believe, is the wrong test to do. Either way, if you check Google manually, you will find exactly what the tool is highlighting: CSP is Content-Security-Policy-Report-Only — it reports; it does not enforce No Strict-Transport-Security, no X-Content-Type-Options, no Referrer-Policy The real bug is that Google redirects to http and to https by default, and it seems it loses one of the steps and flags it as needing a fix. In any case, I'll look into it and either find a way to block scans of websites that are out of scope or find a different solution for these cases. I guarantee that if you are publishing web apps, the findings are valuable and flag real issues that you can catch **client-side.** Said that I'll run some extra tests so that I can give you some extra details
you could't ask a better question because I have built a full package just for this: [https://www.npmjs.com/package/tenant-guard](https://www.npmjs.com/package/tenant-guard) npx tenant-guard Basic client-side security can also be checked with [www.ismyappleaking.com](http://www.ismyappleaking.com)
published including it. let me know, if using it you see any errors or issues on your project so that I can troubleshoot it
thanks for the suggestion! I'm adding it to the new release!
adding it to the new release! thank you!
Not really.... It's a client-side security assessment that tells you exactly what people can already access. It's exactly the opposite. It is built for people that is publishing and selling web apps, knowing 0 or little about securing their clients' data. You would normally have to pay for these kinds of assessments, and a data leak can cost you a lot of money in fines, plus you would put all of your clients at risk. If you need to do the free assessment, it is already too late because you have already published a security issue and are saying that I'm inviting someone to hack is **dangerously misleading**. You should check the repo and the website before commenting!
thank you! more than happy to see what you have that I might still miss and integrate it! I started to write the tests as well but in between doing all the rest of the app. But I always worry about security and data leakage. I thought it is definitely worth to go more in depth down this rabbit hole :D
how do you know all this stuff? your knowledge is gold!! each one of your comment is more impressive than the previous one! It sounds like you created Supabase instead than learning it by doing and making a ton of mistakes, like I did! Let me work on that as well, trying to design some extra tests! Thank you so much for the incredible valuable controibutions!
If you have a Vibe-Coded app based on Supabase and you want to keep it secure and extensively test that you are not leaking your user data, this is the tool for you. You can add it to your repo and run automatic checks in case your last release includes a potential risk and catch it before it goes live. You can also run a quick but compelling check of your app through [www.ismyappleaking.com](http://www.ismyappleaking.com) for a full assessment. client-side, completely free
I forgot the cool gif demo 😞 ahahah too late for that but I have added it anyway
I think so as well but I also believe it is going to be necessary to have standard ways to analyse and evaluate all the software available on the market. The main barrier is not coding anymore and everyone is building basically the same things but the difference in quality will be huge!
I've integrated the tool also into the other Security check I was building. The CI goes more in depth but whoever is shipping VibeCoded Apps, should check this out. it is free! The bit I'm proud of: the database check runs entirely in your browser, so the tool never sees your data. It also does public GitHub repos (committed secrets, cross-tenant bugs, vulnerable deps + an SBOM) and mobile .apk/.ipa files. Free, no signup: [https://ismyappleaking.com](https://ismyappleaking.com) Built solo and early release. Feedback and false-positive reports very welcome.
totally agree, and that's the bet, 0.5.0 went to the write path (the tenant-hop you described) instead of adding another check, for exactly the reason you gave: a tool that greenlights "reads are isolated" while writes leak is worse than no tool, because people build on the green. on the hop specifically: the write probe now tries SET tenantcol = <other> in both directions, moving your own row into another tenant, on top of the existing steal and delete probes, all whole-table with no WHERE and count-compared so a correct SELECT policy can't mask it. USING passes on the way in; with no WITH CHECK on the destination nothing checks where it lands (worst when the policy is scoped by created\_by/owner rather than the tenant column). a correct FOR ALL … WITH CHECK (tenant = current) still passes clean, so it's not a false-positive machine. deletes were already probed instead so writes stay ahead of breadth on the roadmap: INSERT-under-RLS isolation is next (the one write path not proven yet), then storage. appreciate the steer, it's exactly where this is going.
I'm trying to crunch the suggestions in parallel as fast as I can... I didn't expect almost 400 downloads in a metter of hours :D trying to keep up with it :D
Both of these shipped! thank you, they genuinely made it better. The negative control is in: before trusting a pass, the prover drops to your app role and asserts it *can't* read a deliberately deny-all table. If it can — superuser, `BYPASSRLS`, table owner, or a `SET ROLE` that didn't take effect, it fails loudly instead of going green for the wrong reason. And you nailed the `becomeTenant` point. There's now a **seeding mode**: it manufactures two tenants inside a rolled-back transaction, and your seed creates the **membership rows,** so a bare claim isn't enough anymore, exactly as you said. Membership-table policies are provable now. (v0.3.0)