Lab: CSRF where Referer validation depends on header being present
This lab's email change functionality is vulnerable to CSRF. It attempts to block cross domain requests but has an insecure fallback.
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 then the request is rejected.
Delete the Referer header entirely and observe that the request is now accepted.
Create and host a proof of concept exploit as described in the solution to the CSRF vulnerability with no defenses. Include the following HTML to suppress the Referer header:
<meta name="referrer" content="no-referrer">