Skip to content
Velloreth
Cybersecurity 4 min read

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

The list

#Risk
A01Broken access control
A02Cryptographic failures
A03Injection
A04Insecure design
A05Security misconfiguration
A06Vulnerable and outdated components
A07Identification and authentication failures
A08Software and data integrity failures
A09Security logging and monitoring failures
A10Server-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.

For the related topics, see penetration-testing-basics and dependency-vulnerabilities. For the broader context, csrf-explained and security-headers-guide.

Frequently asked questions

What is the OWASP Top 10?
A list of the ten most critical web application security risks, published by the Open Worldwide Application Security Project. It is a starting point for a security review, not a complete checklist. Each item describes a class of risk with the cause and the prevention.
What is broken access control?
A missing or incorrect authorisation check, so a user can access a resource they should not. It is the top risk, and the common form is an insecure direct object reference, where a user changes an id in a URL and reaches another user's data. The fix is a server-side check on every request.
What is injection?
When untrusted input is interpreted as code or a command, such as SQL, a shell command or an LDAP query. The fix is a parameterised query or an allowlist, not an escape. An ORM with a parameterised query prevents SQL injection.
What is a security misconfiguration?
An insecure default, an unnecessary feature, an open port, a verbose error, or a missing header. It is the most common cause of a breach, because it is easy to leave a default in place. The fix is a hardened baseline and a review of the defaults.
What is a vulnerable component?
A dependency with a known flaw. The fix is to track the dependencies, to scan them, and to update them on a routine. A lockfile and an automated alert make it manageable.
What is the difference between authentication and authorisation?
Authentication confirms who the user is, and authorisation decides what they may do. A failure in either is a risk, and the two are separate items in the list. A strong authentication does not help if the authorisation is missing.