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

basesec

v0.2.0

Published

Fast, zero-config SAST CLI for JavaScript & TypeScript — Node.js backends and frontend frameworks. Detects SQLi, NoSQLi, XSS, DOM-based XSS, RCE, path traversal, secrets, and 60+ other vulnerabilities via AST + taint analysis. Includes runtime testing (DA

Maintainers

tavotsutavotsu

Keywords

saststatic-analysissecuritysecurity-scannersecurity-auditvulnerability-scannervulnerability-detectioncode-securitycode-analysiscode-qualitylintersecurity-linterastabstract-syntax-treetaint-analysisdata-flow-analysisstatic-code-analysisnodejsnodenode-jsjavascriptjstypescripttsbackendapi-securityexpressexpressjsnestjsfastifykoamongoosetypeormprismasql-injectionsqlinosql-injectionmongodb-injectionxsscross-site-scriptingcommand-injectionrceremote-code-executionpath-traversaldirectory-traversallfilocal-file-inclusionsecretssecret-scannersecret-detectionapi-keyshardcoded-secretscredentialsleaked-credentialscorscors-misconfigurationhelmetsecurity-headerscsrfauthenticationauthorizationauthjwtrate-limitingbrute-forcedosdenial-of-serviceowaspowasp-top-10cwecvesnyksemgrepeslint-securitydependency-checkvulnerable-dependenciessupply-chainsupply-chain-securityscasbomclicommand-linecommand-line-tooltooldevtoolsdeveloper-toolscici-cddevsecopsshift-leftsecure-codingsecure-codesecure-by-defaultcode-reviewautomated-reviewthreat-detectionthreat-modelingpenetration-testingpentestappsecapplication-securityinfoseccompliancegdprhipaapci-dsssoc2iso27001tsecnodejs-securitybackend-securityapirest-apigraphqlmicroservicesmonorepoopen-sourceossfreemitauditscannerdetectorreportersarifsarif-outputjsonhtml-reportmarkdownterminalrealtimefastzero-configzero-dependenciesframeworkframework-awareframework-detectionexpress-securitynestjs-securityfastify-securitykoa-securitymongoose-securitytypeorm-securityprisma-securityaiai-poweredllmopenaiollamagptmachine-learningmlintelligent-scanningfalse-positive-reductiondeveloper-experiencedxproductivityautomationreactreactjsreact-securitynextjs-securitynext-jsvuevuejsvue-securitynuxtangularangular-securitysveltesveltekitfrontendfrontend-securityfullstackfull-stack-securitydom-xssdom-based-xssclient-side-securityopen-redirectpostmessageinsecure-storageprototype-pollutionjsxsingle-file-componentvue-sfcdastiastruntime-testingruntime-securitydynamic-analysisblack-box-testing

Readme

Features

  • 65 Security Rules across 10 categories (SQL Injection, XSS, NoSQL Injection, Command Injection, Path Traversal, Authentication, Secrets, Error Handling, Misconfiguration, Dependency Checking) — including frontend DOM-based XSS, client-side secrets, open redirect, postMessage/insecure-storage, and framework rules for React/Next, Vue/Nuxt, Angular, and Svelte
  • Taint Analysis — tracks data flow from user input (req.query, req.body, useSearchParams(), location.search, route params, etc.) to dangerous sinks
  • Framework Detection — auto-detects Express, NestJS, Mongoose, TypeORM, Fastify, Koa, Prisma, React, Next.js, Vue, Nuxt, Angular, and Svelte
  • Single-File Components — parses .vue and .svelte files (script + template) with no extra dependencies
  • Dependency Checking — detects outdated packages with known CVEs, vulnerable dependencies (via pnpm/npm audit), unused dependencies, and lockfile mismatches
  • Sensitive File Protection — .env and credential files are completely ignored by default unless explicitly allowed with --read-env
  • Multiple Output Formats — Terminal (colored tables), JSON, SARIF, HTML, Markdown. Non-terminal formats auto-save to ~/.basesec/
  • Analysis Cache — hash-based per-file caching for 10x speedup on incremental scans
  • Worker Threads — multi-core parallel analysis for large codebases
  • Custom Rules — load external rule files (MJS/CJS) via .basesecrc
  • AI-Powered Analysis — enriches findings with AI explanations and detects suspicious taint flows (Ollama or OpenAI)
  • Runtime Testing / DAST (basesec dast) — tests a running app: passive checks for security headers, HSTS, CSP, CORS, cookie flags, stack traces and server banners (DAST-001–007), plus full-mode active checks that safely confirm SQL/NoSQL/command injection, path traversal, reflected XSS and open redirect (DAST-101–105, DAST-011) and flag unauthenticated sensitive endpoints (DAST-008); an opt-in burst probe checks for missing rate limiting (DAST-010). Endpoints come from your own code (no crawler), payloads are non-destructive, evidence is redacted, and a host allowlist blocks remote and cloud-metadata targets by default
  • Runtime Verification & IAST (scan --verify, --agent) — confirms static findings against the running app and marks them verified with request/response evidence; an optional in-process agent observes canaries reaching real sinks (child_process, pg/mysql2, mongodb, fs) to raise confidence to high with the exact sink location
  • Zero Configuration — works out of the box with sensible defaults

Quick Start

Install

npm install -g basesec
# or
pnpm add -g basesec
# or
yarn global add basesec

Scan

# Scan current directory
basesec scan

# Scan specific directory
basesec scan ./src

# JSON output (auto-saved to ~/.basesec/scan-<timestamp>.json)
basesec scan ./src --format json

# Custom output path
basesec scan ./src --format json --output report.json

# Only critical/high findings, strict exit code
basesec scan ./src --severity high --strict

Runtime testing (DAST)

Run basesec dast only against systems you own or are authorized to test.

# Inspect a running app (no source needed): headers, CSP, CORS, cookies, error pages
basesec dast http://localhost:3000

# Full mode: derive endpoints from your code and run safe, non-destructive active checks
basesec dast http://localhost:3000 --scan ./src

# Confirm static findings at runtime and mark them "verified"
basesec scan ./src --verify --target http://localhost:3000

See USAGE.md for full mode, the IAST agent and every flag.

Framework Support

| Framework | Auto-Detection | Notes | |---|---|---| | Express | Yes | Route handlers, middleware, res.send(), res.set() | | NestJS | Yes | Decorators (@Controller, @Get, etc.), guards | | Fastify | Yes | Route handlers, rate limit, helmet, CORS | | Koa | Yes | Context assignments (ctx.body), middleware | | Mongoose | Yes | Query chains, $where, lean() | | TypeORM | Yes | Query builder, raw queries | | Prisma | Yes | Raw queries ($queryRaw, $executeRaw) | | React / Next.js | Yes | dangerouslySetInnerHTML, JSX href/src, refs, NEXT_PUBLIC_ secrets, redirect() | | Vue / Nuxt | Yes | v-html, :href/:src, render-function innerHTML (.vue SFCs) | | Angular | Yes | bypassSecurityTrust*, nativeElement.innerHTML, [innerHTML], jsonp, router redirects, unguarded routes | | Svelte | Yes | {@html} (.svelte SFCs) |

Configuration

Create a .basesecrc file in your project root:

export default {
  severity: 'low',
  framework: 'auto',
  ignore: ['node_modules', 'dist', 'coverage'],
  taintAnalysis: true,
  sanitizers: [],
  rules: [],
  rulesConfig: {},
  maxFileSize: 512000,
  maxFiles: 10000,
  cache: {
    maxAge: 86400000,
    dir: '.basesec/cache',
  },
  workers: {
    threshold: 50,
    max: 8,
  },
  output: {
    format: 'terminal',
    filePath: '',
  },
  // AI disabled by default for maximum privacy
  ai: {
    enabled: false,
    provider: 'ollama',
    model: 'llama3.2',
    contextLevel: 'minimal',
    baseUrl: 'http://localhost:11434',
    maxFindings: 10,
    timeout: 30000,
  },
};

See CONFIGURATION.md for full options.

Performance

BaseSec uses two core optimizations:

  1. Analysis Cache (enabled by default) — SHA-256 file + config hashing, skips unchanged files
  2. Worker Threads (auto-enabled for >50 files) — parallel analysis across CPU cores

Combined, these deliver ~12x speedup on rescans. See PERFORMANCE.md for benchmark data.

Documentation

License

CC BY-NC 4.0 © tavotsu