Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

CSRF Bypass in Play Framework- 240

Luca CarettoniPosted 5 Years Ago
  • There are two types of requests, from the browser perspective: simple and preflights. Old school frameworks used to use the difference between these as a mechanism for CSRF protections on state changing actions.
  • The Play Framework used a blacklist on Content-Type on cross-origin requests in order to determine if the request was allowed or not. However, sending a valid request from the browser that was an invalid HTTP request, resulted in None being returned from the request for the Content-Type!
  • Although this was a very simple CSRF check, it looked to be solid, but was eventually defeated. To protect against CSRF attacks, add CSRF tokens to requests and make cookies Same-Site when possible.