Specialist security reviewer

From VenTheZone/pi-dots · View interactive version

Specialist security reviewer is an AI agent skill from the GitHub repository VenTheZone/pi-dots. Security review specialist for web application vulnerability detection and remediation. Use when reviewing code for OWASP Top 10 issues, detecting hardcoded secrets, validating authentication/authorization, or auditing dependencies.

How to use this skill

Skill file

Specialist: Security Reviewer

Security specialist focused on identifying and remediating vulnerabilities in web applications before they reach production.

Workflow

  1. Run automated scans — execute npm audit, grep for secrets, check dependency vulnerabilities
  2. OWASP Top 10 review — systematically check each category against the codebase
  3. Manual code review — inspect authentication flows, input validation, access controls
  4. Generate report — document findings by severity with remediation steps
  5. Verify fixes — re-run scans after remediation to confirm resolution

Analysis Commands

# Check for vulnerable dependencies
npm audit --audit-level=high

# Check for secrets in files
grep -r "api[_-]?key\|password\|secret\|token" --include="*.js" --include="*.ts" --include="*.json" .

# Security audit for Rust projects
cargo audit

OWASP Top 10 Checklist

  1. Injection — parameterized queries, ORM safety, sanitized input
  2. Broken Authentication — bcrypt/argon2 hashing, JWT validation, secure sessions, MFA
  3. Sensitive Data Exposure — HTTPS enforced, secrets in env vars, PII encrypted, logs sanitized
  4. XXE — XML parsers configured securely, external entity processing disabled
  5. Broken Access Control — authorization on every route, indirect object references, CORS configured
  6. Security Misconfiguration — no default credentials, secure error handling, security headers set, debug mode off in production
  7. XSS — output escaped, CSP set, textContent for plain text, DOMPurify for HTML
  8. Insecure Deserialization — user input deserialized safely, libraries up to date
  9. Vulnerable Components — dependencies up to date, npm audit clean, CVEs monitored
  10. Insufficient Logging — security events logged, logs monitored, alerts configured

Critical Vulnerability Patterns

Hardcoded Secrets

// BAD: hardcoded secret
const apiKey = "sk-proj-xxxxx";

// GOOD: environment variable
const apiKey = process.env.OPENAI_API_KEY;
if (!apiKey) throw new Error("OPENAI_API_KEY not configured");

SQL Injection

// BAD: string interpolation in query
const query = `SELECT * FROM users WHERE id = ${userId}`;

// GOOD: parameterized query
const { data } = await supabase.from("users").select("*").eq("id", userId);

Race Conditions in Financial Operations

// BAD: race condition in balance check
const balance = await getBalance(userId);
if (balance >= amount) await withdraw(userId, amount);

// GOOD: atomic transaction with row lock
await db.transaction(async (trx) => {
  const balance = await trx("balances").where({ user_id: userId }).forUpdate().first();
  if (balance.amount < amount) throw new Error("Insufficient balance");
  await trx("balances").where({ user_id: userId }).decrement("amount", amount);
});

Report Format

# Security Review Report

**File/Component:** [path/to/file.ts]
**Reviewed:** YYYY-MM-DD

## Summary
- **Critical Issues:** X | **High:** Y | **Medium:** Z | **Low:** W
- **Risk Level:** HIGH / MEDIUM / LOW

## Issues

### 1. [Issue Title]
**Severity:** CRITICAL
**Category:** SQL Injection / XSS / Authentication
**Location:** `file.ts:123`
**Issue:** [Description]
**Impact:** [What could happen if exploited]
**Remediation:** [Secure implementation]

Security Checklist

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.