Securing Applications

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Securing Applications - Presentation Transcript

    1. Securing Applications A Practical Primer for Developers Burak Dayıoğlu Your security, your future
    2. About the presenter
    3. Application Security Today BJ's Settles Case with FTC over Customer Data JUNE 17, 2005 -- After credit card data for thousands of customers was used to make fraudulent purchases in other stores, BJ's Wholesale Club Inc. has agreed FTC alleges weak security at wholesale club led to fraudulent sales valued in the millions July 19, 2005 -- Visa USA Inc. and American Express Co. are cutting ties with the payment-processing company that left 40 million credit and debit card accounts vulnerable to hackers in one of the biggest breaches of consumer data Visa, Amex Cut Ties with CardSystems Jan 18, 2007 Massive Security Breach Reveals Credit Card Data The TJX Companies, a large retailer that operates more than 2,000 retail stores under brands such as Bob’s Stores, HomeGoods, Marshalls, T.J. Maxx and A.J. Wright, said on Wednesday that it suffered a massive computer breach on a portion of its network that handles credit card, debit card, check and merchandise transactions in the United States and abroad. CNBC's Easy Money BusinessWeek uncovers that the cable channel's own design flaw may be behind the investigation into its million-dollar stock-picking contest USDA admits data breach, thousands of social security numbers revealed Thursday, 17 April 2007 (AXcess News) Washington - The US Department of Agriculture (USDA) admitted that a security breach allowed social security and other personal information of over 63,000 recipients of federal farm loans be made available on a public website in violation of Federal privacy laws.
    4. Holistic Approach to Security Port blocking Filtering Encryption Updates IIS hardening ACLs CAS Logging Least privilege Account mgmt. Validation Hashing Encryption Secrets mgmt. Cookie mgmt. Session mgmt. Error handling Spoofed packets, etc. Buffer overflows, illicit paths, etc. SQL injection, XSS, input tampering, etc. Network Host Application Defend the network Defend the host Defend the application
    5. Hacking with Google
    6. Security in the Development Lifecycle Requirements Assessment Design Complete Test Plans Complete Code Complete Ship Post Ship Applying Security Patterns External Review Development Team Training Security Testing Secure Programming Techniques Source Code Reviews Static Analysis Tools Review Check-Ins Penetration Test Learn and Improve External Review and/or Test Threat Modeling Support and Incident Response Assessing Security Requirements Use of Design Principles Inspecting Previous Vulnerabilities
    7. Guiding Design Principles
      • Secure the weakest link
      • Practice defense in depth
      • Fail securely
      • Follow the principle of least privilege
      • Compartmentalize
      • Keep it simple
      • Remember that hiding secrets is hard
      • Be reluctant to trust
    8. Attack Surface Reduction (ASR)
      • A system's attack surface is the set of ways in which an attacker can enter and potentially cause damage to the system
      • T he measure of a system's attack surface is an indication of the system's security
        • T he larger the attack surface, the more insecure the system
    9. Reducing the Attack Surface
      • Reduce the amount of running code
        • 80 % of your users actually use the functionality? If not, turn it off
      • Reduce entry points
        • If you can do the same with less ports, sockets, service entry points etc., then just do it
      • Reduce a ccess to e ntry p oints by u ntrusted u sers
        • Restrict access to network endpoints used by your application to the local subnet or IP range
    10. Input Validation
      • All data coming from untrusted sources should be validated before being processed
        • It might be possible to tamper application flow and/or behaviour with invalid data
      • What you can trust depends on the application context
        • Users
        • Applications on same host
        • Shared libraries (.so, .dll etc.)
        • OS interfaces
        • Other modules in the same app.
    11. Blacklisting is “Bad”
      • Endless security issues with PHF (mid 1990’s)
        • Command injection (improper input validation)
        • Fix through blacklisting
        • Command injection, round 2 (in just two days)
        • Fix through blacklisting
        • Command injection, round 2 (in just another day)
        • Fix through whitelisting (Problem solved)
      • Command injection, SQL injection, LDAP injection etc.
    12. Sample SQL Injection
      • Sample vulnerable code fragment
      • When criteria is SECURITY
      • When criteria is “’; DELETE FROM news--”
      $query = “SELECT title FROM news WHERE body LIKE ‘%” . $criteria . ”%’”; SELECT title FROM news WHERE body LIKE ‘%SECURITY%’ SELECT title FROM news WHERE body LIKE ‘% ’; DELETE FROM news -- %’
    13. What would be the Query?
      • Select * from users where
      • username = “ _1_ ” and
      • password = “ _2_ ”;
    14. Cross-Site Scripting (XSS) /location=<script>document.images[4].src= &quot;http://www.badsite.com/news.jpg&quot;</script>
    15. Web is just a messaging protocol
    16. HTML Form Tampering <FORM METHOD=POST ACTION=&quot;/ pb/phonebook . php &quot;> < INPUT type=&quot;hidden&quot; name=&quot;sessionID&quot; value=” ad757gj02m357 ”> < INPUT type=&quot;hidden&quot; name=“ username &quot; value=” pinguin ”> < INPUT type=&quot;submit&quot; name=“ Retrieve Entries &quot;> </ FORM > 1 <INPUT TYPE=text NAME=phonenumber MAXLENGTH=30> 2 <INPUT TYPE=“radio” NAME=“agegroup” VALUE=“young”> <INPUT TYPE=“radio” NAME=“agegroup” VALUE=“middle”> <INPUT TYPE=“radio” NAME=“agegroup” VALUE=“old”> 3 <SELECT NAME=“langs”> <OPTION VALUE=PHP>Personal Home Page</OPTION> <OPTION VALUE=ASP>Active Server Pages</OPTION> </SELECT> 4
    17. Validating Form Data in Browser
      • Client side validations can be bypassed or tampered
      <HTML> <HEAD><TITLE> Client Side Val idation Example </TITLE> <SCRIPT LANG=&quot;Javascript1.2&quot;> <!-- function checkmail () { regexp mail = /^[a-z0-9_-.]+@([a-z0-9_-]+.)+[a-z0-9_-]+$/ ; stre mail = document. my form.e mail .value; result = stre mail . match (regexp mail ); if ( !result ) { alert (“ Address information not valid, pls try again &quot;); return false; } return true; } //--> </SCRIPT></HEAD><BODY> <FORM NAME= my form ONSUBMIT=&quot;return checkmail ()&quot;> <INPUT TYPE=text NAME=e mail MAZLENGTH=50><INPUT TYPE=submit VALUE=“ Submit &quot;> </FORM> </BODY></HTML>
    18. Error Messages
      • Error messages might reveal sensitive information to a potential attacker
        • Portions of an SQL statement
        • Error message that includes brand/version of database or directory server
        • Error message for a file that doesn’t open up
      • Handle all failure cases that you can foresee, configure the environment to log (and not display) verbose error messages
    19. Filesystem Operations and Security
      • Any component that operates on files is of high risk
        • If input validation is broken somehow
          • Arbitrary files might be read
          • Arbitrary files might be overwritten
          • Arbitrary files might be uploaded & executed
      • Beware critical symbols for filesystem objects and the OS shell
        • . .. && || > < *
        • ; null (%00)
    20. Easy to Guess Files and Directories
      • There are things to discover by just educated guessing
        • /CVS
        • /admin
        • /test
        • README
        • INSTALL
        • backup.zip
    21. Backup Files
      • Would one of them be left somewhere?
        • mycode.jsp~
        • mycode.jsp.OLD
        • mycode.jsp.ORIG
        • mycode.jsp.BACK
        • mycode.jsp.BAK
    22. Directory Listings
      • Directory listings should be turned-off for all servers/sites
    23. Thank you! [email_address] Twitter: dayioglu FriendFeed: dayioglu http://www.burakdayioglu.net Your security, your future

    + Burak DAYIOGLUBurak DAYIOGLU, 11 months ago

    custom

    863 views, 1 favs, 3 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 863
      • 766 on SlideShare
      • 97 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 28
    Most viewed embeds
    • 83 views on http://www.burakdayioglu.net
    • 13 views on http://www.secguru.com
    • 1 views on http://74.125.77.132

    more

    All embeds
    • 83 views on http://www.burakdayioglu.net
    • 13 views on http://www.secguru.com
    • 1 views on http://74.125.77.132

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories