CSRF Testing
Find areas that should have CSRF protection and test if it's actually enforced.
8-Step Test
Standard CSRF test – remove the token entirely
Change method to GET
Change CSRF token value to undefined
Delete CSRF token value or entire parameter
Use same CSRF token across two different accounts
Replace CSRF token with same-length random string
Change content-type from application/json to text/plain
Use a vulnerable subdomain to bypass CSRF token validation
Bypass Techniques
Blank Referer
<meta name="referrer" content="no-referrer" />
iframe data URI
<iframe src="data:text/html;base64,BASE64_ENCODED_FORM">
Referer Bypass
If they check that their domain is in the Referer header:
https://yoursite.com/https://theirsite.com/
The parser may match theirsite.com as a substring.
Clickjacking CSRF
Wrap the sensitive form in an iframe for clickjacking – forces user interaction that carries their session. See Bug Chaining for details.
Focus Areas
Account profile updates (name, email, password)
Email change – especially if no second confirmation required
Privilege changes, adding OAuth apps
Payment actions
Admin-only actions
Escalation
See Also