Towards Emphasis As a Mechanism to Harden Networking Security in Android Apps
Total Page:16
File Type:pdf, Size:1020Kb
emphaSSL: Towards Emphasis as a Mechanism to Harden Networking Security in Android Apps Xuetao Weiy, Michael Wolfy, Lei Guo∗, Kyu Hyung Leez, Ming-Chun Huang◦, and Nan Niuy yUniversity of Cincinnati ∗Northeastern University zUniversity of Georgia ◦Case Western Reserve University Abstract—The use of secure HTTP calls is a first and critical making network calls to Internet web servers. Mistakes in step toward securing the Android application data when the code can be caused by leftover debug code or testing-time app interacts with the Internet. However, one of the major workarounds such as custom trust managers and skipping causes for the unencrypted communication is app developer’s errors or ignorance. Could the paradigm of literally repetitive hostname verification [4]. Overrides of security errors are and ineffective emphasis shift towards emphasis as a mecha- also pervasive. Developers have been observed to use code nism? This paper introduces emphaSSL, a simple, practical snippets in order to clear error messages without resolving and readily-deployable way to harden networking security in the certificate trust issue [4], [7]. Furthermore, in the case Android applications. Our emphaSSL could guide app devel- of developers using ‘http://’ when the ‘https://’ version of a oper’s security development decisions via real-time feedback, informative warnings and suggestions. At its core of emphaSSL, web service is readily available, the mistake may be caused we use a set of rigorous security rules, which are obtained by developer ignorance, apathy, or frustration with HTTPS- through an in-depth SSL/TLS security analysis based on security style transport-layer security. Concerns for application speed, requirements engineering techniques. We implement emphaSSL functionality, and interoperability with legacy systems may via the PMD and evaluate it against 75 open-source Android also play a role in the decision to leave applications without the applications. Our results show that emphaSSL is effective at detecting security violations in HTTPS calls with a very low highest layer of protection [5]. Rather than literally repetitive false positive rate, around 2%. Furthermore, we identified 164 and ineffective emphasis [7], could our focus shift towards substantial SSL mistakes in these testing apps, 40% of which emphasis as a mechanism? A more informative methodology are potentially vulnerable to man-in-the-middle attacks. In each to aid in adding security considerations in Android apps is of these instances, the vulnerabilities could be quickly resolved desired. Therefore, it is imperative for developers of HTTPS- with the assistance of our highlighting messages in emphaSSL. Upon notifying developers of our findings in their applications, ready apps to seek a solution that serves as an assistant in we received positive responses and interest in this approach. the proper creation of SSL connections with more emphasis. Approaching the problem from this developer-centric position I. INTRODUCTION presented challenging issues in the mechanism for determining the most pressing security issues, properly identifying these A. Motivation issues before compile-time, and determining the most prudent Though Android platform is the most popular platform in phrasing of error messages. the world, the authorship of Android applications (apps) has been notably insecure [1]–[3]. In the appified world, Android B. Contribution apps faced many challenges in the safe implementation of In this paper, we present emphaSSL, a simple, practical security. Beyond malware and theft, the use of smartphones and readily-deployable way to solve this problem via real- on insecure wireless access points remains as a dangerous time feedback, informative warnings and suggestions. Through reality in day-to-day data consumption. Previous studies have real-time highlighting of unsafe methods, the developer could shown that holes exist in a wide range of popular Android correct their errors once they understand the implications. Our applications and libraries, including banking applications, e- emphaSSL directly enables developers to fix the mistakes of commerce libraries used to conduct transactions through third- HTTPS development before compiling their app code. At its party servers, and social media clients that are shown to be core of emphaSSL, a set of rules are utilized, which are vulnerable [4]–[6]. These holes leave the end-user without the derived from the in-depth analysis of security requirements benefits of the HTTPS (Hypertext Transfer Protocol Secure) engineering techniques on Android apps. This includes a protocol. However, this basic encrypted security is a reason- process of determining user and system assets, application able expectation of all non-trivial applications. functions, threats, and limitations to a secure environment. The causes for the disparity between the theoretical and This foundation gives our ruleset validity and focus. We design realized security of SSL implementations can be attributed and implement emphaSSL via the PMD source-code parsing to a number of factors including library vulnerabilities, project [8], which would serve to point out insecure source complications and shortcomings of the TLS protocol itself, code to developers as they write their applications. We evaluate server misconfiguration, and end users [5]. However, the this design through a combination of automated testing and most pervasive reason why these implementations are not manual review of the test results. Our ruleset’s results were effective is due to application developer’s mistakes when verified for accuracy through an investigation of the tool’s output. We provide context to the ruleset by reading over the offending lines of code by hand and comparing them to security best practices. The evaluation results show our emphaSSL is effective at determining user errors with a very low false positive rate (around 2%) before an application is compiled, which ultimately hardens the networking security for Android apps in the wild. Specifically, we make the following contributions: • We propose a simple, practical, and readily-deloyable approach to combating developer misuse of Internet- based security connections based on source-code parsing and coding-time feedback. Our approach works with developers to fix issues immediately. By simply installing emphaSSL, developers can begin catching their mis- takes. This design is also useful in applications beyond the scope of HTTPS-specific security and can be extended to include future guidelines of next-generation protocols and concerns. Furthermore, this work can be applied to numerous environments. • We provide practical rules to assist Android app devel- opers in the proper creation of SSL connections. These rules are informed by our design for text-parsing violation checking and were produced through a process rooted in security requirements engineering. The objective of emphaSSL is to verify that major HTTPS overrides are not in place within the application source code. This Fig. 1. The architecture of our emphaSSL ruleset includes checks for the use of HTTPS, integrity of hostname verification, security of trust management, and transparency of error reporting. messages briefly explain the flaw which was discovered and • We perform a well-proportioned study of 75 open source then present a link to further reading and remediation. Android applications that use the INTERNET permission totaling over 100,000 lines of code, which demonstrates At its core of emphaSSL, a ruleset is built on top of the effectiveness of our ruleset with a very low false the open-source PMD source-code parsing project [8]. PMD positive rate, around 2%. Furthermore, we find that 30 allows for custom rules to be applied to the project as seen in of these applications can be considered vulnerable and Figure 1. The ruleset for emphaSSL is derived from a process nine that have serious HTTPS overriding capabilities of security requirements engineering and common mistakes that leave these applications open to man-in-the-middle discovered by the Android security community. These mis- attacks. We present a discussion of developer response to takes are generally exhibited by unsafe methods or literals our follow-up notifications on their project issues. We find which compromise the identity validation system of HTTPS. several cases of application owners taking our suggestions The ruleset of emphaSSL is then compared against source seriously and amending their code to properly conform code by PMD either printing out a list of errors into the to HTTPS standards. terminal or placing a marker next to the line of code which has violated a rule in the IDE. II. OVERVIEW OF emphaSSL Due to the enormous combinations of Java source code Our emphaSSL, as shown in Figure 1, is an early-warning methods, variables, and logic, the ruleset we present with approach to Android application security. In our approach, we emphaSSL is not all-inclusive. Thus, emphaSSL is designed attempt to educate the developer in a noninvasive way on the as an extensible, but still substantial implementation of our basics of HTTPS on Android, and solve for security errors design for authorship-time code validation can be effective in in real-time. Instead of relying on external organizations or networking security environments. In this paper, we test the install-time static-code scanners, we present the belief that effectiveness of emphaSSL through automation and manual developer will fix their mistakes in