The OWASP Top 10
OWASP (the Open Worldwide Application Security Project) is a non-profit that publishes free security guidance. Its best-known document, the OWASP Top 10, ranks the most critical web application security risks, based on data from hundreds of thousands of real applications. It's the shared vocabulary of developers, security teams and auditors. The current edition is OWASP Top 10:2025.
The list
| # | Risk | In one sentence |
|---|---|---|
| A01 | Broken Access Control | Users can act outside their permissions: other people's data, admin functions (now includes SSRF) |
| A02 | Security Misconfiguration | Default passwords, verbose errors, open cloud storage, missing headers |
| A03 | Software Supply Chain Failures | Vulnerable, outdated or malicious dependencies, build tools and pipelines |
| A04 | Cryptographic Failures | Sensitive data unencrypted, weak algorithms, bad key handling |
| A05 | Injection | Untrusted input interpreted as code: SQL, NoSQL, OS commands, XSS |
| A06 | Insecure Design | Flaws in the design itself, which no amount of perfect code can fix |
| A07 | Authentication Failures | Credential stuffing, weak passwords, broken session handling |
| A08 | Software or Data Integrity Failures | Trusting unsigned updates, data or serialized objects |
| A09 | Security Logging and Alerting Failures | Attacks go unnoticed because nothing is logged or nobody is alerted |
| A10 | Mishandling of Exceptional Conditions | Errors that crash, leak information or "fail open" |
Let's look at the ones developers cause most often, with attacks you can run.
A01 Broken Access Control
Still number one. The app authenticates users but doesn't check whether this user may access this object or function. You saw the IDOR example in the first lesson of this track. Other forms:
- Changing
?userId=42to?userId=43in a request. - Calling
DELETE /api/admin/users/7as a normal user because only the admin page was protected. - Mass assignment: sending
{"role": "admin"}in a profile update that blindly copies the body into the database. - SSRF (server-side request forgery): making your server fetch an internal URL (
http://169.254.169.254/cloud metadata,http://localhost:6379).
A05 Injection
Injection happens whenever untrusted input is mixed into code that another interpreter runs: SQL, a shell command, a MongoDB query, HTML. The fix is always the same idea: keep data separate from code (parameters, safe APIs, encoding).
SQL injection
NoSQL injection
Document databases have their own version. If a login handler passes req.body.password straight into a MongoDB query, the attacker sends an object instead of a string:
{ "email": "admin@shop.example", "password": { "$ne": "" } }{ password: { $ne: '' } } means "password is not empty", which matches. Validate types (z.string()) before using input in queries.
Command injection
exec(`convert ${req.query.file} out.png`); // ❌ file = "x.jpg; rm -rf /"
execFile('convert', [req.query.file, 'out.png']); // ✅ arguments are never parsed by a shellCross-site scripting (XSS), HTML injection into web pages, is also an injection flaw; it gets its own lesson next.
A04 Cryptographic Failures
- Sensitive data sent without HTTPS, or stored unencrypted (backups included).
- Passwords stored in plain text or with fast hashes (see the passwords lesson).
- Weak or broken algorithms: MD5, SHA-1 for signatures, DES, ECB mode, RSA-1024.
- Predictable randomness:
Math.random()for tokens or reset codes. - Hard-coded keys, or keys stored next to the data they protect.
A07 Authentication Failures
- Credential stuffing: attackers try username/password pairs leaked from other sites. Defend with MFA, breached-password checks and rate limiting.
- No rate limiting or lockout on login, password reset or MFA code entry.
- Session IDs in URLs, sessions that never expire or survive logout.
- User enumeration: "No account with that email" vs "Wrong password" tells attackers which emails exist. Use one message, and similar response times.
A10 Mishandling of Exceptional Conditions
New in 2025. When something unexpected happens (a timeout, a malformed input, a downstream service error), insecure code does one of these:
- Fails open: an authorization check that throws is caught and the request is allowed.
- Leaks information: stack traces, SQL errors and internal hostnames in responses.
- Leaves things half done: money debited but not credited, because there was no transaction.
The others in brief
- A02 Security Misconfiguration: change default credentials, disable debug mode and directory listings in production, lock down cloud storage buckets, send security headers, and keep configuration identical (and reviewed) across environments.
- A03 Software Supply Chain Failures: know your dependencies (a lock file, an SBOM), scan them (
npm audit, Dependabot, Snyk, OSV-Scanner), pin and review updates, protect your CI pipeline and publishing tokens, and beware of typosquatted packages. - A06 Insecure Design: threat-model features before building them (the last lesson in this track). For example, a password reset that asks "What's your pet's name?" is insecure however well it's coded.
- A08 Software or Data Integrity Failures: verify signatures on updates and downloaded artifacts, use Subresource Integrity for CDN scripts, and never deserialize untrusted data into objects (Java serialization, Python
pickle). - A09 Logging and Alerting Failures: log logins, failures, permission denials and admin actions (without secrets), keep logs where attackers can't erase them, and alert on suspicious patterns.
Using the Top 10
The Top 10 is an awareness document, not a complete checklist. For detailed, testable requirements, use OWASP's ASVS (Application Security Verification Standard) and the Cheat Sheet Series, and for APIs specifically, the OWASP API Security Top 10.
Practice
- Rewrite the UNION example with a placeholder and show that the attack returns nothing.
- Find the mass-assignment bug in:
db.users.update(req.params.id, req.body). How would you fix it? - List three places in an e-commerce app where failing open would be dangerous.
1.Which risk is number one in the OWASP Top 10:2025?
2.What's the general fix for injection flaws?
3.An authorization service times out. What should the app do?