{"slug": "show-hn-supalock-open-source-security-scanner-and-agent-skills-for-supabase", "title": "Show HN: Supalock – Open-source security scanner and agent skills for Supabase", "summary": "Hermes Lekkas released Supalock, an open-source, local-first security scanner and multi-agent skill bundle for Supabase applications, shipping 128 curated vulnerability patterns (76 automated static checks and 52 agent-guided reviews), 8 Open Agent Skills, and 4 slash commands. Supalock targets leaks common in apps generated by Lovable, Bolt, v0, Cursor, and Claude Code, including tables in `public` with RLS disabled, policies checking `auth.role()` instead of `(SELECT auth.uid()) = user_id`, and `NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY` bundled into the browser, and installs into Claude Code, Cursor, Codex, Antigravity, Gemini CLI, GitHub Copilot, Cline, and Windsurf. The tool runs locally in a repo and in GitHub Actions PR checks with no subscriptions, external dependencies, or telemetry, and its hardened reference app scores 100/100 Grade A with 0 findings.", "body_md": "**Find the leaks in your Lovable, Bolt, v0, Cursor & Claude Code Supabase app before someone else dumps your database.**\n\nSupalock is a **local-first, open-source security scanner + multi-agent skill bundle** with **128 curated vulnerability patterns** (76 automated static checks + 52 deep agent-guided reviews), **8 Open Agent Skills**, and **4 slash commands** — built to catch real Supabase RLS, Storage, Auth, Edge Function, and client-secret leaks in milliseconds. **Zero subscriptions. Zero external dependencies. No telemetry.**\n\nAI coding tools ship working Supabase apps in 20 minutes — and routinely leave behind the exact same devastating leaks:\n\n- Tables created in `public` with**RLS disabled** (one`curl` with your browser`anon` key dumps every customer row)\n- Policies that check `auth.role() = 'authenticated'` instead of`(SELECT auth.uid()) = user_id` (any signed-up user reads everyone else's data)\n- Admin policies trusting `auth.jwt() -> 'user_metadata'` (any user can call`supabase.auth.updateUser({ data: { role: 'admin' } })` )\n- Postgres views missing `WITH (security_invoker = true)` that**silently bypass RLS**\n- `NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY` bundled straight into the browser\n- Next.js `middleware.ts` trusting cookie-sourced`getSession()` instead of verified`getUser()`\n- Unauthenticated Deno Edge Functions proxying your OpenAI/Anthropic key or skipping Stripe webhook signature checks\n- Client components calling `.from('profiles').update({ is_pro: true, credits: 99999 })`\n\nPaid scanners check your production URL **after** you've already leaked data. **Supalock catches these locally in your repo, in your AI coding agent, and in GitHub Actions PR checks before code ever ships.**\n\n```\ngit clone https://github.com/Hermes-Lekkas/supalock.git\ncd supalock\n\n# Scan the included vulnerable Lovable/Cursor-style demo SaaS app:\npython3 -m supalock scan examples/vulnerable-vibe-saas\n\n# Scan the hardened reference app (100/100 Grade A, 0 findings):\npython3 -m supalock scan examples/hardened-vibe-saas\n\n# Scan your own Supabase project:\npython3 -m supalock scan /path/to/your-app\n```\n\nOr install the `supalock` CLI globally via `pip` / `pipx` / `uv`:\n\n```\npip install git+https://github.com/Hermes-Lekkas/supalock.git\nsupalock scan .\n```\n\nSupalock follows the **Open Agent Skills standard** and ships with a multi-agent installer supporting **Claude Code, Cursor, Codex, Antigravity, Gemini CLI, GitHub Copilot, Cline, and Windsurf**:\n\n```\n# Open Agent Skills CLI (works across Antigravity, Claude Code, Cursor, Codex, Gemini CLI)\nnpx skills add Hermes-Lekkas/supalock\n\n# Or run the multi-agent installer directly into your current repo:\ncurl -fsSL https://raw.githubusercontent.com/Hermes-Lekkas/supalock/main/install.sh | bash\n\n# Install globally for specific agents (or auto-detect all installed agents):\n./install.sh --global --agent all\n./install.sh --project /path/to/your-app --agent claude,cursor,copilot\n/plugin marketplace add Hermes-Lekkas/supalock\n/plugin install supalock@supalock\n```\n\nThen run `/supalock-audit`, `/supalock-rls`, `/supalock-fix`, or `/supalock-prelaunch` directly inside your coding agent.\n\n| Agent | Format Installed | Project Path | Global Path | \n|---|---|---|---|\n| **Claude Code** | 8 Skills + 4 Slash Commands + Plugin Manifest | `.claude/skills/` ,`.claude/commands/` | `~/.claude/skills/` ,`~/.claude/commands/` | \n| **Cursor** | Scoped `.mdc` Guardrail Rule + Skills | `.cursor/rules/supalock.mdc` | `~/.cursor/rules/supalock.mdc` | \n| **Antigravity** | 8 Open Agent Skills | `.agents/skills/` | `~/.agents/skills/` | \n| **Codex CLI** | 8 Open Agent Skills | `.codex/skills/` | `~/.codex/skills/` | \n| **Gemini CLI** | 8 Open Agent Skills | `.gemini/skills/` | `~/.gemini/skills/` | \n| **GitHub Copilot** | Fenced Guardrail Section (preserves existing rules) | `.github/copilot-instructions.md` | — | \n| **Cline** | Project Security Rules | `.clinerules` | — | \n| **Windsurf** | Project Security Rules | `.windsurfrules` | — | \n\nEvery pattern in [`patterns/`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/README.md) documents a **vulnerable snippet**, a **concrete exploit scenario**, **CWE + OWASP mapping**, and a **copy-pasteable production fix**.\n\n| # | Attack Surface | Patterns | Static CLI | Agent-Guided | Catalog File | \n|---|---|---|---|---|---|\n| 01 | **Row Level Security (RLS) Policies** | 20 | 13 | 7 | [`01-rls-policies.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/01-rls-policies.json) | \n| 02 | **Postgres Privileges, Views & Functions** | 14 | 10 | 4 | [`02-postgres-privileges.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/02-postgres-privileges.json) | \n| 03 | **Storage Buckets & `storage.objects`** | 12 | 7 | 5 | [` 03-storage-buckets.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/03-storage-buckets.json) | \n| 04 | **Auth, Sessions & Metadata** | 14 | 5 | 9 | [`04-auth-sessions.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/04-auth-sessions.json) | \n| 05 | **Deno Edge Functions & Webhooks** | 14 | 9 | 5 | [`05-edge-functions.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/05-edge-functions.json) | \n| 06 | **Client Bundles, `.env` & Secrets** | 12 | 10 | 2 | [`06-client-secrets.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/06-client-secrets.json) | \n| 07 | **Realtime, PostgREST & RPC** | 10 | 5 | 5 | [`07-realtime-rpc.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/07-realtime-rpc.json) | \n| 08 | **Vibe-Coded Business Logic (Lovable/Bolt/v0)** | 12 | 5 | 7 | [`08-vibe-business-logic.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/08-vibe-business-logic.json) | \n| 09 | **Next.js SSR, Middleware & Server Actions** | 10 | 4 | 6 | [`09-nextjs-ssr-api.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/09-nextjs-ssr-api.json) | \n| 10 | **Supabase Config & Deployment** | 10 | 8 | 2 | [`10-config-deployment.json`](https://github.com/hermes-lekkas/supalock/blob/main/patterns/10-config-deployment.json) | \n|  | **Total** | **128** | **76** | **52** | [**Browse Full Index →**](https://github.com/hermes-lekkas/supalock/blob/main/patterns/README.md) | \n\n**Zero inflation guarantee:** Our CI suite ([`tests/test_catalog.py`](https://github.com/hermes-lekkas/supalock/blob/main/tests/test_catalog.py)) enforces exact 1:1 parity between the 76 patterns tagged `static+agent` in the catalog and the static rules actually implemented in [`supalock/rules/`](https://github.com/hermes-lekkas/supalock/blob/main/supalock/rules).\n\n| Skill | Purpose | Patterns Covered | \n|---|---|---|\n| [`supalock-audit`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-audit/SKILL.md) | Master orchestrator — runs CLI scan + semantic review + prioritized fix plan | All 128 patterns | \n| [`supalock-rls`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-rls/SKILL.md) | Table-by-table RLS matrix, views ( `security_invoker` ),`SECURITY DEFINER` hardening | `SUPA-RLS-001..020` ,`SUPA-PG-001..014` | \n| [`supalock-storage`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-storage/SKILL.md) | Public/private buckets, `storage.foldername` , SVG XSS, MIME/size limits, signed URLs | `SUPA-STG-001..012` | \n| [`supalock-auth`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-auth/SKILL.md) | `getUser()` vs`getSession()` ,`user_metadata` , open redirects, SSR & Server Actions | `SUPA-AUTH-001..014` ,`SUPA-SSR-001..010` | \n| [`supalock-edge-functions`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-edge-functions/SKILL.md) | JWT verification, Stripe webhooks, CORS, SSRF, AI billing drain, rate limiting | `SUPA-EDGE-001..014` | \n| [`supalock-secrets-client`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-secrets-client/SKILL.md) | `service_role` leaks, JWT decoding, Realtime publications, PostgREST injection,`config.toml` | `SUPA-SEC-001..012` ,`SUPA-RT-001..010` ,`SUPA-CFG-001..010` | \n| [`supalock-vibe-patterns`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-vibe-patterns/SKILL.md) | Lovable/Bolt/v0/Cursor flaws: billing mutation, race-condition credits, paywall bypass | `SUPA-VIBE-001..012` | \n| [`supalock-fix`](https://github.com/hermes-lekkas/supalock/blob/main/skills/supalock-fix/SKILL.md) | Generates idempotent SQL migrations, minimal code diffs, and curl/pgTAP proofs | Remediation & verification | \n\n**Slash Commands:** [`/supalock-audit`](https://github.com/hermes-lekkas/supalock/blob/main/commands/supalock-audit.md) · [`/supalock-rls`](https://github.com/hermes-lekkas/supalock/blob/main/commands/supalock-rls.md) · [`/supalock-fix`](https://github.com/hermes-lekkas/supalock/blob/main/commands/supalock-fix.md) · `/supalock-prelaunch`\n\n```\n# Scan a directory with terminal output\nsupalock scan .\n\n# Output GitHub Code Scanning SARIF 2.1.0, JSON, or Markdown PR report\nsupalock scan . --format sarif --output supalock.sarif\nsupalock scan . --format markdown --output audit-report.md\nsupalock scan . --format json --fail-on high\n\n# Deep-dive any pattern with vulnerable example, exploit scenario, and copy-pasteable fix\nsupalock explain SUPA-RLS-009\n\n# Filter the 128-pattern catalog\nsupalock list --severity critical\nsupalock list --category rls-policies --detection static+agent\n\n# Print catalog statistics\nsupalock stats\n\n# Generate a ready-to-commit GitHub Actions workflow with SARIF upload\nsupalock init-ci > .github/workflows/supalock.yml\n```\n\nIf a table is intentionally public (e.g., a marketing blog posts table), suppress a specific rule inline with a reason:\n\n```\n-- supalock-ignore: SUPA-RLS-003 (intentional public marketing catalog)\nCREATE POLICY \"Public read blog posts\" ON public.blog_posts FOR SELECT TO anon, authenticated USING (true);\n```\n\nSupalock also avoids common scanner false positives out of the box:\n\n- **Cross-migration RLS tracking:** creating a table in`001_init.sql` and enabling RLS in`002_rls.sql` will**not** trigger`SUPA-RLS-001` .\n- **JWT payload decoding:** base64-decodes hardcoded Supabase JWTs to distinguish harmless`anon` keys from catastrophic`service_role` keys.\n- **`TO service_role` awareness:** does not flag`USING (true)` on policies restricted exclusively to`service_role` .\n- **Template env awareness:** ignores placeholder values and`.env.example` /`.env.template` files.\n\nRun `supalock init-ci` or add `.github/workflows/supalock.yml`:\n\n```\nname: Supalock Security Audit\non: [push, pull_request]\n\njobs:\n  supalock:\n    runs-on: ubuntu-latest\n    permissions:\n      security-events: write\n      contents: read\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-python@v5\n        with:\n          python-version: \"3.12\"\n      - name: Install Supalock\n        run: pip install git+https://github.com/Hermes-Lekkas/supalock.git\n      - name: Run Supalock Static Scan\n        run: supalock scan . --format sarif --output supalock.sarif --fail-on high\n      - name: Upload SARIF to GitHub Security\n        if: always()\n        uses: github/codeql-action/upload-sarif@v3\n        with:\n          sarif_file: supalock.sarif\nsupalock/\n├── patterns/                  # 128 curated vulnerability patterns (10 JSON files + index)\n├── supalock/                  # Zero-dependency Python 3.9+ CLI static analyzer\n│   ├── rules/\n│   │   ├── sql_rules.py       # Cross-migration SQL/RLS/Postgres/Storage/Realtime analyzer\n│   │   ├── code_rules.py      # TS/JS/Next.js/Deno Edge Function/Vibe-pattern analyzer\n│   │   └── config_rules.py    # .env, supabase/config.toml, next.config, CI analyzer\n│   ├── scanner.py             # Directory walker, inline suppressions, scoring & grading\n│   ├── formatters.py          # Terminal, JSON, Markdown, and SARIF 2.1.0 formatters\n│   └── cli.py                 # scan, list, explain, stats, init-ci commands\n├── skills/                    # 8 Open Agent Skills (SKILL.md standard)\n├── commands/                  # 4 slash commands for Claude Code & compatible agents\n├── .claude-plugin/            # Claude Code plugin & marketplace manifests\n├── .cursor/rules/             # Scoped Cursor .mdc guardrails\n├── install.sh                 # Multi-agent installer (--global, --project, --uninstall)\n├── examples/\n│   ├── vulnerable-vibe-saas/  # Demo app with 46 detected leaks (Score: 0/100, Grade F)\n│   └── hardened-vibe-saas/    # Hardened counterpart (Score: 100/100, Grade A, 0 findings)\n└── tests/                     # 32 unit, catalog parity, installer & E2E tests\n```\n\nContributions of new real-world Supabase & vibe-coded vulnerability patterns are warmly welcome! See [CONTRIBUTING.md](https://github.com/hermes-lekkas/supalock/blob/main/CONTRIBUTING.md).\n\nReleased under the [MIT License](https://github.com/hermes-lekkas/supalock/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-supalock-open-source-security-scanner-and-agent-skills-for-supabase", "canonical_source": "https://github.com/hermes-lekkas/supalock", "published_at": "2026-11-29 21:35:26+00:00", "updated_at": "2026-11-29 21:45:53.638777+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-safety"], "entities": ["Supalock", "Hermes Lekkas", "Supabase", "Claude Code", "Cursor", "GitHub Copilot", "Lovable", "Windsurf"], "also_reported_by": [], "takeaway": "Supalock installs as 8 Open Agent Skills plus 4 slash commands (/supalock-audit, /supalock-rls, /supalock-fix, /supalock-prelaunch) into Claude Code, Cursor, Codex, Antigravity, Gemini CLI, Copilot, Cline and Windsurf, and runs 76 static checks plus 52 agent-guided reviews against 128 Supabase vulne", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-supalock-open-source-security-scanner-and-agent-skills-for-supabase", "markdown": "https://wpnews.pro/news/show-hn-supalock-open-source-security-scanner-and-agent-skills-for-supabase.md", "text": "https://wpnews.pro/news/show-hn-supalock-open-source-security-scanner-and-agent-skills-for-supabase.txt", "jsonld": "https://wpnews.pro/news/show-hn-supalock-open-source-security-scanner-and-agent-skills-for-supabase.jsonld"}}