Tips

Cross-site request forgery (CSRF) tips

Cross-site request forgery makes a victim’s browser send a state-changing request to the target while they are signed in. SameSite cookies stopped many cases, but not all of them.

Published tips, newest first. Payloads and commands are shown as plain text.

Cross-site request forgery (CSRF): how to hunt it

Where to look

  • State-changing GET requests, and POST requests that accept form or text/plain bodies without a token.
  • Tokens that are not checked, not tied to the session, or not needed once removed.
  • Cookies set with SameSite=None, and same-site attacks from a subdomain you can control.
  • Login CSRF, and OAuth flows without a state parameter.

What proves it

Give a minimal HTML page that performs the action on a test account when opened, and show the change it made.

Read further

Writeups on Cross-site request forgery (CSRF), by hunters and researchers, most with a short summary.

Related classes