{"slug": "one-public-key-every-user-s-data-the-supabase-mistake-ai-app-builders-keep", "title": "One public key, every user's data: the Supabase mistake AI app builders keep making", "summary": "A developer demonstrated that a Supabase anon key copied from a deployed front end can read every user's e-mail and phone numbers when row-level security is disabled, and released an open-source offline scanner for exported app bundles that flags missing or permissive RLS policies. The writeup cites CVE-2025-48757 (CVSS 9.3) covering insufficient RLS in apps generated by Lovable through 15 April 2025, which Lovable disputes, and warns that `using (true)` policies leave RLS nominally on while admitting everyone.", "body_md": "I put the key from a Supabase front end into a terminal and read every user's e-mail and phone number. No account. No password. Nothing but the key you can copy from any deployed website.\n\nThat key is not a mistake. It is meant to be public. The mistake is what was supposed to protect the data: row-level security.\n\nA Supabase front end talks straight to Postgres with the anon key. That is the architecture. If the key were secret, it would not work in a browser.\n\nWhat keeps one user from reading another user's rows is row-level security (RLS): rules on the table that say who may read which row. When RLS is off, the public key reaches the table with nothing else in the way.\n\nI built a lab with fake users to show it:\n\nThen I turned on RLS and added one policy:\n\n```\nalter table profiles enable row level security;\n\ncreate policy \"own profile\" on profiles\n  for select using (auth.uid() = id);\n```\n\nSame requests again:\n\nTwo lines, because the rule was always supposed to be there.\n\nThe CVE has a number: CVE-2025-48757, CVSS 9.3, for insufficient RLS in apps generated by Lovable through 15 April 2025. Lovable disputes it and says every builder is responsible for their own settings. Both things can be true. That is exactly why this is your checklist, not the platform's.\n\nThe pattern I expect most in generated migrations is a policy that says `using (true)`. RLS is switched on, error messages disappear, and everyone is allowed in. It is a door with the lock painted on. A real policy mentions who: `auth.uid() = user_id`.\n\nWhen someone sends me an exported app bundle, I look at:\n\nMost of the risk sits in those five.\n\nI built an offline scanner for exported bundles. It reads local files only, stores secrets as one-way fingerprints, and every finding starts as `needs_validation`. You mark it confirmed or rejected after reproducing it in a test setup you control, with written permission. Anyone who sells you \"100% secure\" after a scan is selling the scan.\n\nThe scanner and three small labs are open source: [https://github.com/mikebillnova-create/ai-app-security-check](https://github.com/mikebillnova-create/ai-app-security-check)\n\nEach lab has a `--selftest`, so the fix cannot quietly disappear in the next migration.\n\nOpen every table. Look for \"RLS disabled\". Read each policy and ask: who is this for? If the answer is \"everyone\", you have the door with the painted lock.\n\nIf you built with Lovable, Bolt or Supabase and want a second pair of eyes on what is already public, there is a free exposure check here: [https://ai-app-security.pages.dev](https://ai-app-security.pages.dev)\n\nNo passwords. No tests against systems you do not own.\n\n*The lab uses fake users. Never test apps you do not own.*", "url": "https://wpnews.pro/news/one-public-key-every-user-s-data-the-supabase-mistake-ai-app-builders-keep", "canonical_source": "https://dev.to/mike_8cac42e2421ce4849e51/one-public-key-every-users-data-the-supabase-mistake-ai-app-builders-keep-making-3pbd", "published_at": "2026-12-01 17:38:30+00:00", "updated_at": "2026-12-01 17:44:01.834744+00:00", "lang": "en", "topics": ["ai-safety", "ai-agents", "ai-tools", "developer-tools"], "entities": ["Supabase", "Lovable", "Bolt", "Postgres", "CVE-2025-48757"], "also_reported_by": [], "takeaway": "A Supabase anon key is public by design, so data protection depends entirely on RLS: enable it per table and scope policies with `auth.uid() = user_id`, since `using (true)` leaves the table open to anyone holding the key.", "recommendation": {"advice": "Audit every Supabase table for disabled RLS and replace `using (true)` policies with `auth.uid() = user_id` scoping, then re-run the scanner's self-tests after each migration.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/one-public-key-every-user-s-data-the-supabase-mistake-ai-app-builders-keep", "markdown": "https://wpnews.pro/news/one-public-key-every-user-s-data-the-supabase-mistake-ai-app-builders-keep.md", "text": "https://wpnews.pro/news/one-public-key-every-user-s-data-the-supabase-mistake-ai-app-builders-keep.txt", "jsonld": "https://wpnews.pro/news/one-public-key-every-user-s-data-the-supabase-mistake-ai-app-builders-keep.jsonld"}}