Lab: CSRF with broken Referer validation
This lab's email change functionality is vulnerable to CSRF. It attempts to detect and block cross domain requests, but the detection mechanism can be bypassed.
To solve the lab, use your exploit server to host an HTML page that uses a CSRF attack to change the viewer's email address.
You have an account on the application that you can use to help design your attack. The credentials are:
With your browser proxying traffic through Burp Suite, log in to your account, submit the "Change email" form, and find the resulting request in your Proxy history.
Send the request to Burp Repeater and observe that if you change the domain in the Referer HTTP header the request is rejected.
Copy the original domain into the Referer's query string and observe that the request is now accepted.
history.pushState("", "", "/?$original-domain")