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

padlock-cli

v0.1.0

Published

Database & backend security auditor — lock down your data layer

Downloads

10

Readme

🔒 Padlock

Database & backend security auditor — lock down your data layer.

Padlock audits the part most security tools miss: your database configuration, access controls, migrations, and infrastructure security. It detects missing RLS, exposed service keys, dangerous migrations, PII without protection, and more.

Quick Start

npx padlock-cli audit .

That's it. Padlock auto-detects your database stack and scans for security issues.

What It Catches

| Category | Severity | Examples | |----------|----------|---------| | Access Control | CRITICAL | Missing RLS, no policies, anon write access | | Migration Safety | HIGH | DROP TABLE, TRUNCATE, numbering gaps | | Data Protection | HIGH | PII columns, plaintext passwords | | Connection Security | HIGH | SSL disabled, hardcoded connection strings | | Key Management | CRITICAL | Service role key in client code, public env vars | | Query Safety | MEDIUM | SQL injection, unbounded SELECT, SELECT * | | Realtime Security | MEDIUM | Unfiltered subscriptions, broad access | | Storage Security | MEDIUM | Public buckets, long-lived signed URLs | | Environment Hygiene | HIGH | .env in git history, missing .gitignore | | LLM Infrastructure | CRITICAL | Exposed Ollama, API keys in client code |

CLI Usage

# Auto-detect stack, scan project
padlock audit .

# Force a specific stack
padlock audit . --stack supabase

# JSON output for CI/automation
padlock audit . --format json

# Filter by severity
padlock audit . --severity critical

# CI mode — exit code 1 if critical findings
padlock audit . --ci

Example Output

🔒 Padlock v0.1.0

Stack: supabase (Found dependency: @supabase/supabase-js)
Detected: 7 tables, 9 migrations

Padlock Score: 42/100 (F)

🔴 CRITICAL
  [AC-1] No RLS on table: access_grants
  [AC-1] No RLS on table: conversations
  [KM-1] Service role key used in client-facing code: src/lib/db.ts

🟠 HIGH
  [AC-2] RLS enabled but no policies on table: waitlist
  [EH-1] Deleted .env file found in git history: .env.prod

🟡 MEDIUM
  [DP-1] PII column detected: waitlist.email
  [QS-2] Potentially unbounded SELECT in app/api/route.ts:45

5 critical · 2 high · 3 medium

Scoring

| Grade | Score | Meaning | |-------|-------|---------| | A | 90-100 | Solid security posture | | B | 80-89 | Good, minor improvements needed | | C | 70-79 | Fair, several issues to address | | D | 60-69 | Poor, significant gaps | | F | <60 | Critical issues need immediate attention |

Deductions:

  • Critical: -15 points
  • High: -10 points
  • Medium: -5 points
  • Low: -2 points

Supported Stacks (v0.1)

  • Supabase — Full support (RLS, policies, migrations, storage, realtime)

Coming soon: PostgreSQL, Prisma, Drizzle, MongoDB, Firebase, PlanetScale, Redis

Rule IDs

| ID | Category | Description | |----|----------|-------------| | AC-1 | Access Control | No RLS on table | | AC-2 | Access Control | RLS enabled but no policies | | AC-3 | Access Control | Anon role has write access | | AC-4 | Access Control | Overly permissive policy (USING true for write) | | AC-5 | Access Control | Anon broad read on sensitive table | | MS-1 | Migration Safety | Destructive operation (DROP, TRUNCATE) | | MS-2 | Migration Safety | Migration numbering gap | | MS-3 | Migration Safety | Foreign key without ON DELETE | | MS-4 | Migration Safety | No index on foreign key column | | DP-1 | Data Protection | PII column detected | | DP-2 | Data Protection | Possible plaintext secret storage | | CS-1 | Connection Security | SSL disabled | | CS-2 | Connection Security | Hardcoded connection string | | CS-3 | Connection Security | Service bound to 0.0.0.0 | | KM-1 | Key Management | Service role key in client code | | KM-2 | Key Management | Secret key in NEXT_PUBLIC_ env var | | KM-3 | Key Management | Hardcoded fallback secret | | QS-1 | Query Safety | SQL injection risk (string interpolation) | | QS-2 | Query Safety | Unbounded SELECT | | QS-3 | Query Safety | SELECT * in production code | | RT-1 | Realtime Security | Subscription on broadly accessible table | | RT-2 | Realtime Security | Subscription without filter | | RT-3 | Realtime Security | Realtime enabled without table restrictions | | SS-1 | Storage Security | Public storage bucket | | SS-2 | Storage Security | Cloud storage URL in source | | SS-3 | Storage Security | Signed URL with long expiration | | EH-1 | Environment Hygiene | Deleted .env file in git history | | EH-2 | Environment Hygiene | .gitignore missing .env patterns | | EH-3 | Environment Hygiene | No .env.example file | | EH-4 | Environment Hygiene | .env file tracked in git | | LLM-1 | LLM Infrastructure | LLM service on public interface | | LLM-2 | LLM Infrastructure | LLM API key in client code | | LLM-3 | LLM Infrastructure | LLM key in NEXT_PUBLIC_ env var | | LLM-4 | LLM Infrastructure | System prompts in unprotected table |

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Dev mode
npx tsx src/index.ts audit /path/to/project

License

MIT