A senior engineer reviewing StudyBuddy's design walks the attack surface (Ch 1) layer by layer. Every item below is one earlier chapter:
NETWORK TLS everywhere, HSTS · only 443 public · DB in private subnet, SG allows app only
(05 Ch 11 · 04 Ch 11 · 03 Ch 11)
IDENTITY Argon2id password hashes · MFA/passkeys available · login rate limits · generic errors (Ch 3, 5, 11)
SESSIONS HttpOnly + Secure + SameSite=Lax cookies, or short-lived signed tokens (Ch 5, 9)
AUTHORIZATION ownership checked on every note/quiz query, central dependency, deny by default (Ch 6)
INPUT parameterized SQL only · no shell strings · validated request bodies (Ch 7)
OUTPUT React escaping · sanitized rich notes · CSP header (Ch 8)
BROWSER CORS allow-list of our own frontend origin only (Ch 9)
URL IMPORT host allow-list, private-IP blocking, IMDSv2 (Ch 10)
FILES random stored names, size/type limits, no user paths (Ch 10)
SECRETS secret manager / cloud identity; nothing in Git; scanners in CI (Ch 11, 07 Ch 10)
DEPENDENCIES lock files, Dependabot, pip-audit / npm audit (Ch 11)
AI ASSISTANT tools scoped to the current user · output escaped · confirm risky actions · no
arbitrary image URLs (Ch 12)
DATA AT REST encrypted DB and backups, KMS-managed keys (Ch 4)
DETECTION security event logs, alerts on anomalies, no secrets in logs (Ch 11)Part 0's six problems — and the chapter that prevents each: stolen password table → Ch 3; /notes/43 → Ch 6; ' OR '1'='1 → Ch 7;
scripts in notes → Ch 8; the obedient AI → Ch 12; the stolen laptop → Ch 11 (and Ch 4).