Make csrf verification (verified_request?) a public method

28 views
Skip to first unread message

Wenqin Ye

unread,
Jul 23, 2015, 3:04:18 PM7/23/15
to Ruby on Rails: Core
I'm currently implementing a chat application using web sockets, with faye, and when I go to implement their suggested CSRF protection for the pub/sub channel in rails (http://faye.jcoglan.com/security/csrf.html) I will always get an access denied error.

I thought it was weird and upon further inspection, I noticed that the authenticity_token and the csrf_token stored in the session were different and thought that was weird too. After looking at the source code, it encrypted the authenticity token, and that it had to be decoded to get the csrf_token to compare to. 

This is a hassle, and I think that the verification should be made public in case somebody wants to do CSRF verification through pub/sub apps like the faye one I showed.


I could be wrong, and there may be another way to do it, but I just thought I would suggest this.  




Reply all
Reply to author
Forward
0 new messages