Syllabus

  1. 01Forged Requests (CSRF)How an attacker's page makes a signed-in member's browser act on your site, and the layers that stop it: tokens, SameSite cookies and a check of where the request came from.3 lessons
    1. 01The Request Mina Never Made
    2. 02Anti-CSRF Tokens
    3. 03SameSite Cookies and Source Checks
  2. 02SQL InjectionHow string-built queries hand control of the SQL to the visitor, and how to fix them: bound parameters, allow-lists for the parts that cannot be bound, least privilege and quiet error messages.3 lessons
    1. 01When Input Becomes SQL
    2. 02Bind Values, Don't Build Them
    3. 03Identifiers, Privileges and Error Messages
  3. 03Cross-Site Scripting (XSS)How untrusted text turns into running script in the league's pages (reflected, stored and DOM-based), how to encode or sanitize it at output, what CSP, Helmet and cookie flags add, and what CORS does and does not do.4 lessons
    1. 01Script in the Page: Reflected, Stored and DOM-Based
    2. 02Encode on Output, Sanitize When HTML Is the Point
    3. 03Second Lines of Defence: CSP, Helmet and Cookies
    4. 04CORS Is Not CSRF Protection
  4. 04Defensive JavaScriptHabits that sit under all three attacks: check the shape of every input, cap its size, never redirect or run what a visitor names, keep prototypes clean and keep dependencies patched.2 lessons
    1. 01Check the Shape of Every Input
    2. 02Prototypes, Shells and Dependencies
  5. 05Logging and Incident ResponseHow to record the events that show an attack in progress without leaking secrets or letting visitors write your log, and what to do in the first hours after something gets through.2 lessons
    1. 01Leave a Trail You Can Read
    2. 02When Something Gets Through