Web security and the OWASP Top 10

The mistakes behind most website breaches and their fixes, each shown as vulnerable code next to fixed code: broken access control, SQL injection, cross-site scripting, cross-site request forgery and weak logins.

About 12 hours of study

Learning objectives

Lessons

  1. 1

    The OWASP Top 10 and broken access control

    The map of web application risks: the OWASP Top 10 categories in plain words, and the top one, broken access control, with the classic insecure direct object reference and its fix.

  2. 2

    SQL injection and parameterized queries

    How pasting user input into SQL lets one input box change what a query means, the classic payloads shown on a fake in-page table, and the fix: parameterized queries, plus allow-lists and least privilege.

  3. 3

    Cross-site scripting (XSS)

    How text treated as HTML lets an attacker's script run in every reader's browser, the stored, reflected and DOM-based kinds, and the fix: output encoding, with a Content-Security-Policy and HttpOnly cookies as extra layers.

  4. 4

    Cross-site request forgery (CSRF)

    How another site can make your browser send a request to a site where you are logged in, why it targets actions and not data, and the defences: CSRF tokens, SameSite cookies and Origin checks.

  5. 5

    Broken authentication and sessions

    Credential stuffing, password spraying and stolen sessions, and the defences: rate limits with growing delays, safe session IDs that are renewed and expired, generic errors and safe password resets.

Module practice

Module quiz

1. Which fix stops SQL injection at its root?
2. A forum shows comments with innerHTML. A comment contains <img src=x onerror=steal()>. What happens?
3. What does a CSRF token prove?
4. A user changes ?order=88 to ?order=89 and sees a stranger's order. Which risk is this?
5. Why is renewing the session ID at login important?
6. An app uses SameSite=None cookies and no CSRF tokens on its POST forms. What should change first?

‹ Network securitySecurity in practice ›