MITIGATION OF WEB-BASED PROGRAM SECURITY VULNERABILITY EXPLOITATIONS by Hossain Shahriar A thesis submitted to the School of Computing in conformity with the requirements for the degree of Doctor of Philosophy Queen’s University Kingston, Ontario, Canada November 2011 Copyright ©Hossain Shahriar, 2011 Abstract Over the last few years, web-based attacks have caused significant harm to users. Many of these attacks occur through the exploitations of common security vulnerabilities in web-based programs. Given that, mitigation of these attacks is extremely crucial to reduce some of the harmful consequences. Web-based applications contain vulnerabilities that can be exploited by attackers at a client-side (browser) without the victim’s (browser user’s) knowledge. This thesis is intended to mitigate some exploitations due to the presence of security vulnerabilities in web applications while performing seemingly benign functionalities at the client-side. For example, visiting a webpage might result in JavaScript code execution (cross-site scripting), downloading a file might lead to the execution of JavaScript code (content sniffing), clicking on a hyperlink might result in sending unwanted legitimate requests to a trusted website (cross-site request forgery), and filling out a seemingly legitimate form may eventually lead to stealing of credential information (phishing). Existing web-based attack detection approaches suffer from several limitations such as (i) modification of both server and client-side environments, (ii) exchange of sensitive information between the server and client, and (iii) lack of detection of some attack types. This thesis addresses these limitations by mitigating four security vulnerabilities in web applications: cross-site scripting, content sniffing, cross- site request forgery, and phishing. We mitigate the exploitations of these vulnerabilities by developing automatic attack detection approaches at both server and client-sides. We develop server-side attack detection frameworks to detect attack symptoms within response pages before sending them to the client. The approaches are designed based on the assumption that the server-side program source is available for analysis, but we are not allowed to alter the program code and the runtime environments. Moreover, we develop client-side attack detection frameworks so that some level of protection is present when the source code of server websites (either trusted or untrusted) is not available. Our proposed solutions explore several techniques such as response page ii parsing and file content analysis, browser-level checking of requests and responses, and finite state machine-based behavior monitoring. The thesis evaluates the proposed attack detection approaches with real-world vulnerable programs. The evaluation results indicate that our approaches are effective and perform better than the related work. We also contribute to the development of benchmark suites for evaluating attack detection techniques. iii Acknowledgements I would like to thank my supervisor Dr. Mohammad Zulkernine for all the guidance and support to complete my PhD thesis. I would also like to thank my thesis committee members, Dr. James R. Cordy and Dr. Hossam Hassanein for their guidance and encouragement. I would like to thank Dr. Mourad Debbabi for examining this thesis very carefully and providing his comments to improve the thesis further. I am grateful to all the members of Queen’s Reliable Software Technology (QRST) Lab with whom I had numerous thoughtful discussions. I am also deeply grateful to my family members for their enormous patience and tolerance during the period of my graduate study. Finally, I would like to acknowledge Natural Sciences and Engineering Research Council of Canada (NSERC) and Ontario Graduate Scholarship (OGS) programs for providing me the financial support during my PhD study. iv Statement of Originality I hereby certify that all of the work described within this thesis is the original work of the author. Any published (or unpublished) ideas and/or techniques from the work of others are fully acknowledged in accordance with the standard referencing practices. Hossain Shahriar November, 2011 v Table of Contents Abstract .............................................................................................................................. ii Acknowledgements .......................................................................................................... iv Statement of Originality ................................................................................................... v Chapter 1 Introduction..................................................................................................... 1 1.1 Motivations................................................................................................................ 1 1.2 Contributions ............................................................................................................. 2 1.3 Organization .............................................................................................................. 5 Chapter 2 Background and Related Work ..................................................................... 6 2.1 Vulnerabilities ........................................................................................................... 6 2.1.1 Cross-Site Scripting (XSS) ................................................................................. 7 2.1.2 Content Sniffing ................................................................................................. 8 2.1.3 Cross-Site Request Forgery (CSRF) ................................................................. 12 2.1.4 Phishing ............................................................................................................ 14 2.2 Related Work ........................................................................................................... 17 2.2.1 XSS Attack Detection ....................................................................................... 17 2.2.2 Content Sniffing Attack Detection ................................................................... 22 2.2.3 CSRF Attack Detection .................................................................................... 23 2.2.4 Phishing Attack Detection ................................................................................ 26 2.3 Summary ................................................................................................................. 31 Chapter 3 Cross-Site Scripting Attack Detection ........................................................ 33 3.1 Overview of the XSS Attack Detection Framework ............................................... 33 3.2 Boundary Injection .................................................................................................. 36 3.2.1 Boundary Injection in JSP ................................................................................ 36 3.2.2 Boundary Injection in JavaScript Code ............................................................ 37 3.3 Policy Generation and Checking ............................................................................. 38 3.3.1 JSP Expression and JSTL ................................................................................. 38 3.3.2 Scriptlet ............................................................................................................. 41 vi 3.3.3 JavaScript Code ................................................................................................ 45 3.3.4 Attack Detection in the Presence of Injected Boundaries ................................ 47 3.4 Experimental Evaluation ......................................................................................... 49 3.4.1 Benchmark Programs ....................................................................................... 49 3.4.2 Experimental Setup........................................................................................... 50 3.4.3 False Negative Rate Evaluation ........................................................................ 51 3.4.4 False Positive Rate Evaluation ......................................................................... 52 3.4.5 Performance Overhead ..................................................................................... 53 3.5 Summary ................................................................................................................. 53 Chapter 4 Content Sniffing Attack Detection .............................................................. 55 4.1 Content Sniffing Attack Detection Approach ......................................................... 55 4.1.1 MIME Resolver ................................................................................................ 56 4.1.2 Upload Policy Checker ..................................................................................... 57 4.1.3 Encoding Normalizer ........................................................................................ 58 4.1.4 Parser-based Analyzer ...................................................................................... 59 4.1.5 Mock Download Tester .................................................................................... 61 4.2 Experimental Evaluation ......................................................................................... 62 4.2.1 Vulnerable Programs .......................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages150 Page
-
File Size-