CSRF: Exploitation, Tokens & SameSite Defense

Comprehensive CSRF Guide 🆕 Updated September 12, 2026 — added the NASA AIT-GUI command-bus CSRF chain and a reminder that simple content types skip preflight entirely. A practitioner’s reference for Cross-Site Request Forgery — attack surface, exploitation techniques, SameSite and token bypasses, real-world chains, and detection/prevention. Mixing it up with SSRF? CSRF vs SSRF: Key Differences, Examples & Defenses puts the two side by side. Table of Contents Fundamentals Attack Surface & Preconditions Attack Delivery Techniques Content-Type & JSON CSRF SameSite Cookie Model SameSite Bypass Techniques CSRF Token Bypasses Referer / Origin Check Bypasses Method Override & Verb Tampering Login & Logout CSRF CORS Misconfiguration Chains Clickjacking Overlap Real-World Cases & CVEs Exploitation Chains Tools & Automation Detection & Testing Methodology Prevention & Defense in Depth Payload Quick Reference 1. Fundamentals Cross-Site Request Forgery (CSRF / XSRF / “sea-surf”) is an attack that tricks an authenticated user’s browser into submitting a state-changing request to a target application. The victim’s browser automatically attaches ambient credentials — cookies, HTTP Basic auth, client certificates, Kerberos tickets, IP-based authorization — so the target application cannot distinguish a forged request from a legitimate one. ...

April 10, 2026 Â· Updated October 21, 2026 Â· 29 min Â· Carl Sampson

CSRF vs SSRF: Key Differences, Examples & Defenses

The one-line difference: CSRF tricks a user’s browser into sending a request the user didn’t intend; SSRF tricks your server into sending a request the attacker chose. CSRF (Cross-Site Request Forgery) SSRF (Server-Side Request Forgery) Who sends the forged request The victim’s browser Your application server Whose trust is abused The site’s trust in the user’s cookies The network’s trust in the server What the attacker needs A logged-in victim to visit their page Any input the server turns into a URL fetch Typical target A state-changing endpoint (POST /transfer, /email/change) Internal hosts, cloud metadata (169.254.169.254), localhost admin ports Attacker sees the response? No, the browser’s same-origin policy hides it Sometimes (full-read SSRF); often blind Worst case Actions taken as the victim: account takeover, transfers Cloud credential theft, internal network access, sometimes RCE Primary defenses CSRF tokens, SameSite cookies, Origin checks Destination allowlist, resolved-IP checks, egress filtering, IMDSv2 CWE CWE-352 CWE-918 OWASP Top 10 Under A01 Broken Access Control A10:2021; merged into A01 in the 2025 list They both have “request forgery” in the name, so people lump them together. But they’re completely different beasts that’ll bite you in completely different ways, and the defense for one does nothing for the other. I’ve spent way too many nights debugging both, so here’s the side-by-side first, then the detail. ...

May 1, 2026 Â· Updated November 2, 2026 Â· 8 min Â· Carl Sampson