Cross-site request forgery (CSRF)

Portswigger Academy CSRF Labs

Cross-site request forgery (CSRF) is a client-side technique used to attack other users of a web application.

CSRF remains a persistent but declining threat, but it is still a Top 10 Web Risk (OWASP A05:2021) and appears in legacy systems (older PHP/Java apps), APIs with cookie-based auth (especially state-changing actions), and misconfigured SPAs (missing anti-CSRF tokens).

Testing is still worth it when the he app uses session cookies (not just JWT/Bearer tokens), state-changing actions exist (e.g., password changes, payments), and there are no framework defaults (e.g., Django CSRF middleware disabled).


Last update: 2025-05-12 14:16