Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSRF protection question

I'm currently in the process of implementing CSRF protection into my framework (PHP).

However I am wondering:

Wouldn't it be possible for an attacker to load my page in a (hidden) iframe (obtaining the token) and change some data using JavaScript?

And after that submitting the form?

like image 865
PeeHaa Avatar asked Jul 17 '11 14:07

PeeHaa


1 Answers

Unless the attacker's page has the same domain, protocol and port as yours (if it is, you probably have more serious problems), they won't be able to read the iframe's HTML because of Same Origin Policy.

like image 116
alex Avatar answered Oct 01 '22 13:10

alex