The OWASP Top 10: A Practical Guide for Developers
The OWASP Top 10 lists the most critical web risks. Learn each one, the cause, and the concrete fix for it.
By Velloreth
The list
| # | Risk |
|---|---|
| A01 | Broken access control |
| A02 | Cryptographic failures |
| A03 | Injection |
| A04 | Insecure design |
| A05 | Security misconfiguration |
| A06 | Vulnerable and outdated components |
| A07 | Identification and authentication failures |
| A08 | Software and data integrity failures |
| A09 | Security logging and monitoring failures |
| A10 | Server-side request forgery |
A01 Broken access control
A missing or incorrect authorisation check.
// Vulnerable: any user can read any order
app.get('/orders/:id', (req, res) => {
res.json(await db.order.findById(req.params.id));
});
// Fixed: check the owner
app.get('/orders/:id', (req, res) => {
const order = await db.order.findById(req.params.id);
if (order.userId !== req.user.id) return res.status(403).end();
res.json(order);
});
The common form is an insecure direct object reference.
The fix: a server-side check on every request, and deny by default.
A02 Cryptographic failures
A weak algorithm, a missing encryption, or a hardcoded key.
The fixes:
- HTTPS everywhere
- A password hashed with Argon2id or bcrypt
- A secret in a secret store, not in the code
- A modern algorithm, not MD5 or SHA-1
A03 Injection
Untrusted input interpreted as code.
// Vulnerable
db.query(`SELECT * FROM users WHERE name = '${name}'`);
// Fixed: a parameterised query
db.query('SELECT * FROM users WHERE name = $1', [name]);
The fix is a parameterised query, not an escape.
The same applies to a shell command, an LDAP query and an XSS.
A04 Insecure design
A design that cannot be made secure by a fix.
The examples:
- A password reset with a guessable question
- A checkout with no limit
- A rate limit that is missing
The fix is a threat model at design time, not a patch later.
A05 Security misconfiguration
An insecure default or an unnecessary feature.
The examples:
- A default password
- A debug page in production
- A directory listing
- A verbose error with a stack trace
- A missing security header
- An open cloud bucket
It is the most common cause of a breach.
The fix: a hardened baseline and a review of the defaults.
A06 Vulnerable components
A dependency with a known flaw.
The fixes:
- A lockfile
- An automated scan
- A routine update
- A removal of an unused dependency
A07 Authentication failures
A weak authentication.
The examples:
- A weak password policy
- No rate limit on the login
- A session id in the URL
- No rotation after a login
- A credential stuffing attack
The fixes: a rate limit, a multi-factor option, a secure session, and a check against a breached password list.
A08 Integrity failures
A dependency or an update that is not verified.
The examples:
- A package from an untrusted source
- An unsigned update
- A deserialisation of untrusted data
- A CI pipeline that a pull request can modify
The fixes: a signature, a lockfile, a pinned version, and a review of the CI configuration.
A09 Logging failures
A missing log or a missing alert.
The examples:
- No log of a failed login
- No alert on a spike
- A log with no retention
- A secret in the log
The fixes: log the security event, alert on the pattern, and redact the sensitive field.
A10 SSRF
The server fetches a URL the user controls.
// Vulnerable
const res = await fetch(req.query.url);
// Fixed: an allowlist
const allowed = ['api.example.com'];
const host = new URL(req.query.url).hostname;
if (!allowed.includes(host)) return res.status(400).end();
The fix: an allowlist, and a block on the internal address range.
The priority
A01, A03 and A05 are the most common in practice.
A05 is the cheapest to fix, because it is a configuration.
A01 is the most damaging, because it exposes the data.
Common mistakes
A client-side authorisation check. It is bypassed.
A string concatenation in a query. An injection.
A secret in the code. A leak.
A default password. A breach.
A debug page in production. An information leak.
No dependency scan. A known flaw.
No rate limit on the login. A brute force.
No log of a security event. A blind spot.
An SSRF with no allowlist. An internal access.
A security review once. A drift.
A quotable summary
The OWASP Top 10 lists the most critical web application risks, and broken access control is the top one, which is a missing server-side authorisation check. Injection is prevented by a parameterised query rather than an escape, a security misconfiguration is the most common cause of a breach, and a vulnerable component is managed with a lockfile and a routine update. Every item has a concrete fix, and most are cheap.
Related reading
For the related topics, see penetration-testing-basics and dependency-vulnerabilities. For the broader context, csrf-explained and security-headers-guide.