Lab: CSRF where token is duplicated in cookie
Summary: PortSwigger's lab presents an email change function that is vulnerable to CSRF because it relies on the insecure "double submit" prevention technique, where the token is duplicated in a cookie. The exercise asks the tester to host an HTML page on the exploit server that injects a fake csrf cookie into the victim's browser and submits the form to change the viewer's email address, using the account wiener:peter.
What you should know: Double-submit CSRF defenses assume an attacker cannot set a cookie on the victim's domain, so a single cookie-injection path turns the token check into no check at all - and the consequence here is an attacker-controlled email address on the account.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026