The OWASP Top 10 is a widely used awareness list of the most critical web application security risks, compiled from real data and revised every few years. This tour follows the 2021 edition. Check the OWASP site for newer revisions.
The categories
- Broken access control: users can act outside their permissions, for example by changing an id in a URL. Check authorisation on the server for every request.
- Cryptographic failures: sensitive data sent or stored without proper encryption, or with weak algorithms. Use TLS everywhere and modern, well-reviewed algorithms.
- Injection: untrusted input becomes part of a command, such as SQL or a shell command. Use parameterised queries and avoid building commands from strings.
- Insecure design: missing security thinking at design time, such as no limit on password guesses. Model threats early.
- Security misconfiguration: default accounts, verbose errors, open storage buckets. Harden and review settings.
- Vulnerable and outdated components: libraries with known flaws. Track and update dependencies.
- Identification and authentication failures: weak passwords, no brute-force protection, broken sessions. Use proven login libraries and multi-factor authentication.
- Software and data integrity failures: trusting code or data you did not verify, such as unsigned updates or insecure deserialisation.
- Security logging and monitoring failures: attacks happen and nobody notices. Log security events and alert on them.
- Server-side request forgery (SSRF): the server is tricked into fetching an internal URL. Validate and restrict outbound requests.
A pattern across the list
Most categories come from the same causes: trusting input, forgetting to check who is asking, and leaving defaults unchanged.
# Authorisation belongs on the server, for every access.
def show_invoice(current_user, invoice)
raise "forbidden" unless invoice[:owner_id] == current_user[:id]
invoice
end
puts show_invoice({ id: 1 }, { owner_id: 1, total: 100 })How to use the list
- Use it as a checklist in design and code review, not as a compliance goal.
- Pick the three categories most relevant to your application and test for them first.
- Automated scanners find some of these issues, but access control and design flaws usually need a human.
Takeaway
Learn the ten names, and for each one remember the first defence. Most real incidents come from basics left undone, not from exotic attacks.
Comments