The ten classic web vulnerability classes: one-line principle + defense. Each pairs with a lab or learning platform.
1SQL Injection
User input is concatenated into SQL — bypass logins, dump databases.
🛡️ Defense:Parameterized queries / prepared statements
2XSS (Cross-Site Scripting)
User input rendered as HTML — steal cookies, phish.
🛡️ Defense:HTML-entity-encode output + CSP
3CSRF
Trick the victim's browser into forged requests acting as them.
🛡️ Defense:CSRF tokens + SameSite cookies
4SSRF
Make the server fetch malicious URLs — probe internals, read metadata.
🛡️ Defense:Allowlist validation of request targets
5File upload flaws
Lax upload filters — plant a webshell.
🛡️ Defense:Allowlist extension/MIME + rename + isolated storage
6XXE (XML External Entities)
External entities in XML parsing — read files, hit internal networks.
🛡️ Defense:Disable external entity resolution
7Insecure deserialization
Deserializing malicious objects triggers code execution.
🛡️ Defense:Validate sources + type allowlists + signatures
8IDOR (broken access control)
Change an id parameter and read someone else's data.
🛡️ Defense:Server-side object-level authorization
9Command injection
Input concatenated into shell commands — arbitrary execution.
🛡️ Defense:Allowlist parameters + avoid shell concatenation
10Weak auth & brute force
Weak passwords and no rate limits — cracked or credential-stuffed.
🛡️ Defense:Password policy + MFA + login throttling