What is a Cross Site Request Forgery (CSRF)?
A CSRF is a type of exploit that a malicious website or attacker could employ to have a user send unauthorized commands to a website or application. It is a type of confused deputy attack against a user’s web browser that tricks it to send malicious HTTP requests to a target website.
Some CSRF techniques are trivial to employ. For example, it is possible to place an arbitrary URL within an HTML IMG tag which will convince your browser to run an HTTP GET against that URL.
Try out this example that uses RequestBin. I added an image tag to a page in my local web setup.
When I checked RequestBin then I could see what the request from my browser looked like to the external service.
A malicious HTTP GET can potentially expose sensitive information. For HTTP GET requests, the state of the system rarely changes meaning that lasting damage can be limited. What can be more troubling is when a browser is tricked into performing an HTTP POST using a maliciously designed HTML form.