ai-code-audit-lite
v1.0.1
Published
Zero-dependency CLI security scanner & Open-Core Agent Skills (Claude Code, Cursor, Codex) for catching AI-generated code traps, secret leaks, Next.js/MCP/SQL sinks, and CI/CD exploits.
Maintainers
Readme
ai-code-audit-lite
Zero-dependency CLI security scanner + Open-Core Agent Skills for catching AI-generated ("vibe-coded") vulnerabilities, auth/injection sinks, Next.js leaks, Docker/Terraform traps, and GitHub Actions supply-chain exploits—before you merge.
Works out of the box with Node.js 20+ (npx, zero npm dependencies) and installs 2 free Agent Skills directly into Claude Code, Cursor, OpenAI Codex, Antigravity, and Gemini CLI.
Quick Start (Zero Dependencies)
# 1. Scan the current repository
npx ai-code-audit-lite scan .
# 2. Scan only your current git diff and fail CI on High/Critical findings
npx ai-code-audit-lite scan . --diff --fail-on high
# 3. Export SARIF 2.1.0 for GitHub Code Scanning
npx ai-code-audit-lite scan . --sarif > ai-audit.sarif
# 4. Install the 2 FREE Open-Core Agent Skills into Claude Code, Cursor, Codex, Antigravity, Gemini CLI, etc.
npx skills add aymenkani/ai-code-audit-lite
# Or using the built-in CLI installer:
npx ai-code-audit-lite init --target claude # or: cursor | codex | gemini | agents | allTry it immediately on the bundled intentionally vulnerable demo:
npm run demoExample Output
ai-code-audit-lite — Fast Pre-Ship Security Scan
Target: .../examples/vulnerable-demo | Scanned: 4 file(s) | Rules: 18
[CRITICAL] ACA-017 (CWE-829) GitHub Actions pull_request_target Checkout (Pwn Request RCE)
Location : .github/workflows/pr-triage.yml:12
Match : ref: ${{ github.event.pull_request.head.sha }}
Fix : Use `on: pull_request` for running PR code, or never check out PR head inside `pull_request_target`.
[CRITICAL] ACA-001 (CWE-798) Hardcoded Fallback Secret in Auth/Signing Expression
Location : api.ts:6
Match : const JWT_SECRET = process.env.JWT_SECRET || "dev-secret-do-not-use";
Fix : Fail closed at startup when required secrets are missing instead of falling back to a hardcoded string.
[CRITICAL] ACA-006 (CWE-347) JWT Decoded Without Signature Verification
Location : api.ts:14
Match : return jwt.decode(token);
Fix : Use `jwt.verify(token, key, { algorithms: ['RS256'] })` with pinned algorithms, issuer, and audience.
Summary: 7 Critical | 6 High | 2 Medium | 0 LowBuilt-In Static Rules (18 High-Signal Checks)
Run npx ai-code-audit-lite list-rules to inspect all rules:
| Category | Rules Covered |
| :--- | :--- |
| AI / Vibe-Code Traps | Hardcoded fallback secrets (\|\| 'dev-secret'), TLS bypass (rejectUnauthorized: false, verify=False), CORS * + credentials, silent empty catch {} |
| Secrets & Frontend Leaks | Committed live keys (sk_live_, ghp_, AKIA, PEM private keys), NEXT_PUBLIC_ / VITE_ secret-named env vars, unsanitized dangerouslySetInnerHTML |
| Auth & Crypto | jwt.decode() without verification, Math.random() in token/OTP/reset contexts, non-constant-time signature === expected comparisons |
| Injection Sinks | Prisma $queryRawUnsafe / Drizzle sql.raw / interpolated SQL, exec/shell: true/os.system command injection, eval() / new Function() |
| Docker & Terraform | Dockerfile ARG/ENV secrets & COPY .env, docker.sock / privileged: true, Terraform IAM "*" wildcards, 0.0.0.0/0, IMDSv1 (http_tokens = "optional") |
| GitHub Actions CI/CD | pull_request_target head checkout RCE, untrusted ${{ github.event.pull_request.title }} shell injection in run: |
Suppress intentional lines with // ai-audit-ignore (inline or previous line) or /* ai-audit-ignore-file */ on line 1.
GitHub Actions Integration (SARIF)
name: AI Code Security Pre-Check
on: [pull_request]
permissions:
contents: read
security-events: write
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Run ai-code-audit-lite
run: npx --yes ai-code-audit-lite scan . --sarif > results.sarif
- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarifOpen-Core Agent Skills Included (Free vs. Full Pro Suite)
Static regex checks catch fast single-line mistakes—but deep vulnerabilities (cross-file BOLA/IDOR, Supabase RLS USING vs. WITH CHECK, Next.js RSC prop leaks, RAG cross-tenant vector leaks, MCP OAuth 2.1 confused-deputy bugs, and Stripe TOCTOU race conditions) require an AI coding agent guided by structured security playbooks.
| Capability | Free Open-Core (ai-code-audit-lite) | Full Pro Pack ($15) | 3-in-1 Suite ($19) |
| :--- | :---: | :---: | :---: |
| Zero-dependency npx CLI scanner (18 rules, JSON, SARIF, --diff) | ✅ | ✅ | ✅ |
| security-audit-orchestrator (Recon, Threat Modeling, Routing) | ✅ | ✅ | ✅ |
| ai-generated-code-audit (Vibe-Coded PRs & Slopsquatting) | ✅ | ✅ | ✅ |
| llm-rag-security-audit (OWASP LLM Top 10, pgvector/Pinecone Isolation) | — | ✅ | ✅ |
| mcp-and-agent-tool-security (Tool Poisoning, OAuth 2.1, HITL Gates) | — | ✅ | ✅ |
| auth-session-oauth-audit & access-control-multitenancy-audit (RLS/BOLA) | — | ✅ | ✅ |
| injection-and-taint-analysis & ssrf-webhooks-and-api-abuse | — | ✅ | ✅ |
| frontend-nextjs-react-security & payments-and-business-logic-audit | — | ✅ | ✅ |
| secrets-iac-and-container-audit & cicd-and-supply-chain-audit | — | ✅ | ✅ |
| security-verification-and-remediation (False-Positive Gate + Exploit Tests) | — | ✅ | ✅ |
| 15 NestJS & Node.js Backend Architecture Skills (58 Playbooks) | — | — | ✅ |
| 4-Hour AI-Era Code Auditing Video Course + 12 Visual PDFs (180 Pages) | — | — | ✅ |
- Get all 13 Security Agent Skills (39 playbooks, 10,300+ lines) —
$15: AI Code Auditing & Full-Stack Security Pack - Get the 3-in-1 Autonomous Engineering & Security Suite (28 Agent Skills + 4-Hr Video Course) —
$19($37value): Autonomous Engineering & Security Suite
License
Apache-2.0 — see LICENSE.
