Welcome Guest, Not a member yet? Register   Sign In
CSRF and double posting
#22

(06-21-2016, 08:54 AM)spjonez Wrote:
Narf Wrote:Here's something pedantic: JS and DOM aren't single-threaded, and the latter is not even a relevant term. Browser implementations may be single-threaded - that's a different thing.

Every major browser we have today paints the DOM in a single blocking thread.

Yes, today's browser implementations do that.

But JavaScript itself is not single-threaded (otherwise you wouldn't have those workers) and the DOM is an interface. Interfaces don't have behavior; saying that an interface is single-threaded is a meaningless statement.

I'm being pedantic, that's obvious.

(06-21-2016, 08:54 AM)spjonez Wrote: Sending a synchronous AJAX call blocks this thread. You literally cannot click another link on the page while a request is in progress.

And that's a good thing if you'd be changing DOM elements depending on the response.

(06-21-2016, 08:54 AM)spjonez Wrote: From a UX perspective this is a very poor design and that's the reason it's being removed from the spec.

Yep, and from a technical perspective changing DOM elements when you don't need to is even poorer design.

You don't need to alter a form field if you're going to submit it via AJAX; you don't need that field to exist at all - store the token in a JS variable and update it when receiving responses.

(06-21-2016, 08:54 AM)spjonez Wrote: If a request takes 1-2s you've locked the entire page for that duration. That's not my idea of "how it works best" and they're removing it to stop people from using it this way.

"How it works best" is subjective and depends on the use case.
They're trying to discourage bad practices, but this doesn't mean that the problem we're discussing isn't the result of asynchronicity.

(06-21-2016, 08:54 AM)spjonez Wrote: Obviously we don't see eye to eye on this subject.

Indeed we don't, and that's fine in principle as long as we disagree on opinion-based matters, but that's not the case.
We're having this discussion because you give security advice with UX and "how hard is it to do" arguments, which is wrong.

(06-21-2016, 08:54 AM)spjonez Wrote: CSRF protection is only one security measure and you should implement multiple to protect yourself. I didn't mean to say CSRF is the only protection you need and you should disable settings willy nilly. It works best in tandem with others which is why I mentioned the iframe block. Apparently I've done a poor job of explaining myself so I'll duck out of this thread now.

Unless you're doing another poor job of explaining yourself, it seems that your think CodeIgniter's CSRF protection is "CSRF protection" and X-Frame-Options is not.
They both are CSRF protection mechanisms, working on different principles. You don't need both for the same thing, you pick whichever suits you.
Reply


Messages In This Thread
CSRF and double posting - by PaulD - 06-18-2016, 11:03 PM
RE: CSRF and double posting - by skunkbad - 06-19-2016, 12:05 AM
RE: CSRF and double posting - by John_Betong - 06-20-2016, 09:25 PM
RE: CSRF and double posting - by skunkbad - 06-20-2016, 10:55 PM
RE: CSRF and double posting - by PaulD - 06-19-2016, 12:43 AM
RE: CSRF and double posting - by PaulD - 06-19-2016, 01:00 AM
RE: CSRF and double posting - by PaulD - 06-19-2016, 03:19 AM
RE: CSRF and double posting - by skunkbad - 06-19-2016, 09:30 AM
RE: CSRF and double posting - by PaulD - 06-19-2016, 03:06 PM
RE: CSRF and double posting - by skunkbad - 06-19-2016, 03:35 PM
RE: CSRF and double posting - by PaulD - 06-19-2016, 05:59 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 11:18 AM
RE: CSRF and double posting - by Narf - 06-20-2016, 12:26 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 12:37 PM
RE: CSRF and double posting - by Narf - 06-20-2016, 01:49 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 02:32 PM
RE: CSRF and double posting - by PaulD - 06-20-2016, 01:46 PM
RE: CSRF and double posting - by PaulD - 06-20-2016, 04:02 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 07:00 PM
RE: CSRF and double posting - by Narf - 06-21-2016, 03:38 AM
RE: CSRF and double posting - by spjonez - 06-21-2016, 08:54 AM
RE: CSRF and double posting - by Narf - 06-22-2016, 05:14 AM
RE: CSRF and double posting - by Martin7483 - 06-23-2016, 03:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB