from what I understand a common approach to storing a CSRF token would be:
- the client retrieves from the server a CSRF token
- the token is stored in an input element inside the form like this:
<form>
<input type="hidden" name="token" value="abc123supersecrettoken">
</form>
my question is, would an attack like this be possible, and if so, how can a site be protected:
- user logins into facebook.com
- user goes to evil.com, the site has he following iframe:
<iframe src="https://www.facebook.com/changeUserPasswordForm"></iframe>
- with some basic DOM manipulation on the iframe, the CSRF token could be accessed by the attacker