Wednesday, February 26, 2014

Cross Site Request Forgery protection (CSRF)



I just build some web application using Django, and I found some interesting thing when using Ajax through Django Framework.

I am not deep in knowledge and advance programmer nor developer, just like script kiddies and I always want to know about new thing. Formerly I am Python big fan, so I want to create something with Python. Not only for building system nor system programming but I want to make something different :-).

In Django if we want to request using Ajax, Django will response with access forbidden. Why? because Django care about security to prevent again Cross Site Request Forgery protection (CSRF). Which is the first defense against CSRF attacks is to ensure that GET requests (and other ‘safe’ methods, as defined by 9.1.1 Safe Methods, HTTP 1.1, RFC 2616) are side-effect free. Requests via ‘unsafe’ methods, such as POST, PUT and DELETE.

At first time I confuse how to use it :-D #newbie, but then I found good documentation from Django documentation, very clear and bulls eye.

No comments:

Post a Comment