PrepCity

Web security basics

Security in depth · 3 of 7Security in depth 3 / 7, see the whole branchOpen the lab

By the last page, this is the design you will have built.

Branch: Security in depth · step 3 of 7 · 14 pages · about 13 min

Web security basics

The browser keeps scripts to their own origin and cookies to their own site, but sends requests anywhere. CSRF, XSS, CORS mistakes and clickjacking live in those gaps; SameSite, CSRF tokens, encoding, CSP and a few headers close them.

New words you’ll learn

  • Same-origin policy
  • CSRF
  • CORS
  • SameSite
  • localStorage
  • XSS
  • Content-Security-Policy
  • Defence in depth
  • Preflight
  • CSRF token

Page by page