Security scan

From huzaifa525/claude-code-optimizer · View interactive version

Security scan is an AI agent skill from the GitHub repository huzaifa525/claude-code-optimizer. Use when the user wants a security audit, vulnerability scan, or asks about potential security issues.

How to use this skill

Skill file

Run a comprehensive security scan on the codebase.

Iron Law

No "probably safe." Verify or flag.

If you cannot confirm a pattern is secure, flag it. False positives are cheap. Missed vulnerabilities are not.

Scan Checklist

1. Hardcoded Secrets (CRITICAL)

grep -rn "password\s*=\|api_key\s*=\|secret\s*=\|token\s*=" src/
grep -rn "BEGIN.*PRIVATE KEY" .
grep -rn "sk-\|pk_\|ghp_\|gho_\|AKIA" src/

Also check for:

2. SQL Injection

3. XSS (Cross-Site Scripting)

4. Command Injection

5. Authentication & Authorization

6. Input Validation

7. Sensitive Data Exposure

8. Dependency Vulnerabilities

npm audit 2>/dev/null || pip audit 2>/dev/null || true

Check for known CVEs in dependencies.

9. Insecure Configuration

Anti-Rationalization

| Excuse | Rebuttal |

|--------|----------|

| "This is internal/admin-only code" | Internal code gets exposed via SSRF, insider threats, and supply chain attacks. Secure it. |

| "We're behind a firewall" | Firewalls fail. Defense in depth means every layer is secure. |

| "This secret is only in development" | Dev secrets leak to production. Use env vars and secret managers. |

| "Nobody would find this endpoint" | Security through obscurity is not security. Assume attackers find everything. |

| "The framework handles this automatically" | Verify. Frameworks have defaults, and defaults get overridden. |

| "This is a low-priority app" | Low-priority apps are pivot points. Attackers use them to reach high-priority systems. |

| "We'll fix it later" | Later never comes. Flag it now with severity. |

Pre-Delivery Checklist

Before presenting the report, verify:

Output Format

## Security Scan Report

### Critical (exploit risk — fix immediately)
- [file:line] [vulnerability] — [impact] — [fix]

### High (significant risk)
- [file:line] [vulnerability] — [impact] — [fix]

### Medium (moderate risk)
- [file:line] [vulnerability] — [impact] — [fix]

### Low (minor risk / hardening)
- [file:line] [issue] — [recommendation]

### Passed Checks
- [what looks good — acknowledge secure patterns]

### Prioritized Recommendations
1. [most urgent fix]
2. [next priority]
3. [etc.]

<!-- Skill by Huzefa Nalkheda Wala | github.com/huzaifa525 | claude-code-optimizer -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.