top | item 6884590

(no title)

schpet | 12 years ago

is this secure by default in rails yet? i find it surprising that these techniques are promoted at the same time vulnerabilities are being publicly disclosed:

https://groups.google.com/d/msg/rubyonrails-core/rwzM8MKJbKU...

discuss

order

nfm|12 years ago

I believe the fix for this (checking if the request is xhr) hasn't been committed yet.

rst|12 years ago

Is that completely adequate? There was an earlier round of changes due to attackers being able to forge the .xhr header on requests. (This was the patch set at which Rails started checking CSRF tokens on .xhr? requests; before that, they got a free pass.)

See http://weblog.rubyonrails.org/2011/2/8/csrf-protection-bypas...

krapp|12 years ago

Is there a way to check that which can't be faked by altering the browser or a js framework though?

I was under the impression that trying to validate that was ultimately as fragile as checking the user-agent string...