Test state-changing GET endpoints for CSRF despite SameSite

Cross-site request forgery (CSRF)Discovery

Written with a model's help from “XSS vs CSRF: Two Browser Attacks With Two Different Fixes” by Mohsen Fallahnejad on DEV (xss). Read the writeup before relying on it.

Look for endpoints that change state on a GET request, such as a link that moves funds or flips a setting, and note whether the session cookie is set with SameSite=Lax or Strict. Lax still attaches the cookie to a top-level navigation the user clicks, so a link on attacker.example pointing at such an endpoint can still carry out the action. Get a logged-in user to click the link and confirm on the target that the change actually happened. The same approach works from any subdomain of the target's registrable domain, because SameSite compares sites rather than origins.

html
<a href="https://target.com/transfer?to=attacker&amount=100">view the invoice</a>

Follow #cookies, #csrf or #samesite for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.

Comments

No comments yet.