FlashcardNot attempted
Web security in one answer
Recall it before you reveal
"How do you secure a web app?" Answer in under a minute, layer by layer.
Space to reveal
Show answer & explanation
| Layer | Attack | Defence |
|---|---|---|
| Input | XSS, SQL injection | Escaping, parameterized queries |
| Authentication | Token theft | Access token in memory, refresh token in an HttpOnly cookie |
| Authorization | IDOR | Server-side ownership check |
| Request trust | CSRF | SameSite cookies, CSRF token |
| Browser | Clickjacking, MIME sniffing | Security headers |
| Server | SSRF, misconfiguration | Host allowlist, secure defaults |
| System | Brute force, bad packages | Rate limiting, dependency scanning |
XSS comes first because once an attacker runs JavaScript on your page they can act as the user, and most other client-side protections stop mattering.