CSRF protection for web apps

CSRF - Cross Site Request Forgery 



when users authenticated to the web service or app it will creates an session cookies and some other cookies to identify the user resubmit data to the server after authenticate process.

Attackers are gain advantage of this process, they create an web page to  trick the users and get clicked to an link or button to submit data behalf of the users without known them.

as and example - attacker create an malicious website that has a link saying "click this to win the price"


but there are another hidden field that contain hidden data that attacker actually wants to post on your facebook status. but user don't see it.

when user clicks on the link that hidden field data will be submitted to the facebook url as POST method.

now the attacker successfully trick the user to put something attacker wants in as users facebook status.

How to prevent CSRF

there ate main two methods use in commonly to prevent csrf attacks.

  1. Synchronizer token pattern - click here to see how its done
  2. Double submit token cookie - click here to see how its done

Comments

Popular posts from this blog

Hack The Box - How to hack in to the game ;)

implement CSRF protection - Synchronizer token pattern

Jaggery From WSO2