Successfully reported this slideshow.

Web Security Overview and Demo

4,629 views

Published on

Published in: Technology
  • Be the first to like this

Web Security Overview and Demo

  1. 1. <ul><ul><li>Presented by Tony Bibbs </li></ul></ul><ul><ul><li>October 9, 2008 </li></ul></ul>Web Application Security
  2. 2. Rasmus Lerdorf “ The Web is broken and it's all your fault.”
  3. 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. 4. Common Coding Vulnerabilities <ul><li>Injection Flaws (SQL, LDAP, XPath, etc)‏ </li></ul><ul><li>Cross Site Scripting (XSS)‏ </li></ul><ul><li>Cross Site Request Forgeries (CSRF)‏ </li></ul><ul><li>Buffer Overflows </li></ul>
  5. 5. Injection Flaws <ul><li>“ SQL injection is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.” </li></ul>
  6. 6. Cross Site Scripting (XSS)‏ <ul><li>“ Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which allow code injection by malicious web users into the web pages viewed by other users. An exploited cross-site scripting vulnerability can be used by attackers to bypass access controls such as the same origin policy. Vulnerabilities of this kind have been exploited to craft powerful phishing attacks and browser exploits. As of 2007, cross-site scripting carried out on websites were roughly 80% of all documented security vulnerabilities.” </li></ul>
  7. 7. CSRF Defined <ul><li>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. </li></ul>
  8. 8. “ Same Origin” Policy document, cookies bank.com blog.net XHR XHR TAG TAG JS
  9. 9. How CSRF Works <ul><li>GET requests are the easiest: </li></ul><ul><ul><li>- Beware “src” and “href” attributes </li></ul></ul><ul><li>POST aren't immune: </li></ul><ul><ul><li><body onload=”document.forms[0].submit()”> </li></ul></ul><ul><ul><li><form method=”POST” action=”_url_”> </li></ul></ul><ul><ul><ul><li><input type=”hidden” name=”amount” value=”$1,000” /> </li></ul></ul></ul><ul><ul><li></form> </li></ul></ul>
  10. 10. What Can a Hacker Do With CSRF? <ul><li>Anything an authenticated user can do. Click links, submit forms, complete multi-step wizards. </li></ul><ul><li>Launch external attacks on Intranet sites. </li></ul><ul><li>No restrictions on same origin policy but are limited in that hackers can't read responses from other origins </li></ul>
  11. 11. Trivial CSRF Exploit
  12. 12. Exploiting Otherwise Secure Networks
  13. 13. CSRF Prevention <ul><li>Avoid Persistent Sessions </li></ul><ul><li>Use GET method properly </li></ul><ul><li>Token-based checks with TTL. </li></ul><ul><li>Double Authenticate via AJAX (read cookie via JS and submit in the body). </li></ul><ul><li>Code reviews. </li></ul>
  14. 14. Framework-based Security <ul><li>Framework implementations force security precautions. </li></ul><ul><li>PHP Examples: Flexy, Tainted Variables </li></ul><ul><li>CSRF prevention in PHP framework. </li></ul>
  15. 15. CSRF Resources <ul><li>CSRFGuard (Java, .NET and PHP)‏ </li></ul><ul><li>CSRTTester </li></ul>
  16. 16. Enterprise CSRF Mitigation
  17. 17. Questions?
  18. 18. Contacting Me <ul><li>[email_address] </li></ul><ul><li>(515)281-6125 </li></ul>
  19. 19. Credits <ul><li>Download this presentation and sample code from here . </li></ul><ul><li>Some material in this presentation is covered by the OWASP license, specifically work by Eric Sheridan </li></ul><ul><li>Any of my own contributions are also covered by the OWASP license which can be found at http://www.owasp.org . </li></ul>

×