OWASP Top 10: A Developer's Checklist
The OWASP Top 10 is the most widely referenced list of web application security risks, and most of the entries come down to a handful of habits that are cheap to build in from the start. Here's what each one means in practice, not just the name.
1. Broken Access Control
Checking that a user is logged in isn't the same as checking they're allowed to access this specific resource. Always verify ownership/permission server-side on every request — never trust a hidden form field or client-side check alone:
// Bad: anyone logged in can fetch any invoice by ID
const invoice = await db.invoice.findUnique({ where: { id } });
// Good: scoped to the authenticated user
const invoice = await db.invoice.findUnique({
where: { id, userId: currentUser.id },
});
2. Cryptographic Failures
Hash passwords with a slow, purpose-built algorithm (bcrypt, argon2, scrypt) — never store them in plain text or hash them with a fast general-purpose hash like MD5 or SHA-256 alone. Use TLS everywhere, including internal service-to-service calls where practical.
3. Injection
SQL injection, command injection, and similar attacks all come from building queries or commands by concatenating untrusted input. Use parameterized queries or an ORM, always:
// Vulnerable
db.query(`SELECT * FROM users WHERE email = '${email}'`);
// Safe
db.query('SELECT * FROM users WHERE email = $1', [email]);
4. Insecure Design
Some vulnerabilities aren't bugs — they're missing controls that should have been part of the design, like rate limiting on a login endpoint or a missing re-authentication step before changing a password.
5. Security Misconfiguration
Default credentials left unchanged, verbose error messages leaking stack traces in production, unnecessary services exposed, and overly permissive CORS settings all fall here. These are usually caught by a basic hardening checklist before go-live.
6. Vulnerable and Outdated Components
Run dependency audits regularly (npm audit, Dependabot, Trivy for container images) and actually act on what they report, not just generate the report.
7. Identification and Authentication Failures
Weak password policies, missing multi-factor authentication, and session tokens that don't expire or rotate all belong here. Favor well-tested auth libraries over hand-rolled session logic.
8. Software and Data Integrity Failures
Verify the integrity of updates, plugins, and CI/CD dependencies — a compromised build pipeline or an unsigned auto-update mechanism is an increasingly common attack path.
9. Security Logging and Monitoring Failures
If a breach happens, can you tell when it started and what was accessed? Log authentication events, access control failures, and high-value actions, and make sure someone actually reviews or alerts on that data.
10. Server-Side Request Forgery (SSRF)
Any feature that fetches a URL supplied by a user (image proxies, webhooks, link previews) can be tricked into making requests to internal services. Validate and restrict destinations rather than fetching arbitrary URLs.
Summary
None of these require exotic tooling to address — parameterized queries, scoped access checks, dependency audits, and basic logging cover most of the list. The goal isn't memorizing the names; it's recognizing the pattern each one represents so you catch it while writing the code, not after a pentest report.
