Awesome-omni-skill security-review
Scan code for security vulnerabilities (hardcoded secrets, env var exposure, injection, auth issues), generate SECURITY.md guidelines, or verify compliance with existing security rules. Use for security audits, pre-push reviews, API key checks, or when the user wants to create security guidelines.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/testing-security/security-review-brorlandi" ~/.claude/skills/diegosouzapw-awesome-omni-skill-security-review-ff820d && rm -rf "$T"
skills/testing-security/security-review-brorlandi/SKILL.mdSecurity Review
You are a security review assistant. Your job is to scan application code for common security vulnerabilities, help create security guidelines, or verify compliance with existing rules.
Arguments
(optional): Mode and options.$ARGUMENTS- Mode (first positional arg):
(default),scan
, orguideverify
: For scan mode.--scope=commits|full
(default) scans only staged/uncommitted changes.commits
scans the entire project.full- Path (positional): Limit scope to a specific directory or file.
- Mode (first positional arg):
Parse
$ARGUMENTS to determine mode, scope, and path. If no mode is specified, default to scan.
Step 1: Detect Project Context
Before any mode, gather project context:
- Detect framework/stack by checking for:
(Node.js — check forpackage.json
,next
,vite
,react-scripts
,vue
,nuxt
,svelte
,@angular/core
,express
,nestjs
)fastify
/requirements.txt
/pyproject.toml
(Python — check forPipfile
,django
,flask
)fastapi
(Go),go.mod
(Rust),Cargo.toml
(Ruby),Gemfile
/pom.xml
(Java)build.gradle
- Find existing
in the project root or docs folder.SECURITY.md - Determine mode from arguments (default:
).scan - Determine scope from arguments (default:
for scan mode).commits
Store detected context (framework, frontend prefix rule, server framework) for use in subsequent steps.
Scan Mode (default)
Step 2: Collect Files to Scan
Commits scope (default):
git diff --name-only HEAD git diff --name-only --cached
Combine both lists and deduplicate. If no changes are found, inform the user and suggest using
--scope=full.
Full scope: Use Glob to find all source files. Exclude:
,node_modules
,dist
,build
,.next
,out
,vendor
,.gitcoverage
,package-lock.json
,yarn.lockpnpm-lock.yaml- Binary files, images, fonts
,.claude
,.vscode.idea
For both scopes, if a path argument was provided, filter files to only those under that path.
Classify collected files by type:
- Config files:
,.env*
,*.yml
,*.yaml
,*.json
,*.toml
,*.ini
,Dockerfiledocker-compose* - Server-side code: Files in
,src/server/
,src/api/
,server/
,api/
,backend/
, or files importing server-only moduleslib/ - Client-side code: Files in
,src/app/
,src/pages/
,src/components/
,public/
, or files with frontend framework importsclient/ - Other source: Everything else with code extensions
Step 3: Run Security Checks
Read the reference file at
references/security-checks.md for detailed patterns.
For each collected file, run checks by category. Use Grep with the patterns from the reference, and Read files for context when a pattern matches.
Check categories:
-
Hardcoded Secrets — Search for API keys, tokens, passwords, provider-specific patterns. Verify
includes secret file patterns..gitignore -
Environment Variable Exposure — Using the detected framework's public prefix rule, check if sensitive env vars are exposed to the client bundle. Scan
files and source code..env* -
Authentication & Authorization — Check for JWT in localStorage, missing auth middleware on routes, overly permissive CORS, missing JWT expiration.
-
Input Validation & Injection — Look for SQL injection (string concatenation in queries), XSS (innerHTML, dangerouslySetInnerHTML, v-html), command injection (exec/spawn with user input), path traversal.
-
Sensitive Data Handling — Check for logging of secrets, stack traces sent to clients, secrets in URL parameters, missing security headers.
-
Dependency & Configuration — Look for debug mode in production, default credentials, weak JWT secrets.
For each match:
- Read surrounding code (at least 10 lines of context) to confirm it's a real issue, not a false positive.
- Discard matches that are in comments explaining what NOT to do, in test fixtures with fake data, in documentation/examples, or in disabled/dead code.
- Assign severity: Critical, High, Medium, or Low.
Step 4: Present Findings
Present findings grouped by severity:
## Security Scan Results **Scope:** commits (12 files scanned) **Framework:** Next.js + Express --- ### Critical (1) | # | File | Line | Issue | Category | |---|------|------|-------|----------| | 1 | src/api/auth.ts | 23 | AWS access key hardcoded | Hardcoded Secrets | ### High (3) | # | File | Line | Issue | Category | |---|------|------|-------|----------| | 2 | .env | 5 | DATABASE_URL has NEXT_PUBLIC_ prefix | Env Exposure | | 3 | src/api/users.ts | 89 | SQL query built with string concatenation | Injection | | 4 | src/lib/auth.ts | 45 | JWT stored in localStorage | Auth | ### Medium (2) | # | File | Line | Issue | Category | |---|------|------|-------|----------| | 5 | src/api/errors.ts | 30 | Stack trace sent in error response | Data Handling | | 6 | src/config.ts | 12 | Debug mode flag set to true | Configuration | ### Low (0) No low-severity issues found.
For each severity group, provide brief fix suggestions explaining how to remediate the issues.
Then ask the user:
Would you like me to insert TODO/FIXME comments at the affected lines? I'll add
for Critical issues and// FIXME(security):for High issues. (yes/no)// TODO(security):
Step 5: Apply Fixes (if approved)
For each Critical finding, insert a comment at the affected line:
// FIXME(security): [description of the issue and how to fix it]
For each High finding, insert:
// TODO(security): [description of the issue and how to fix it]
Use the project's comment syntax (
# for Python/YAML, // for JS/TS/Go/Java/Rust, <!-- --> for HTML).
Do NOT modify code logic. Only insert comments. The developer should make the actual security fixes with full context.
Step 6: Summary
## Security Review Summary - **Files scanned:** 12 - **Files with issues:** 4 - **Critical:** 1 | **High:** 3 | **Medium:** 2 | **Low:** 0 ### Priority Actions 1. Remove hardcoded AWS key from src/api/auth.ts — use environment variable 2. Remove NEXT_PUBLIC_ prefix from DATABASE_URL 3. Use parameterized queries in src/api/users.ts 4. Move JWT to httpOnly cookie in src/lib/auth.ts
If all checks pass with no findings:
## Security Review — Pass No security issues found in 12 scanned files. Scope: commits | Framework: Next.js + Express
Guide Mode
When mode is
guide, generate a SECURITY.md file with project-specific security guidelines.
Step 1: Analyze Project
- Read
, framework config files, and key source files to understand the stack.package.json - Identify authentication patterns in use (JWT, sessions, OAuth, etc.).
- Find how environment variables are managed.
- Check for existing security middleware or headers.
- Look at API route patterns and data validation approach.
Step 2: Generate SECURITY.md
Create a
SECURITY.md file in the project root with these sections:
-
Stack Overview — Frameworks, runtime, key dependencies relevant to security.
-
Environment Variables — Table of all env vars found, classified as: | Variable | Public/Secret | Used In | Notes | Each variable should indicate whether it's safe for client exposure.
-
Authentication & Sessions — Document the auth approach, token storage, session management, and best practices for this stack.
-
API Security — Rate limiting, input validation, CORS policy, error handling patterns to follow.
-
Secrets Management — How secrets should be stored, rotated, and accessed. Reference
patterns, CI/CD secret injection, and what must never be committed..env -
Pre-Push Checklist — A markdown checklist developers should review before pushing:
- No hardcoded secrets or API keys
- Sensitive env vars don't have public prefix
- New API routes have auth middleware
- User input is validated and sanitized
- Error responses don't leak stack traces
- Debug flags are disabled (Customize based on the detected stack)
-
Anti-Patterns — Specific things to avoid in this project, with examples of wrong vs. right approaches.
Language: If the project's README or docs are in a non-English language, write SECURITY.md in that same language.
Present the generated content to the user and ask:
Should I write this to
in the project root? (yes/no)SECURITY.md
Verify Mode
When mode is
verify, check compliance against an existing SECURITY.md.
Step 1: Parse Rules
- Find and read
from the project root or docs folder.SECURITY.md - If no
exists, inform the user and suggest running guide mode first.SECURITY.md - Extract verifiable rules — checklist items, anti-patterns, env var classifications, auth requirements.
Step 2: Verify Compliance
For each extracted rule, check the codebase for compliance:
- Env var rules: Verify classifications match actual usage (no secret vars with public prefix).
- Auth rules: Verify routes follow documented auth patterns.
- Checklist items: Run the corresponding security check from the reference patterns.
- Anti-patterns: Search for documented anti-patterns in the code.
Step 3: Present Results
## Security Verification Results **Based on:** SECURITY.md (last updated: 2024-01-15) | # | Rule | Status | Details | |---|------|--------|---------| | 1 | No hardcoded secrets | Pass | No secrets found in source | | 2 | DATABASE_URL is secret | Fail | Has NEXT_PUBLIC_ prefix in .env | | 3 | All API routes have auth | Warn | 2 routes missing auth middleware | | 4 | Input validation on POST | Pass | All POST routes validate input |
For each Fail or Warn, provide the file and line number, and suggest a fix.
Then ask:
Would you like me to insert TODO/FIXME comments for the failures? (yes/no)
Apply comments using the same approach as scan mode Step 5.