Security Encyclopedia
A complete reference guide for 50 common security vulnerabilities, including detailed explanations and manual remediation code.
1. Transport Layer Security
1. HSTS Missing
Explanation: The server accepts HTTP connections, allowing SSL Stripping attacks.
2. Weak SSL/TLS Ciphers
Explanation: Support for deprecated protocols like TLS 1.0/1.1.
3. Mixed Content
Explanation: HTTPS page loads scripts/images over HTTP.
4. SSL Compression Enabled
Explanation: Compression makes HTTPS vulnerable to CRIME attack.
5. OCSP Stapling Disabled
Explanation: Slows down SSL handshake and exposes user privacy.
2. Security Headers
6. Missing X-Frame-Options
Explanation: Vulnerable to Clickjacking (UI Redressing).
7. Missing CSP
Explanation: Allows loading malicious scripts (XSS).
8. Missing X-Content-Type-Options
Explanation: Browser may sniff MIME type and execute text as JS.
9. Weak Referrer Policy
Explanation: Leaks full URL paths to external sites.
10. Missing Permissions-Policy
Explanation: Allows unrestricted access to Camera/Mic/Geo.
4. Information Leakage
16. Server Banner Disclosure
Explanation: Response header `Server: Apache/2.4.1` reveals version.
17. X-Powered-By Header
Explanation: Reveals tech stack (e.g., Express, PHP).
18. Stack Trace Exposure
Explanation: Detailed error messages in production leak file paths.
19. .git Directory Exposure
Explanation: Allows downloading entire source code history.
20. .env File Exposure
Explanation: Leaks API keys and database credentials.
5. Injection Flaws
21. SQL Injection
Explanation: User input concatenated into SQL queries.
22. Reflected XSS
Explanation: Input from URL reflected in HTML.
23. Stored XSS
Explanation: Malicious script saved to DB and shown to others.
24. Command Injection
Explanation: User input passed to system shell (e.g., exec(), system()).
25. NoSQL Injection
Explanation: Passing JSON objects to MongoDB queries (e.g., `{"$ne": null}`).
6. Authentication
26. Weak Password Policy
Explanation: Allowing short/simple passwords.
27. Default Credentials
Explanation: Using admin/admin for services (Tomcat, Jenkins).
28. Missing Rate Limiting
Explanation: Allows brute-force attacks on login.
29. User Enumeration
Explanation: "User not found" vs "Incorrect password" reveals valid emails.
30. JWT None Algorithm
Explanation: JWT libraries may accept tokens with "alg": "none".
7. Access Control
31. IDOR (Insecure Direct Object Reference)
Explanation: Accessing /users/100 without verifying ownership.
32. CORS Wildcard Origin (*)
Explanation: Allows any site to read your API data.
33. CSRF (Cross-Site Request Forgery)
Explanation: Attacker forces user to perform action (e.g., transfer money).
34. Open Redirect
Explanation: Redirecting to `?url=evil.com` for phishing.
35. Directory Traversal
Explanation: Accessing `../../etc/passwd` via file inputs.
8. Server Hardening
36. SSRF (Server-Side Request Forgery)
Explanation: Server fetches internal resources (e.g., AWS Metadata) via user URL.
37. XML External Entities (XXE)
Explanation: XML parser reads local files via entities.
38. Unrestricted File Upload
Explanation: Uploading `.php` shell files.
39. Insecure Deserialization
Explanation: Malicious object state triggers RCE.
40. Debug Mode Enabled
Explanation: Django/Laravel debug pages leak environment vars.
9. Business Logic
41. Mass Assignment
Explanation: Sending `{"role":"admin"}` in registration update.
42. Race Condition
Explanation: Exploiting timing to redeem a coupon twice.
43. Excessive Data Exposure
Explanation: API returns full object including private data.
44. Price Manipulation
Explanation: Changing price in hidden form field.
45. 2FA Bypass
Explanation: Accessing protected pages directly without 2FA check.
10. Client Side
46. DOM Clobbering
Explanation: Overwriting global variables via HTML IDs.
47. Prototype Pollution
Explanation: Merging objects recursively allows modifying Object.prototype.
48. Reverse Tabnabbing
Explanation: External links can hijack the parent tab via `window.opener`.
49. CSS Injection
Explanation: Stealing data via background images in injected CSS.
50. Missing Subresource Integrity (SRI)
Explanation: CDN compromise can inject malware into your site.