nodejs-security-audit
Installation
SKILL.md
Node.js Security Audit
Structured security audit for Node.js HTTP servers and web applications.
Audit Checklist
Critical (Must Fix Before Deploy)
Hardcoded Secrets
- Search for: API keys, passwords, tokens in source code
- Pattern:
grep -rn "password\|secret\|token\|apikey\|api_key" --include="*.js" --include="*.ts" | grep -v node_modules | grep -v "process.env\|\.env" - Fix: Move to env vars, fail if missing:
if (!process.env.SECRET) process.exit(1);
XSS in Dynamic Content
- Search for:
innerHTML, template literals injected into DOM, unsanitized user input in responses - Fix: Use
textContent, or escape:str.replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":"'"}[c]))