Cybersecurity Web & API Security
Cybersecurity Quick Reference
OWASP Top 10 defenses, secure cookie flags, password hashing, HTTP security headers, secrets hygiene, and incident response checklist.
HttpOnly; Secure; SameSite=Lax; Prepared Statements; Argon2id
Essential AppSec Cheat Sheet
| Threat | Primary Defense |
|---|---|
| SQL Injection (SQLi) | Parameterized queries / prepared statements (? or :param) |
| Cross-Site Scripting (XSS) | Context-aware output escaping + strict Content-Security-Policy |
| CSRF | SameSite=Lax/Strict cookies + synchronizer CSRF token |
| Broken Access Control (IDOR) | Server-side ownership check (WHERE id = ? AND user_id = ?) |
| Password Leaks | Salted Argon2id or bcrypt (never MD5 / plain SHA-256) |
| Brute Force / Stuffing | Rate limiting per IP + account lockout/backoff |
| Session Theft | HttpOnly; Secure; SameSite=Lax cookies over HTTPS |
| Secret Leaks | .env in .gitignore, rotate immediately if exposed |