Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 80 ยท Web Application Security

The OWASP Top 10

Learn what the OWASP Top 10 is, what each web risk category means, how to turn the list into concrete defenses, and where ASVS fits in.

Almost every web application is attacked in similar ways. Someone changes an ID in a URL to read another person's data, pastes a quote into a search box to see what the database does, or looks for a forgotten admin page. The OWASP Top 10 is a short, regularly updated list of the most critical risks to web applications, compiled by the Open Worldwide Application Security Project from real vulnerability data and expert surveys. It is the closest thing the industry has to a common vocabulary for web security.

This lesson opens the Web Application Security chapter. You will learn what each category means in plain language, how to read the list without treating it as a checklist of exact bugs, and how to map every risk to a defense you can implement. The following lessons then go deep on the biggest ones: SQL injection, cross-site scripting, CSRF and CORS, input validation and SSRF and deserialization. If risk, threats and vulnerabilities are new words, start with Threats, Vulnerabilities and Risk.

What the list is, and what it is not

The Top 10 is an awareness document. Each entry is a category of weakness, not a single bug. "Injection" covers SQL, NoSQL, OS command and LDAP injection. "Broken access control" covers everything from a missing role check to an editable user ID. The list is ordered by a mix of how common the weakness is, how easy it is to exploit and how bad the impact is.

Three consequences follow:

  • Passing the Top 10 is not the same as being secure. It is a floor, not a ceiling. Many serious problems (business logic flaws, race conditions) fit no category neatly.
  • The list changes. OWASP publishes new editions every few years. The 2021 edition is the one most courses, scanners and compliance documents still cite. The 2025 update reshuffled it: security misconfiguration moved up, software supply chain failures replaced the "vulnerable components" category, SSRF was folded into broken access control, and a new category about mishandling of exceptional conditions appeared. Always state the edition year when you cite a number such as "A03".
  • Categories overlap. A stolen session cookie can be an authentication failure, an XSS consequence and a logging failure at once. Use the list to think, not to sort bugs into boxes.

The ten categories (2021 edition)

Here is each category with one sentence on what goes wrong and the core defense.

  1. A01 Broken Access Control. Users can act outside their permissions: view someone else's order by changing ?id=, reach /admin without being an admin. Defense: check permission on the server for every request, deny by default. See Authorization and Access Control Models.
  2. A02 Cryptographic Failures. Sensitive data is sent or stored unprotected, or protected with weak or misused crypto (MD5 passwords, no TLS, hard-coded keys). Defense: TLS everywhere, modern algorithms, proper key management. See Cryptography in Plain Language.
  3. A03 Injection. Untrusted data is interpreted as part of a command or query. Defense: parameterized queries, safe APIs and output encoding. This category also absorbed cross-site scripting in 2021.
  4. A04 Insecure Design. The flaw is in the plan, not the code: no rate limit on password resets, no thought given to abuse. Defense: threat modeling and secure design patterns (Threat Modeling with STRIDE).
  5. A05 Security Misconfiguration. Default passwords, verbose error pages, open cloud storage, unneeded features switched on. Defense: hardened, repeatable configuration and automated checks.
  6. A06 Vulnerable and Outdated Components. The app runs libraries with known flaws. Defense: inventory your dependencies and patch quickly (Dependency and Supply Chain Security).
  7. A07 Identification and Authentication Failures. Weak passwords allowed, no brute-force protection, predictable session IDs. Defense: strong password storage, MFA, safe sessions (Password Storage Done Right).
  8. A08 Software and Data Integrity Failures. Code or data is trusted without checking integrity: unsigned updates, insecure deserialization, tampered CI pipelines. Defense: signatures, checksums, safe formats.
  9. A09 Security Logging and Monitoring Failures. Attacks happen and nobody notices. Defense: log security events and alert on them (Logging, Log Analysis and SIEM).
  10. A10 Server-Side Request Forgery (SSRF). The server is tricked into fetching a URL the attacker chose, often an internal one. Defense: allow-list destinations (SSRF, Unsafe Deserialization and XXE).
flowchart LR
    A["Untrusted input<br/>(requests, files, headers)"] --> B["Validate and authorize<br/>A01, A03, A07"]
    B --> C["Application logic<br/>A04 design"]
    C --> D["Data and services<br/>A02, A05, A06"]
    C --> E["Logs and alerts<br/>A09"]
    D --> F["Outbound calls<br/>A10"]

Risks cluster around the places where data crosses a boundary: in, through the app, to storage and out again.

Turning a risk into a defense

A list of risks is only useful if each one becomes a concrete control that someone owns. The best habit is a risk-to-defense map: for every category, write down the specific technique your team uses, how you verify it, and where in the code it lives. The demo below stores such a map as data and prints a gap report for a fictional project, which is exactly how many teams track security reviews.

Python A risk-to-defense map

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The exercise is not about the score. It forces the question "what is our answer to each of these?" and exposes the categories nobody has thought about, which are usually A04, A05 and A09.

Using the list in practice

Different roles use the Top 10 differently:

  • Developers read the category descriptions and the "how to prevent" notes while designing features, and write unit tests for the defenses.
  • Reviewers turn the ten categories into questions for code review: "Does this endpoint check that the caller owns the record?" "Is this query built with string concatenation?"
  • Testers use it to plan coverage so that each category gets at least some attention.
  • Managers use it for communication: it is much easier to say "we closed two A01 issues" than to list individual bugs.

Severity still needs judgment. A reflected XSS on a page behind a login with no sensitive data is not the same as a stored XSS on a public forum. Score findings by likelihood and impact, as in Threats, Vulnerabilities and Risk.

Beyond the Top 10: ASVS and friends

The Top 10 tells you what goes wrong. OWASP's Application Security Verification Standard (ASVS) tells you what to verify. It is a numbered catalogue of testable requirements, grouped by topic (authentication, session management, access control, validation and encoding, cryptography, error handling and logging, API security and more) and arranged in three levels:

  • Level 1: the baseline every application should meet and that can mostly be tested from the outside.
  • Level 2: for applications that handle sensitive data. This is the usual target.
  • Level 3: for the most critical systems such as payments or health, needing design review and deeper testing.

A requirement reads like "verify that the application uses a vetted algorithm to hash passwords", so it can become a test case or a line in a procurement contract. Other OWASP projects worth knowing: the Cheat Sheet Series (short how-to guides per topic), the Web Security Testing Guide (how to test), the API Security Top 10 (covered in API Security) and Dependency-Check (vulnerable component scanning).

The next demo checks the opposite direction: given a short description of a bug, which category does it most likely belong to? A crude keyword classifier is not how real triage works, but writing one shows how fuzzy the boundaries are.

Python Triage bug reports into categories

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the third report matches two categories. That is normal: one bug (unsanitized input) and one misconfiguration (leaky error page) are both present, and each needs its own fix.

Insecure design: common mistakes

Insecure design (A04) is about flaws that no amount of perfect coding can fix, because the plan itself is weak. Typical mistakes are treating security as a final testing phase, relying on a web application firewall to cover weak logic, trusting client-side checks, designing flows without abuse cases (a coupon that can be applied unlimited times), and leaving systemic failures such as no rate limiting on password reset. Practical countermeasures are threat modeling early, secure design patterns, reference architectures, abuse and misuse cases next to user stories, and unit and integration tests that assert business limits. A WAF can slow an attacker, but it never replaces a correct design. More in secure design.

Outdated components: tracking and patching

A06 (vulnerable and outdated components) usually starts with untracked dependencies: nobody knows which libraries, including transitive ones, are in the product. The second failure is delayed updates: the patch exists but is applied months later. Keep a software bill of materials, scan dependencies in CI, subscribe to advisories, remove unused packages, and set patch deadlines by severity. See dependency security.

Integrity failures and the CI/CD pipeline

A08 covers code and data trusted without verification. The build pipeline is a prime target: a compromised CI runner, a stolen deploy token, a malicious pull-request script or a poisoned package can ship backdoored code to every customer. Secure the pipeline by requiring reviews and signed commits, giving each job the minimum credentials, pinning dependency versions and hashes, signing build artifacts and verifying signatures at deploy time, isolating runners, and logging every pipeline change.

Logging: what to implement

For A09, implement comprehensive logging: record logins (success and failure), access-control failures, input-validation failures and administrative actions, with enough context (who, what, when, from where) to reconstruct events, but never secrets. Send logs to a central, append-only store, alert on suspicious patterns, and test the alerts. The cost of missing this is delayed detection: breaches often run for months before anyone notices. See logging and SIEM.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is the OWASP Top 10 best described as?

    It is an awareness document built from data and expert input. It is a starting point, not a guarantee and not a law.
  2. 2. A user changes ?invoice=1001 to ?invoice=1002 and sees someone else's invoice. Which category fits best?

    The server did not verify that the caller is allowed to read that record. This is the classic insecure direct object reference, a form of broken access control.
  3. 3. Why should you state the edition year when you cite a category such as A03?

    OWASP revises the list, so the same ID can mean different things in different years.
  4. 4. How does ASVS differ from the Top 10?

    The Top 10 says what commonly goes wrong. ASVS lists what to verify, in requirements that can be tested or contracted.
  5. 5. Which is a good way to use the list inside a team?

    A risk-to-defense map turns awareness into ownership and exposes categories nobody has addressed.

Summary

  • The OWASP Top 10 is an awareness list of risk categories, ordered by prevalence, exploitability and impact.
  • Cite the edition year; the 2021 list has A01 Broken Access Control through A10 SSRF, and the 2025 update reorganized several entries.
  • Every category should map to a concrete defense, an owner and a verification method.
  • Categories overlap, and a single bug can belong to several.
  • ASVS turns the awareness list into numbered, testable requirements at three levels.
  • The Top 10 is a floor: business logic flaws and design problems need their own attention.

Next: SQL Injection and Parameterized Queries, the most famous injection flaw and how a single placeholder prevents it.