Replay a CSRF token from your own account in a second account's request to test whether tokens are session-bound
Many apps validate that a CSRF token is a token they issued, not that it was issued to this session. If so, the token protects nothing, because an attacker can fetch a valid one from their own account and place it in a forged form.
Use two test accounts, A and B. Log in as A and copy the CSRF token from a state-changing form, for example csrf_token=<tokenA>. In B's session, replay the same request with B's cookie and A's token:
POST /account/email HTTP/1.1
Cookie: session=<sessionB>
Content-Type: application/x-www-form-urlencoded
email=test@example.com&csrf_token=<tokenA>Also try the same request with the csrf_token parameter removed entirely, and with an empty value. Some frameworks only check the token when the parameter is present.
It is a real finding only if B's email actually changes: confirm by reloading B's settings page. A 403 or a 200 that leaves the state unchanged is not a bug. It is also not worth reporting if the cookie is SameSite=Strict and the endpoint has no other cross-site path, so note the cookie flags in the report. Use only accounts you own and stay inside program scope.
Follow #csrf, #session-binding or #token-validation for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.
Comments
No comments yet.