Beginner · Free · In your browser
Learn Web Security Foundations
Learn the security basics every web developer needs by finding and fixing real holes in small apps, in a sandbox where attacks cannot reach anyone. Stop cross-site scripting with safe DOM code, escaping and allow-list sanitizing; handle addresses and links safely; read and audit a Content Security Policy; set password rules that help and store passwords with slow, salted hashes; protect sessions with cookie attributes, CSRF tokens and careful token handling; understand CORS; prevent SQL injection; validate on the server; slow down brute force; check security headers; and finish with a full security review of a comment section.
No installation. Your code runs right in the browser. Finish JavaScript in the Browser first, or be comfortable with the DOM, events, forms and fetch. Every attack you try here stays inside a safe sandbox.
What you will be able to do
- Stop cross-site scripting with safe DOM code, escaping and allow-list sanitizing
- Store passwords with slow, salted hashes and set password rules that help
- Protect sessions with secure cookies, CSRF tokens and careful token handling
- Prevent injection, validate on the server, limit brute force and audit security headers
Course outline
Untrusted input
Allow-lists, cross-site scripting, dangerous addresses, and input from the address bar.
Safe HTML and pages
Escaping, allow-list sanitizing, links that leave your site, and Content Security Policy.
Passwords and sessions
Password rules, password hashing, session cookies, and a secure sign-up project.
Requests you can trust
Cross-site request forgery, keeping tokens safe, and CORS.
Server-side defences
Injection and placeholders, validation on the server, and rate limits.
Defence in depth and the capstone
Security headers, then a complete security review of a comment section.
Ready for your first line?
Every lesson is short, hands-on, and checked automatically.
Start learning Web Security Foundations →