Cross Site Request Forgery
- 3. “ There is no metric for compliance with a 'culture', and a 'culture of security' is overridden by a culture of 'get the job done' every time.” Jon Espenschied
- 4. Common Coding Vulnerabilities Injection Flaws (SQL, LDAP, XPath, etc) Cross Site Scripting (XSS) Cross Site Request Forgeries (CSRF) Buffer Overflows
- 5. CSRF Defined Cross-site request forgery, also known as one click attack, sidejacking or session riding and abbreviated as CSRF (Sea-Surf) or XSRF, is a type of malicious exploit of websites. Although this type of attack has similarities to cross-site scripting (XSS), cross-site scripting requires the attacker to inject unauthorized code into a website, while cross-site request forgery merely transmits unauthorized commands from a user the website trusts.
- 6. “ Same Origin” Policy document, cookies bank.com blog.net XHR XHR TAG TAG JS
- 7. How CSRF Works GET requests are the easiest: - Beware “src” and “href” attributes POST aren't immune: <body onload=”document.forms[0].submit()”> <form method=”POST” action=”_url_”> <input type=”hidden” name=”amount” value=”$1,000” /> </form>
- 8. What Can a Hacker Do With CSRF? Anything an authenticated user can do. Click links, submit forms, complete multi-step wizards. Launch external attacks on Intranet sites. No restrictions on same origin policy but are limited in that hackers can't read responses from other origins
- 11. CSRF Prevention Avoid Persistent Sessions Use GET method properly Token-based checks with TTL. Double Authenticate via AJAX (read cookie via JS and submit in the body). Code reviews.
- 17. Credits Some material in this presentation is covered by the OWASP license, specifically work by Eric Sheridan Any of my own contributions are also covered by the OWASP license which can be found at http://www.owasp.org.