security-review
Comprehensive security audit for code changes. Use this skill when implementing authentication, authorization, user input handling, API endpoints…
от mhylle★ 20 звёзд на GitHub
Установить security-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Security Review Skill
Contents
- Design Philosophy
- When to Activate
- Security Checklist
- Integration with implement-phase
- Pre-Deployment Security Checklist
- References
Reference files (open one when a step points to it):
references/security-checklist.md: Security Review Checklist
This skill ensures all code follows security best practices and identifies potential vulnerabilities before they reach production.
Design Philosophy
Security is not optional. This skill acts as a security quality gate that validates code against common vulnerability patterns (OWASP Top 10) and project-specific security requirements. One vulnerability can compromise the entire platform.
When to Activate
Trigger this skill when code involves:
- Authentication or authorization - Login flows, session management, role checks
- User input handling - Forms, query parameters, file uploads
- API endpoints - New routes, especially public-facing
- Secrets or credentials - API keys, database connections, tokens
- Payment features - Financial transactions, billing, subscriptions
- Sensitive data - PII, health data, financial records
- Third-party API integration - External service connections
- Database queries - Especially raw SQL or dynamic queries
Security Checklist
1. Secrets Management
BAD - Never Do This
const apiKey = "sk-proj-xxxxx" // Hardcoded secret
const dbPassword = "password123" // In source code
const config = {
stripe_key: "sk_live_xxxxx" // Committed to repo
}
GOOD - Always Do This
const apiKey = process.env.OPENAI_API_KEY
const dbUrl = process.env.DATABASE_URL
// Verify secrets exist at startup
if (!apiKey) {
throw new Error('OPENAI_API_KEY not configured')
}
// Use secret management services for production
// AWS Secrets Manager, HashiCorp Vault, etc.
Verification Checklist
- No hardcoded API keys, tokens, or passwords in source
- All secrets loaded from environment variables
-
.env,.env.local,.env.productionin .gitignore - No secrets in git history (run
git log -p | grep -i "api_key\|secret\|password") - Production secrets in secure secret management (Vercel, Railway, AWS SM)
- Different secrets for dev/staging/production environments
2. Input Validation
BAD - Never Trust User Input
// DANGEROUS: No validation
async function createUser(req: Request) {
const { email, name, role } = req.body
return db.users.create({ email, name, role }) // role injection!
}
// DANGEROUS: Client-side only validation
if (formData.email.includes('@')) { /* good enough? NO */ }
GOOD - Validate Everything Server-Side
import { z } from 'zod'
const CreateUserSchema = z.object({
email: z.string().email().max(255),
name: z.string().min(1).max(100).regex(/^[a-zA-Z\s]+$/),
age: z.number().int().min(0).max(150).optional()
// Note: role is NOT accepted from user input
})
export async function createUser(input: unknown) {
const validated = CreateUserSchema.parse(input)
return await db.users.create({
...validated,
role: 'user' // Role set server-side, never from input
})
}
File Upload Validation
function validateFileUpload(file: File) {
// Size check (5MB max)
const maxSize = 5 * 1024 * 1024
if (file.size > maxSize) {
throw new Error('File too large (max 5MB)')
}
// MIME type check (verify actual content, not just header)
const allowedTypes = ['image/jpeg', 'image/png', 'image/gif']
if (!allowedTypes.includes(file.type)) {
throw new Error('Invalid file type')
}
// Extension check (defense in depth)
const allowedExtensions = ['.jpg', '.jpeg', '.png', '.gif']
const extension = file.name.toLowerCase().match(/\.[^.]+$/)?.[0]
if (!extension || !allowedExtensions.includes(extension)) {
throw new Error('Invalid file extension')
}
// Sanitize filename
const sanitizedName = file.name.replace(/[^a-zA-Z0-9.-]/g, '_')
return { ...file, name: sanitizedName }
}
Verification Checklist
- All user inputs validated with schemas (zod, yup, joi)
- Validation happens server-side (client validation is UX only)
- File uploads restricted by size, type, and extension
- File contents verified (not just extensions)
- Whitelist validation preferred over blacklist
- Error messages don't leak sensitive information
- No direct use of user input in file paths or system commands
3. SQL Injection Prevention
BAD - Never Concatenate SQL
// CRITICAL VULNERABILITY - SQL Injection
const query = `SELECT * FROM users WHERE email = '${userEmail}
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Read - 02
Glob - 03
Grep - 04
Bash
Вложенные файлы
- references/security-checklist.md
FAQ
Что делает скилл security-review?
Comprehensive security audit for code changes. Use this skill when implementing authentication, authorization, user input handling, API endpoints, secrets/credentials, payment features, or file uploads. Provides security checklists, vulnerability patterns, and remediation guidance. Integrates with implement-phase and tt-implement-phase as a security quality gate. Invoked as devflow:security-review; Claude Code's built-in /security-review is a different review of the pending branch changes.
Как установить скилл security-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл security-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…