Security in web applications protects digital assets from threats spanning injection attacks, broken authentication, data exposure, and misconfigurations. Modern web security operates at multiple layers—from transport encryption and input validation to session management and access control. The OWASP Top 10 2025 remains the definitive reference, with Broken Access Control at #1, Security Misconfiguration rising to #2, and new categories covering software supply chain failures and error handling. Effective security requires defense in depth, continuous monitoring, and awareness of emerging threats including API abuse, LLM prompt injection, and prototype pollution.
What This Cheat Sheet Covers
This topic spans 18 focused tables and 165 indexed concepts, 158 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Common Injection Attacks
Injection flaws all share one root cause—untrusted input getting interpreted as code or a query instead of as plain data. The entries here run from the classic SQL and cross-site scripting variants through to newer JavaScript-specific dangers like prototype pollution, but the defensive instinct is always the same: keep data and instructions strictly separated.
| Vulnerability | Example | Description | |
|---|---|---|---|
SELECT * FROM users WHERE id = ' + userInput | • Attacker inserts malicious SQL via user input, potentially reading, modifying, or deleting database data • use parameterized queries | ||
<script>...</script> saved to database | • Malicious script persists in the database and executes in every viewer's browser • most dangerous XSS variant | ||
<script>alert(document.cookie)</script> in URL param | Malicious script injected via request is immediately reflected in the response and executes in the victim's browser | ||
document.write(location.hash) | • Vulnerability in client-side JavaScript processes untrusted data • payload never reaches the server | ||
system("ping " + userInput) | Attacker executes arbitrary OS commands by injecting shell metacharacters into application inputs | ||
fetch("http://169.254.169.254/metadata") | Tricks server into making requests to internal resources or cloud metadata endpoints, exposing credentials | ||
<!ENTITY xxe SYSTEM "file:///etc/passwd"> | Exploits XML parsers that process external entity references, enabling file disclosure, SSRF, or DoS | ||
{{7*7}} in template input | Injects code into server-side template engine syntax (Jinja2, Freemarker), leading to remote code execution | ||
{"user": "admin", "password": {"$ne": ""}} | Manipulates NoSQL queries (MongoDB, etc.) using query operators to bypass authentication or extract data | ||
user[__proto__][isAdmin]=true | Attacker injects properties into JavaScript object prototypes via user-controlled input, affecting all objects app-wide | ||
(uid= + user + ) | Manipulates LDAP queries to access unauthorized directory information or bypass authentication |