Local-first Application Security Scanner β finds secrets, vulnerabilities, misconfigs, and access-control bugs in your codebase. Runs entirely on your machine. Nothing leaves your computer.
- π Three scanner layers β static code, live runtime, and authenticated access-control testing
- πΊοΈ OWASP Top 10:2025 mapped β every finding links to a category, CWE, and remediation
- π Privacy first β no telemetry, no cloud upload, secrets redacted in all outputs
- π¦ CI-ready β SARIF output, baseline diffing, GitHub Actions workflow included
- π€ AI-security aware β detects prompt injection, LLM output XSS, unsafe tool calls
- β‘ Fast β scans < 500 files in under 5 seconds
- π₯οΈ VS Code extension β inline diagnostics in your editor as you work
npx cybermat scan .No install required. Node β₯18.
npm install -g cybermat
cd your-project
cybermat scan .git clone https://github.com/Martysunshine/cybermat-shield.git
cd cybermat-shield
pnpm install && pnpm build
node packages/cli/dist/index.js scan examples/vulnerable-next-appScans your source files without running anything.
| What it detects | Details |
|---|---|
| π Secrets & API keys | 66 detectors β AWS, Stripe, OpenAI, Supabase, Firebase, Twilio, and 60+ more |
| π Injection sinks | XSS (dangerouslySetInnerHTML, innerHTML), SQL injection, eval, exec, SSRF |
| πͺ Missing auth guards | Unprotected routes, missing middleware, IDOR-prone patterns |
| π¦ Supply chain risks | Lifecycle scripts, wildcard versions, missing lockfile |
| βοΈ Misconfigurations | CORS wildcards, source maps in prod, disabled RLS, weak Firebase rules |
| π€ AI security | Prompt injection, LLM output rendered as HTML, tool calls without approval |
Spins up a real browser, crawls your app, and probes it safely.
| What it detects | Details |
|---|---|
| π‘οΈ Missing security headers | CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy |
| πͺ Insecure cookies | Missing HttpOnly/Secure/SameSite, JWT values in cookies, long expiry |
| π CORS misconfigs | Reflected origins, wildcard + credentials, dev origins in production |
| π Open redirects | Tests 7 common redirect params (next, returnUrl, callbackUrl, etc.) |
| π Exposed sensitive files | .env, .git/config, swagger.json, package.json, and 11 more |
| πͺ Reflected input | Harmless marker injection β detects HTML/attribute/script/JSON reflection |
Makes real authenticated requests to find broken access control.
| What it detects | Details |
|---|---|
| π· Anonymous route access | Protected routes accessible without any authentication |
| β¬οΈ Vertical privilege escalation | Regular user accessing admin-only routes |
| π Horizontal IDOR | UserA reading/accessing UserB's resources |
| π’ Tenant boundary issues | Cross-org/tenant resource access via predictable IDs |
# ββ Static scanning ββββββββββββββββββββββββββββββββββββββββββ
cybermat scan <path> # Scan a project directory
cybermat scan <path> --sarif # Also output SARIF (GitHub Code Scanning)
cybermat scan <path> --markdown # Also output Markdown report
cybermat scan <path> --fail-on high # Exit 1 if any HIGH or above findings
cybermat scan <path> --ci # CI mode β exit 5 if new vs baseline
# ββ Runtime scanning βββββββββββββββββββββββββββββββββββββββββ
cybermat scan-runtime <url> # Crawl + probe a live app
cybermat scan-runtime <url> --max-pages 10
# ββ Auth/access-control scanning βββββββββββββββββββββββββββββ
cybermat scan-auth <url> # Run access-control tests
cybermat auth init # Create auth config template
cybermat auth test-config # Validate auth profiles
# ββ Rules ββββββββββββββββββββββββββββββββββββββββββββββββββββ
cybermat rules list # List all 120+ rules
cybermat rules list --owasp A01 # Filter by OWASP category
cybermat rules list --engine secrets # Filter by engine
cybermat rules show <id> # Full rule detail + examples
cybermat rules docs # Generate docs/rules.md
# ββ Project setup ββββββββββββββββββββββββββββββββββββββββββββ
cybermat init # Create .cybermatignore + cybermat.config.json
cybermat doctor # Check Node, pnpm, Playwright, config
cybermat config validate # Validate cybermat.config.json
# ββ Baseline diffing βββββββββββββββββββββββββββββββββββββββββ
cybermat baseline create # Snapshot current findings
cybermat baseline compare # Show new / fixed / existing vs snapshot
# ββ Reports ββββββββββββββββββββββββββββββββββββββββββββββββββ
cybermat report --sarif # Generate SARIF from saved report.json
cybermat report --markdown # Generate Markdown from saved report.json
cybermat report --all # Generate all formatsThe auth scanner needs real session cookies for your test accounts. Here's how to set it up against the built-in vulnerable app:
cd examples/vulnerable-next-app
npx next dev
# β http://localhost:3000# From repo root (Terminal 2)
npx tsx --tsconfig scripts/tsconfig.json scripts/setup-auth-profiles.tsThis logs in as each test user via Playwright and saves sessions to .cybermat/auth/.
# Always run both commands together β sessions reset on hot-reload!
npx tsx --tsconfig scripts/tsconfig.json scripts/setup-auth-profiles.ts && \
node packages/cli/dist/index.js scan-auth http://localhost:3000
β οΈ Important: The test app uses in-memory sessions. They reset whenever the Next.js dev server restarts or hot-reloads. Always runsetup-auth-profiles.tsandscan-authin the same command chain.
Test accounts (all passwords are fake):
| Profile | Password | Role | |
|---|---|---|---|
| π€ userA | usera@test.com | password123 | user |
| π€ userB | userb@test.com | password123 | user |
| π admin | admin@test.com | admin123 | admin |
Run cybermat init to create cybermat.config.json:
{
"version": 1,
"failOn": "high",
"rules": {
"disabled": ["secrets/generic-api-key"],
"severityOverrides": {
"supply-chain/wildcard-dependency": "high"
}
},
"scan": {
"maxFileSizeKb": 512,
"skipDirs": ["node_modules", ".next", "dist"]
},
"runtime": {
"maxPages": 20,
"maxDepth": 3,
"requestDelayMs": 150
}
}Full reference β docs/configuration.md
Push the included workflow and get SARIF results in your GitHub Security tab automatically:
.github/workflows/cybermat-scan.yml β already included
On every push and PR it will:
- β
Run
cybermat scan - π€ Upload SARIF to GitHub Code Scanning
- π¬ Post a findings summary comment on the PR
- π Report findings without blocking CI by default (set
--fail-on highto enable hard-fail)
Exit codes:
| Code | Meaning |
|---|---|
0 |
Clean β no findings at or above threshold |
1 |
Findings detected |
2 |
Scan error |
3 |
Config error |
4 |
Missing dependency |
5 |
New findings vs baseline (CI mode) |
Full guide β docs/ci.md
| # | Category | Covered by |
|---|---|---|
| A01 | Broken Access Control | Static (missing guards) + Auth (IDOR, privilege escalation) |
| A02 | Security Misconfiguration | Static (CORS, headers) + Runtime (headers, cookies) |
| A03 | Software Supply Chain | Static (lifecycle scripts, wildcard deps, missing lockfile) |
| A04 | Cryptographic Failures | Static (66 secret detectors, localStorage tokens) |
| A05 | Injection | Static (XSS, SQL, command, eval, SSRF) |
| A06 | Insecure Design | Static (AI tool calls, system prompt injection) |
| A07 | Authentication Failures | Static + Runtime + Auth (anonymous route access) |
| A08 | Data Integrity Failures | Static (webhook secrets, AI tool misuse) |
Secrets are never stored raw in any report. The format is:
sk-ant-api03-...wxyz β you see enough to identify it, not enough to use it
Values β₯ 8 chars β first 4 + ... + last 4
Values < 8 chars β fully masked as [REDACTED]
Create .cybermatignore in your project root:
# Ignore a directory
test/fixtures/
# Ignore a specific rule everywhere
rule:secrets/generic-api-key
# Ignore one specific finding (copy fingerprint from report.json)
fp:a1b2c3d4e5f6
# Wildcard
docs/*
packages/
shared/ Core types (Finding, ScanReport, RuntimeFinding, AuthzFindingβ¦)
analyzers/ File inventory, stack detection, AST analysis, route discovery
engines/ Scanner engines β secrets, static-code, runtime, authz
rules/ 95 rules across 9 packs with OWASP/CWE metadata
core/ Orchestrator β runScan(), runRuntimeScan(), runAuthScan()
cli/ Commander.js CLI entry point
vscode/ VS Code extension β inline diagnostics, status bar, auto-scan on save
examples/
vulnerable-next-app/ Intentionally vulnerable Next.js app (all secrets are FAKE)
scripts/
setup-auth-profiles.ts Playwright login script β saves session cookies
docs/
product-architecture.md
internal-architecture.md
roadmap.md
rules.md (auto-generated β run cybermat rules docs)
auth-access-control-scanning.md
configuration.md
ci.md
safety-model.md
CyberMat Shield is read-only and non-destructive:
- π« Never sends POST/PUT/PATCH/DELETE
- π« Never requests URLs outside the configured origin
- π« Never brute-forces IDs or tokens
- π« Never stores or logs session credentials
- π« Never sends anything to external servers
- β
Only writes to
.cybermat/output directory
Full details β docs/safety-model.md
CyberMat Shield scans 60+ file extensions and 50+ special filenames.
| Language / File type | Coverage |
|---|---|
| TypeScript / JavaScript | Full AST analysis, source/sink correlation, secrets, patterns |
| Python | Pattern scanning + secrets (eval, exec, pickle, subprocess shell=True, yaml.load) |
| Go | Secrets |
| Java / Kotlin | Secrets |
| PHP | Pattern scanning + secrets (eval, shell_exec, unserialize) |
| Ruby | Secrets |
| Rust / C / C++ | Secrets |
| Shell scripts (.sh, .bash, .ps1) | Pattern scanning (curl|sh, eval, chmod 777, TLS bypass) |
| Dockerfile / Containerfile | Pattern scanning (curl|sh, ADD URL, ENV secrets, USER root) |
| Docker Compose (YAML) | Pattern scanning (privileged, docker.sock, host network) |
| Terraform / HCL | Pattern scanning (public S3, SSH/RDP open to world) |
| Kubernetes YAML | Pattern scanning (privileged, hostNetwork, hostPID, runAsRoot) |
| GitHub Actions / GitLab CI / CircleCI | Pattern scanning (curl|bash, pull_request_target unsafe checkout) |
| Jenkinsfile / Makefile / Procfile | Secrets |
| Environment files (.env, .env.local, etc.) | Secrets |
| JSON / YAML / TOML / XML / INI | Secrets + config misconfigurations |
| GraphQL / Prisma / SQL | Secrets |
| Certificates & keys (.pem, .key, .crt) | Secrets |
| go.mod / Cargo.toml / requirements.txt / pom.xml | Dependency + secrets |
| Firebase / Firestore / Supabase rules | Config misconfigurations |
Full AST analysis (import graph, source/sink correlation) is only for TypeScript/JavaScript. All other languages get pattern-based scanning and secret detection.
| Category | Supported |
|---|---|
| Languages | TypeScript, JavaScript, Python, Go, Java, PHP, Ruby, Rust, C/C++, Kotlin, Swift |
| Infrastructure | Docker, Terraform, Kubernetes, HCL, Shell/Bash, PowerShell |
| Frameworks | Next.js, React, Express, Node.js, Fastify, NestJS, Vue, Svelte, Astro |
| Auth | Clerk, NextAuth/Auth.js, Supabase Auth, Firebase Auth |
| Databases | PostgreSQL, MySQL, MongoDB, Redis, Supabase, Firebase |
| Payments | Stripe, PayPal, Lemon Squeezy |
| AI Providers | OpenAI, Anthropic, Google Gemini, Mistral, Groq, ElevenLabs, HuggingFace, Replicate, Together AI |
| Platforms | Vercel, Netlify, Cloudflare |
| Comms | Resend, SendGrid, Mailgun, Twilio, Slack, Discord, Telegram |
We'd love your help! Check CONTRIBUTING.md for the full guide.
# Get started
git clone https://github.com/Martysunshine/cybermat-shield.git
cd cybermat-shield
pnpm install && pnpm build
# Run tests
npx tsx --test packages/engines/src/runtime-engine/__tests__/runtime.test.ts
npx tsx --test packages/engines/src/authz-engine/__tests__/authz.test.ts
# Try it on the vulnerable app
node packages/cli/dist/index.js scan examples/vulnerable-next-appAll secrets in
examples/are fake test values. Never commit real credentials.
| Phase | What was built |
|---|---|
| β 1 β MVP Foundation | Static scanner, Commander.js CLI, JSON + HTML reports |
| β 2 β Architecture Hardening | 66 secret detectors, engines layer, .cybermatignore |
| β 3 β Three-Layer Architecture | Code/Runtime/Authz separation, ScanPlanner, docs |
| β 4 β Deep Static Analysis | AST analysis, source/sink correlation, route discovery |
| β 5 β Rule Pack System | RuleRegistry, 9 RulePacks, 95 rules, OWASP mapping |
| β 6 β Safe Runtime Scanner | Playwright crawler, 8 analyzers, 48 unit tests |
| β 7 β Auth/Access-Control | IDOR, vertical privilege, anonymous route testing, 38 unit tests |
| β 8 β Productionization | SARIF, baseline diffing, GitHub Actions, npm packaging |
| β v0.2.0 β Multi-language | 60+ extensions, language classifier, 28 multilang detectors, entropy scoring, fingerprints |
| β Step 3 β VS Code Extension | Inline diagnostics, status bar, auto-scan on save, F5 launch config |
MIT Β© CyberMat Shield Contributors