Lesson 2.3

Cross-site request forgery

CSRF makes a logged-in user’s browser send a request they never intended. SameSite cookies and anti-forgery tokens close it.

Duration
10m
Level
Intermediate
Students
9.8k students

Overview

CSRF makes a logged-in user’s browser send a request they never intended. SameSite cookies and anti-forgery tokens close it.

In this lesson you will:

  • Understand how an ambient credential is abused
  • Set SameSite cookie attributes correctly
  • Validate anti-forgery tokens on state-changing requests

Resources

OWASP Top 10

The official reference for the tools used in this lesson.