Thursday, April 13, 2017

Laravel CSRF scraping

I am just wondering how much the laravel CSRF protection really adds.

Correct my if I am wrong here but couldn't you just scrape the contents of page once you have acquired a session once?

Laravel grabs the CSRF token that is coupled to a session and adds that to a page as a metatag for AJAX requests.

<meta name="csrf-token" content="">

https://laravel.com/docs/5.4/csrf#csrf-x-csrf-token

Of course you could remove the metatag if you do not need the AJAX functionality, but let's say just you wouldn't.

Once you would have a session in place the CSRF will remain the same for the session. Of course this is a lot of work for someone to set up but isn't this is possible workaround to a CSRF token? I guess it still helps to have a layer of protection that prevents extremely easy copy/paste CSRF attacks.

Just curious, hopefully someone can expand on this.



via Stephan-v

Advertisement