npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rls-lint

v0.1.2

Published

Static security linter for Supabase Row Level Security policies. Catch multi-tenant data leaks before you ship.

Downloads

26

Readme


Catch multi-tenant data leaks before you ship. rls-lint analyzes your Supabase SQL migration files offline — zero network calls, zero database connections — and flags RLS misconfigurations that could expose data across tenants.

Quickstart

# Run against your Supabase migrations
npx rls-lint ./supabase/migrations

# Run against a single file
npx rls-lint ./supabase/migrations/20250101_create_users.sql

Example

  rls-lint report
  ═══════════════

  🔴 RLS-001  Missing RLS on table 'customer_notes'
               missing-rls.sql:1

  🔴 RLS-002  Policy 'products_public_read' uses USING(true) — open to everyone
               using-true.sql:11

  🟡 RLS-003  Policy 'articles_published_read' has no tenant-scoping column
               no-tenant-scope.sql:12

  🔴 RLS-004  GRANT BYPASS RLS found on role(s): 'postgres'
               bypass-rls.sql:1

  🟡 RLS-005  Policy 'documents_all_access' uses FOR ALL
               for-all.sql:12

  ────────────────────────────────────────
  ✘ 3 critical, 2 warnings  |  5 total

Rules

| ID | Rule | Severity | |----|------|----------| | RLS-001 | Table created without ALTER TABLE ... ENABLE ROW LEVEL SECURITY | 🔴 critical | | RLS-002 | Policy uses USING (true) or WITH CHECK (true) | 🔴 critical | | RLS-003 | Policy doesn't reference a tenant-scoping column (tenant_id, org_id, user_id, auth.uid()) | 🟡 warning | | RLS-004 | GRANT BYPASS RLS detected — bypasses all policies | 🔴 critical | | RLS-005 | Policy uses FOR ALL instead of a specific command (FOR SELECT, FOR INSERT, etc.) | 🟡 warning |

Exit Codes

| Code | Meaning | |------|---------| | 0 | No critical findings (warnings OK) | | 1 | Critical findings detected — fail CI builds | | 2 | Invalid path or no .sql files found |

Try It Right Now

git clone https://github.com/NavjotSingh-ca/rls-lint.git
cd rls-lint
npm install
npm run build
npm test

The repo includes 6 test fixture files in test-fixtures/ — 5 intentionally broken and 1 clean — so you can see exactly what each rule catches:

node dist/cli.js ./test-fixtures
# → 4 critical, 6 warnings (exit code 1)

node dist/cli.js ./test-fixtures/clean.sql
# → ✅ No issues found (exit code 0)

Use in CI (GitHub Actions)

name: Lint RLS policies
on: [push, pull_request]

jobs:
  rls-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npx rls-lint ./supabase/migrations

Known Limitations

  • PostgreSQL only — No MySQL, SQLite, or other dialect support.
  • RLS-003 is heuristic — Checks for common column name patterns only. A policy that uses subqueries or JOINs for tenant scoping (e.g., USING (org_id IN (SELECT ...))) won't be recognized (false negative).
  • No live DB connection — Pure static analysis. Cannot detect policies modified outside migration files or verify that policies actually compile.
  • Complex PL/pgSQL may cause parse warnings — individual unparseable statements are skipped; the rest of the file is still analyzed.

Roadmap

  • [ ] GitHub Action composite action — official rls-lint-action for one-line CI setup
  • [ ] SARIF output — GitHub code scanning integration (--format sarif)
  • [ ] JSON output — machine-readable results for custom CI pipelines (--format json)
  • [ ] Auto-fix suggestions — print the corrected ALTER TABLE or CREATE POLICY statement
  • [ ] Live DB check mode — connect to a Supabase project and audit current policies (--live)
  • [ ] VS Code extension — inline diagnostics as you edit migration files

Contributing

Contributions welcome! See open issues for what needs work.

License

MIT