CSRF Defence - Double Submit Cookie Pattern

This is the third post I write about CSRF protection. If you didn't read first and second posts. Read them first. Let's start!

Double Submit Cookie Pattern is another method used to prevent from CSRF Attacks. This is very similar to synchronizer token pattern. The difference is CSRF token will not store in server. Instead of storing in server, It will store as a cookie in browser. Furthermore, token value will be sent in header or body in every request. In nutshell, With this pattern, in each client to server request, client send CSRF token within body/header and as a cookie. In the server, it will check weather body/header and cookie has same value of CSRF token or different. Server will only execute operation only if body/header and cookie values same.

This is a sample client to server request with double submit cookie pattern.

If you have any queries, questions, suggestions, Please add comment.

Thank you

Comments

Popular posts from this blog

CSRF Defence - Synchronizer Token Pattern Demo

Lets read emails in gmail using oAuth 2.0 (Application demo)

How to view queries executed in MySQL?