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

@carjms/rls-guard

v0.7.0

Published

Static Supabase Row Level Security scanner for migrations and CI

Readme

🛡 RLS Guard

Free Supabase Row Level Security scanner — paste your migration SQL, get an instant audit with fix SQL.

▶ Try it now: rls-guard-rose.vercel.app

Paste your supabase/migrations/*.sql and get findings in milliseconds — no signup, no upload:

Scan results with severity badges and fix SQL

Most Supabase data leaks come from the same handful of misconfigurations: tables exposed without RLS, USING (true) policies, INSERT policies without WITH CHECK, roles that bypass RLS, and views that silently bypass RLS. RLS Guard reconstructs the final state of pasted migrations—including policy, grant, role, function, and view changes—and scans for 13 of these classes, with fix SQL for each finding.

Why client-side matters

A security tool that uploads your schema is itself a security risk. RLS Guard runs entirely in your browser — your SQL is never uploaded, stored, or logged (verify in the network tab). It even flags service keys or connection strings accidentally pasted into SQL, without storing them.

Rules

| Rule | Detects | Severity | |---|---|---| | RLS-001 | Table in exposed schema without RLS enabled | Critical | | RLS-002 | RLS enabled but zero policies (silent lockout) | Medium | | RLS-003 | Always-true policy conditions (USING (true)) | High/Critical | | RLS-004 | INSERT policy missing WITH CHECK | High | | RLS-005 | Owner/tenant column never referenced by any policy | High | | RLS-006 | Write policies applied to PUBLIC role | High | | RLS-007 | Policy omits every row condition (PostgreSQL defaults it to TRUE) | High/Critical | | STORAGE-001 | Storage write policy is not constrained by bucket_id | High | | GRANT-001 | Write privileges granted to anon/public | High | | ROLE-001 | Database roles with SUPERUSER or BYPASSRLS | Critical | | FUNC-001 | SECURITY DEFINER functions with unpinned search_path | High | | VIEW-001 | Views without security_invoker (RLS bypass) | High | | SECRET-001 | Service keys / connection strings inside SQL | Critical |

Run locally

Any static server works:

npx serve .

Or use the engine directly in Node:

import { scanSql } from './scanner.js';
const report = scanSql(mySql);
console.log(report.score, report.findings);

Use in CI

Scan one migration, several ordered migrations, or stdin. The CLI exits with status 1 when it finds a Critical issue by default, so it can fail a CI job:

node cli.js supabase/migrations/*.sql
node cli.js --fail-on high supabase/migrations/*.sql
cat migration.sql | node cli.js --json
node cli.js --format markdown --output rls-guard-report.md supabase/migrations/*.sql
node cli.js --format sarif --output rls-guard.sarif supabase/migrations/*.sql
node cli.js --ignore-rule RLS-002 --fail-on high supabase/migrations/*.sql

--format accepts text, json, markdown, or GitHub Code Scanning-compatible sarif. --output writes a review-ready artifact for pull requests and audit records. --fail-on accepts critical, high, medium, or low. Repeat --ignore-rule RULE-ID only for rules your team has reviewed and accepted; ignored findings are removed from the report and exit-code decision, and the report records the ignored rule IDs and count. Findings never include matched secret values.

Run the pinned public package without installing it globally:

npx @carjms/[email protected] --fail-on high supabase/migrations/*.sql

Limitations (honest ones)

Regex-based static analysis on a lightweight SQL splitter — it does not implement the full PostgreSQL grammar, distinguish overloaded functions that share a name, or test live access. It only reconstructs the ordered SQL supplied in one scan. A clean scan is not a security guarantee. Treat it as a fast first pass, not an audit.

Found a false positive or a rule idea? Open an issue — feedback directly shapes the ruleset.

Never post keys, connection strings, customer data, or private migrations in an issue. Reduce rule feedback to synthetic SQL, or use the security policy for a private product vulnerability report.

Roadmap

  • [x] CI-ready CLI with severity thresholds and JSON output
  • [x] Migration state reconstruction for policy, grant, role, function, and view changes
  • [x] Storage object write-policy bucket checks
  • [x] SARIF output for GitHub Code Scanning
  • [x] Auditable per-rule exceptions for project-specific CI adoption

If any of these would be useful to you, a ⭐ and an issue telling me which one helps prioritize.

License

MIT