u/Psionatixin r/node • Recommends
Secure CSRF alternative to csurf
I saw a post recently where someone made their own CSRF alternative for csurf, I commented on that post, as well as on the repo, about how and why their code is insecure - in the same ways that csurf was insecure.
For context, you can see 11:30 of this video: link to this video
And that wasn't the only thing wrong with that code.
However, as someone who actually knows what they are doing and has security experience, I have just updated my Double Submit token pattern middleware utility to have native cjs support in addition to esm:
csrf-csrf
Version 2.1 brings commonjs support.
Also, if you wish to use the Synchronised Token Pattern instead, the sister library csr…