OWASP Top 10 Explained With Practical Examples
Web applications handle our banking, shopping, health records and work. Because they are exposed to the internet by design, they are among the most targeted systems. The OWASP Top 10 is a widely used awareness document, produced by the Open Worldwide Application Security Project, listing the most critical categories of web application security risk. This lesson walks through the 2021 edition, which is the current published version at the time of writing, explaining each category in plain language with examples, defences and practice that you can do against deliberately vulnerable applications in your own lab.
Set Up a Safe Practice Target
Never practise on real websites. Use purpose-built, deliberately vulnerable applications on your own machine, bound to the local address only. Two popular choices are OWASP Juice Shop and DVWA (Damn Vulnerable Web Application). Using Docker as described in How to Build a Safe Cyber Security Home Lab:
docker run -d --name juice-shop -p 127.0.0.1:3000:3000 bkimminich/juice-shop
# then browse to http://127.0.0.1:3000
Binding to 127.0.0.1 means only your own computer can reach it, which is important because these applications are intentionally insecure.
The OWASP Top 10 (2021)
| ID | Category | One-line meaning |
|---|---|---|
| A01 | Broken Access Control | Users can act outside their permissions |
| A02 | Cryptographic Failures | Sensitive data is not protected properly in transit or at rest |
| A03 | Injection | Untrusted data is interpreted as commands or queries |
| A04 | Insecure Design | Missing or weak security thinking in the design itself |
| A05 | Security Misconfiguration | Unsafe defaults, open services, verbose errors |
| A06 | Vulnerable and Outdated Components | Using libraries, frameworks or platforms with known flaws |
| A07 | Identification and Authentication Failures | Weak login, session or password handling |
| A08 | Software and Data Integrity Failures | Trusting unverified updates, pipelines or serialised data |
| A09 | Security Logging and Monitoring Failures | Attacks happen without being noticed |
| A10 | Server-Side Request Forgery (SSRF) | The server is tricked into making requests on an attacker’s behalf |
Each Category Explained
A01: Broken Access Control
The most common category. The application fails to enforce who may do what. Examples: changing an identifier in a URL to view another user’s record, a normal user opening an admin page by typing its address, or editing a request to change a price or role. Defend: deny by default, enforce checks on the server for every request, use role-based or attribute-based rules, log access failures. See Broken Access Control and Session Flaws.
A02: Cryptographic Failures
Data sent in cleartext, weak or outdated algorithms, hard-coded keys, passwords stored without proper hashing or missing HTTPS. Defend: TLS everywhere, modern algorithms, proper key management, password hashing with Argon2, scrypt or bcrypt, and not storing sensitive data you do not need. See Cryptography Fundamentals.
A03: Injection
Includes SQL, operating system command, LDAP and template injection, and also cross-site scripting (XSS), which OWASP groups here. The common cause is mixing code and data. Defend: parameterised queries, safe APIs, input validation, output encoding and least-privilege database accounts. See SQL Injection Explained and Prevented and XSS and CSRF Explained.
A04: Insecure Design
Flaws that no amount of perfect coding can fix because the design is wrong: a password-reset process that asks easy-to-find questions, a booking system with no limits on repeated actions, a refund feature that lacks approval. Defend: threat modelling, secure design patterns, abuse-case thinking and testing business logic early.
A05: Security Misconfiguration
Default accounts, unnecessary features enabled, directory listings, detailed error messages exposing internals, missing security headers, cloud storage left open. Defend: repeatable hardened builds, minimal installations, configuration reviews and automated scanning.
A06: Vulnerable and Outdated Components
Modern apps are mostly third-party code. A single outdated library can expose everything. Defend: keep an inventory (a software bill of materials), run dependency scanners, patch promptly and remove unused packages; see Vulnerability Management.
A07: Identification and Authentication Failures
Allowing weak passwords, no protection against repeated guessing, exposed session identifiers, poor password recovery or missing multi-factor authentication. Defend: MFA, rate limiting and lockout, secure session management and password policies aligned with modern guidance; see Password Security.
A08: Software and Data Integrity Failures
Trusting code or data without verifying its integrity: auto-updates without signature checks, build pipelines that anyone can change, untrusted serialised objects. Defend: sign and verify artefacts, protect CI/CD systems, review dependencies and avoid insecure deserialisation.
A09: Security Logging and Monitoring Failures
If you do not log logins, access failures and high-value actions, or nobody watches the logs, attackers can operate for months. Defend: log security events with enough detail, protect logs from tampering, alert on suspicious patterns; see SIEM, Logging and SOC Operations.
A10: Server-Side Request Forgery (SSRF)
The application fetches a URL supplied by a user. An attacker supplies an internal address, so the server reaches internal systems or cloud metadata services that the attacker cannot reach directly. Defend: allow-list destinations, block internal address ranges, disable unneeded URL fetching and protect cloud metadata endpoints (for example, by requiring the more secure metadata service version).
Practice Lab 1: Explore the Juice Shop Safely
- Start Juice Shop as shown above and register an ordinary account.
- Open your browser’s developer tools (F12), go to the Network tab and use the application normally. Observe requests, responses, cookies and headers.
- Find the application’s scoreboard page (the project documents how) and pick one beginner-level challenge from each of three categories: access control, injection and misconfiguration.
- For each challenge, write down the cause, the defence and the OWASP category it belongs to.
Practice Lab 2: Map Your Own Code to the Top 10
If you write code, review one small application and answer for each category: “Where could this happen here?” Fill in a table:
| Category | Relevant code or feature | Current protection | Gap |
|---|---|---|---|
| A01 Access control | Order lookup endpoint | Checks login only | No ownership check |
| A05 Misconfiguration | Error pages | Debug mode on | Disable debug in production |
| A09 Logging | Login endpoint | No failure logging | Add logs and alerts |
Practice Lab 3: Check Headers and Basics
curl -I http://127.0.0.1:3000/
# Review: is a Content-Security-Policy present? X-Content-Type-Options? Strict-Transport-Security on HTTPS?
Write a short list of security headers the app should add and why each helps.
How the Top 10 Fits Into Practice
- Developers use it as a training checklist and code review guide.
- Testers use it as a starting point, along with the more detailed OWASP Web Security Testing Guide and the Application Security Verification Standard (ASVS).
- Managers use it to prioritise training and tooling.
- It is an awareness list, not a complete standard. Passing a Top 10 review does not prove an application is secure.
Practice Exercises
- For each Top 10 category, write one sentence an executive would understand.
- Which two categories would you check first on a login page? Explain why.
- Describe a real-world situation where insecure design (A04) cannot be fixed with a code patch.
- Choose one category and list two preventive controls and one detective control.
- Find the current OWASP Top 10 page and note whether the list has been updated since 2021.
Mentor tip: Do not memorise the list as trivia. For every category, learn one vulnerable example, one fixed example and one log line that would reveal an attempt. That trio is what makes you useful on a real team.
Educational use only: practise only on deliberately vulnerable applications that you run yourself, or on systems where you hold written permission.
- The OWASP Top 10 is an awareness list of the most critical web application risk categories.
- Broken access control, cryptographic failures and injection are the headline risks.
- Many problems come from design, configuration and dependencies, not only coding mistakes.
- Practise only on deliberately vulnerable apps running locally in your lab.
- Learn each category by cause, defence and detection.