A8-Cross-Site Request Forgery (CSRF)

A CSRF attack forces a victim’s browser, with an established session, to send a forged HTTP request, including the victim’s session cookie and any other automatically included authentication information, to a vulnerable web application. This allows the attacker to force the victim’s browser to generate requests the vulnerable application thinks are legitimate requests from the victim.

This is an example of the confused deputy problem, where a program is convinced by another program to abuse its authority.

Example

Fix