Web Security Cheatsheet

OWASP Top 10

Use this Web Security reference while you build software engineering projects, review code, or refresh the syntax you reach for most.

The current list, OWASP Top 10:2025

The Top 10 is a risk awareness list, not a checklist and not a standard. It orders categories by prevalence in contributed test data plus a community survey. The 2025 edition is the 8th installment.

IDCategoryChange from 2021
A01:2025Broken Access ControlStill #1, SSRF folded in
A02:2025Security MisconfigurationUp from #5
A03:2025Software Supply Chain FailuresNew, expands "Vulnerable and Outdated Components"
A04:2025Cryptographic FailuresDown from #2
A05:2025InjectionDown from #3
A06:2025Insecure DesignDown from #4
A07:2025Authentication FailuresSame rank, renamed
A08:2025Software or Data Integrity FailuresSame rank
A09:2025Security Logging and Alerting FailuresSame rank, renamed
A10:2025Mishandling of Exceptional ConditionsNew

Two additions, two renames, one consolidation. The theme of the 2025 revision is root cause over symptom, which is why supply chain and misconfiguration climbed while specific bug classes slid down.

The 2021 list, still referenced everywhere

Compliance documents, scanner output, and most training material are keyed to the 2021 edition. Know both, because you will be asked to map findings between them.

IDCategoryMaps to in 2025
A01:2021Broken Access ControlA01
A02:2021Cryptographic FailuresA04
A03:2021InjectionA05
A04:2021Insecure DesignA06
A05:2021Security MisconfigurationA02
A06:2021Vulnerable and Outdated ComponentsA03
A07:2021Identification and Authentication FailuresA07
A08:2021Software and Data Integrity FailuresA08
A09:2021Security Logging and Monitoring FailuresA09
A10:2021Server-Side Request Forgery (SSRF)A01

XSS lives inside Injection in both editions. It is not its own category, which surprises people who learned the 2013 or 2017 lists.

What each category actually means

CategoryThe failure, in one line
Broken Access ControlThe server does not verify that this user may do this action on this object
Security MisconfigurationDefaults left on: debug pages, open buckets, verbose errors, missing headers
Software Supply Chain FailuresA dependency, build step, or distribution channel you trusted was compromised
Cryptographic FailuresSensitive data in transit or at rest without adequate protection
InjectionUntrusted input reaches an interpreter as code rather than data
Insecure DesignThe threat was never modeled, so no amount of clean code fixes it
Authentication FailuresWeak credentials, weak recovery, broken session lifecycle
Software or Data Integrity FailuresUnverified updates, unsigned artifacts, unsafe deserialization
Logging and Alerting FailuresThe breach happened and nobody was paged
Mishandling of Exceptional ConditionsError and edge-case paths skip the checks the happy path enforces

Two rules that cover most of it

Almost every category above reduces to one of two mistakes, and they are worth internalizing before any specific technique.

1. Never trust the client. Anything the browser sends is attacker controllable: form fields, query strings, headers, cookies, hidden inputs, Origin, Referer, JWT claims you did not verify, and the price in the cart. Client-side validation is a UX feature. The server decides. 2. Keep data out of the code path. Injection of every flavor is one bug: untrusted text was concatenated into something that gets interpreted. SQL, shell, HTML, LDAP, XPath, template engines, and log files all have the same shape and the same class of fix, which is a parameterized or context-aware API.

Defense in depth

No single control is sufficient. Layer them so one bypass is not a breach.

LayerExamples
DesignThreat modeling, least privilege, blast-radius limits
InputType and range validation, canonicalize before validating
Interpreter boundaryParameterized queries, execve-style argv, safe templating
OutputContext-aware encoding, Content-Type correctness
TransportTLS 1.2 or better, HSTS, secure cookie attributes
BrowserCSP, frame-ancestors, Trusted Types, SRI
IdentityMFA, short sessions, rotate on privilege change
RuntimeEgress allowlists, resource quotas, least-privilege service accounts
DetectStructured audit logs on authz decisions, alerting on anomalies
RecoverTested backups, documented rotation, an incident runbook

How to use this reference

Each topic that follows covers one class in the same shape: what the vulnerability is, a minimal illustrative example of the flaw, the concrete fix, and what to look for during code review. There are no exploit recipes here. The goal is that you recognize the pattern in a diff and know the correct replacement.

Primary sources worth bookmarking:

- OWASP Top 10:2025 for the risk categories. - OWASP Cheat Sheet Series for per-topic defensive guidance, which is the deepest free resource on this subject. - OWASP ASVS when you need verifiable requirements rather than awareness. - MDN HTTP headers for exact header and directive syntax.