Security audit for common vulnerabilities (OWASP top 10, injection, auth issues). Use when user wants security review.
Performs security audits detecting OWASP vulnerabilities, injection flaws, and authentication issues in code.
/plugin marketplace add adelabdelgawad/fullstack-agents/plugin install adelabdelgawad-fullstack-agents-plugins-fullstack-agents@adelabdelgawad/fullstack-agentsAudit code for security vulnerabilities, focusing on OWASP top 10 and common security issues.
/review security [target]Check for:
Detection:
# Find potential SQL injection
grep -rn "execute.*f\"\|execute.*%s\|execute.*+\|\.format(" --include="*.py"
grep -rn "raw_sql\|text(" --include="*.py"
Anti-patterns:
# VULNERABLE
query = f"SELECT * FROM users WHERE id = {user_id}"
db.execute(query)
# SAFE
query = "SELECT * FROM users WHERE id = :id"
db.execute(query, {"id": user_id})
Check for:
Detection:
# Find endpoints without auth
grep -rn "@router\." --include="*.py" -A 5 | grep -v "Depends(get_current_user)"
# Find hardcoded secrets
grep -rn "password.*=.*['\"]" --include="*.py"
grep -rn "secret.*=.*['\"]" --include="*.py"
grep -rn "api_key.*=.*['\"]" --include="*.py"
Check for (Frontend):
dangerouslySetInnerHTML usageDetection:
grep -rn "dangerouslySetInnerHTML\|innerHTML" --include="*.tsx" --include="*.jsx"
Check for:
Detection:
# Check for logging sensitive data
grep -rn "logger.*password\|print.*password\|console.log.*password" --include="*.py" --include="*.ts"
# Check for secrets in code
grep -rn "BEGIN.*PRIVATE\|sk_live\|pk_live\|AKIA" --include="*.py" --include="*.ts" --include="*.env"
Check for:
Check for:
Example issues:
# VULNERABLE - No validation
@router.post("/users")
async def create_user(data: dict): # Should use Pydantic model
pass
# SAFE
@router.post("/users")
async def create_user(data: UserCreate): # Pydantic validates
pass
Detection:
# Python
pip-audit 2>/dev/null || safety check 2>/dev/null
# JavaScript
npm audit 2>/dev/null
Check for:
Detection:
grep -rn "DEBUG.*=.*True\|debug=True\|CORS.*\*" --include="*.py" --include="*.env"
## Security Audit Report
**Target:** {scope}
**Date:** {timestamp}
**Severity Scale:** Critical > High > Medium > Low > Info
### Executive Summary
| Severity | Count | Status |
|----------|-------|--------|
| Critical | 2 | Requires immediate action |
| High | 3 | Fix before deployment |
| Medium | 5 | Should be addressed |
| Low | 8 | Consider fixing |
### Critical Vulnerabilities
#### 1. SQL Injection in User Search
**Location:** `api/v1/users.py:89`
**CVSS:** 9.8 (Critical)
**Vulnerable Code:**
```python
query = f"SELECT * FROM users WHERE name LIKE '%{search_term}%'"
Impact:
Fix:
query = "SELECT * FROM users WHERE name LIKE :term"
result = db.execute(query, {"term": f"%{search_term}%"})
Location: lib/external_api.py:12
Found:
API_KEY = "sk_live_abc123..." # Production key exposed
Fix:
.gitignore if in config fileLocation: api/v1/admin.py:45
The /admin/users/delete endpoint has no authentication.
Fix:
@router.delete("/users/{user_id}")
async def delete_user(
user_id: int,
current_user: User = Depends(get_current_admin), # Add this
):
Implement security scanning in CI/CD
bandit for Python security scanningnpm audit for JavaScript dependenciesSecurity headers Add these headers to your responses:
X-Content-Type-Options: nosniffX-Frame-Options: DENYContent-Security-Policy: ...Dependency updates Update these packages with known vulnerabilities:
requests 2.25.0 → 2.31.0pyjwt 1.7.1 → 2.8.0Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences