Form Security: nonce vs. jQuery

jQuery is a js library not a transport protocol, your data is sent via GET or POST, wether you use jquery or not.

Think of it like this, sometimes it’s the user in the first frame, sometimes it’s javascript:

enter image description here

Firstly nonces are not the same as sanitisation, they have different purposes

Sanitisation is about verifying what the source says is in the correct format, checking for misformatted data, and catching when malicious data is sent.

Nonces are cryptographic tokens that ensure that the user is sending the request from the correct place, with the correct permission. The user could only have gotten that security token if they were in the right place at the right time ( remember the bug when you could put an image in your content but the src attribute didnt point to an image, it pointed to a facebook logout URL? That’s what nonces are there to prevent ).

So use both.

Also, client side sanitisation isn’t enough. What if I turn off Javascript, or there’s an error preventing the sanitisation running?

See here:
https://stackoverflow.com/questions/3483514/why-is-client-side-validation-not-enough

You need PHP level sanitisaiton too, it’s unavoidable. Never trust anything the client/browser sends you. It may not even be a browser or your page sending it.

Suggested topics of research: