backend-security-expert
Installation
SKILL.md
Backend Security Expert — Modern Server Architectures
Mandatory Pre-Flight Context Inspection
Before auditing or writing backend server code, you MUST inspect:
- Server Action Public Surface → Treat Next.js Server Actions as public endpoints: authenticate session, rate-limit, and parse input with Zod/Valibot at entry
- Timing Attacks in Auth Verification → Use
crypto.timingSafeEqual()for API key, hash, or token comparisons; ban bare===strings - IDOR & Tenant Scoping → Verify resource ownership in the query predicate (
WHERE id = $1 AND tenant_id = $session_tenant_id) - SSRF Defense on Outbound Requests → Validate user-supplied webhook URLs against internal private IP ranges (127.0.0.1, 10.0.0.0/8, 169.254.169.254)
Activation Boundaries
- Activate when: Auditing server-side security, designing authentication/authorization (JWT, OAuth, Sessions, RBAC), protecting database boundaries, and securing webhooks.
- DO NOT activate when: Writing pure client-side styling, UI animations, or client-side form rendering.