Show and tell: vibe-shield, an open-source static scanner for service_role exposure, RLS gaps and route auth in AI-written Supabase apps #53311
avivgerz-hue
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone, I'm Aviv, the author of vibe-shield. Disclosure up front: this is my own project. It is MIT licensed, free, has no hosted service, and makes no network calls when it scans.
I built it because coding agents (Claude Code, Cursor, Codex and friends) tend to write Supabase code that works but quietly skips the security parts. The patterns I kept seeing were:
SUPABASE_SERVICE_ROLE_KEYplaced behind aNEXT_PUBLIC_variable, or acreateClient(url, serviceRoleKey)helper that ends up imported from a client component.CREATE TABLEmigrations with noENABLE ROW LEVEL SECURITYanywhere in the project, or policies such asUSING (true)andGRANT ... TO anon.anon/authenticatedthat never referenceauth.uid()orauth.jwt().vibe-shield is a static scanner for those shapes. It builds a best-effort import graph (literal imports, re-exports, relative paths and tsconfig aliases) so it can flag a service-role client that is reachable from client code, and it keeps a cross-file index of tables versus RLS statements so a
CREATE TABLEin one migration is matched against anENABLE ROW LEVEL SECURITYin another.Try it on a project:
The current version is v2.1.2, published on npm as
@latestand listed on the Official MCP Registry asio.github.avivgerz-hue/vibe-shield.It also runs as an MCP server (
vibe-shield mcp) so an agent can call the scan as a tool, and it can output SARIF for GitHub code scanning, or fail a CI job with--fail-on high.Honest limitations, because I would rather you know them:
import 'server-only'and per-request authorization checks still matter.Repo: https://github.com/avivgerz-hue/vibe-shield
I would really appreciate feedback, especially false positives on real Supabase projects and RLS patterns you think it should catch but does not. Issues and PRs are welcome.
All reactions