Cross-Site Request Forgery
Table of Contents
A state-changing request is forged on behalf of an authenticated victim whose browser automatically sends session cookies. The server cannot distinguish the forged request from a legitimate one. Requires the victim to be authenticated and to visit an attacker-controlled page while their session is active.
CSRF only works against state-changing actions (POST, PUT, DELETE, PATCH). Reading data requires XSS. GET-based state changes are an immediate finding regardless of CSRF tokens.
Related: XSS Session Management Testing HTTP Security Headers Web Application Testing Methodology PT1 Vulnerability Classification Cheat Sheet
1. Identifying CSRF Candidates
Look for state-changing actions without CSRF protection: - Password / email change - Account deletion - Fund transfer / order placement - Admin actions (user creation, privilege changes) - Settings updates Signs of CSRF token absence: - No hidden token field in forms - No X-CSRF-Token / X-Requested-With header in requests - Token present but not validated (same token works repeatedly) - Token present but not tied to session (any valid token accepted)
Check in Burp: intercept the state-changing request and look for token parameters. Remove or tamper the token and replay — if the action still succeeds, CSRF protection is absent or broken.