
Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities GuangLiang Yang, Jeff Huang, and Guofei Gu, Texas A&M University https://www.usenix.org/conference/usenixsecurity19/presentation/yang-guangliang This paper is included in the Proceedings of the 28th USENIX Security Symposium. August 14–16, 2019 • Santa Clara, CA, USA 978-1-939133-06-9 Open access to the Proceedings of the 28th USENIX Security Symposium is sponsored by USENIX. Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities GuangLiang Yang, Jeff Huang, Guofei Gu Texas A&M University {ygl, jeffhuang, guofei}@tamu.edu Abstract Inconsistencies Between Browsers and WebView. How- ever, in WebView, a totally different working environment In this paper, we present a novel class of Android Web- is provided for iframes/popups, due to WebView’s own pro- View vulnerabilities (called Differential Context Vulnerabili- gramming and UI features. Although these features improve ties or DCVs) associated with web iframe/popup behaviors. app performance and user experience, they extensively impact To demonstrate the security implications of DCVs, we de- iframe/popup behaviors and introduce security concerns. In vise several novel concrete attacks. We show an untrusted particular, WebView enables several programming APIs (Fig- web iframe/popup inside WebView becomes dangerous that ure1) to help developers customize iframe/popup behaviors. it can launch these attacks to open holes on existing defense For example, the setting APIs allow developers to configure solutions, and obtain risky privileges and abilities, such as their WebView instances. In the customized web environment breaking web messaging integrity, stealthily accessing sensi- (WebView), it is unclear whether existing iframe/popup pro- tive mobile functionalities, and performing phishing attacks. tection solutions are still effective. Then, we study and assess the security impacts of DCVs on real-world apps. For this purpose, we develop a novel tech- Furthermore, WebView UI is designed in a simple style nique, DCV-Hunter, that can automatically vet Android apps (Figure2) that only one UI area for rendering web content is against DCVs. By applying DCV-Hunter on a large number provided. Due to the lack of the address bar, it is difficult for of most popular apps, we find DCVs are prevalent. Many high- users to learn what web content is being loaded; due to the profile apps are verified to be impacted, such as Facebook, lack of the tab bar, it is unknown how multiple WebView UI Instagram, Facebook Messenger, Google News, Skype, Uber, instances (WUIs) are managed. Therefore, if an iframe/popup Yelp, and U.S. Bank. To mitigate DCVs, we design a multi- has abilities to secretly navigate the main frame (the top level solution that enhances the security of WebView. Our frame) or put their own WUI to the foremost position for evaluation on real-world apps shows the mitigation solution overlaying the original WUI, phishing attacks occur and may is effective and scalable, with negligible overhead. cause serious consequences. Consider the scenario shown in Figure3 and4. The Huntington banking app (one million+ 1 Introduction downloads) uses WebView to help users reset passwords (Fig- ure3-a,b). Inside WebView, the main frame contains an iframe Nowadays, mobile app developers enjoy the benefits of the for isolatedly loading untrusted third-party tracking content amalgamation of web and mobile techniques. They can easily (Figure4). However, if the untrusted web content inside the and smoothly integrate all sorts of web services in their apps iframe obtains the ability of stealthily redirecting the main (hybrid apps) by embedding the browser-like UI component frame to a fake website (Figure3-c), serious security risks are “WebView”. WebView is as powerful as regular web browsers posed. For example, users’ personal (e.g., SSN info and Tax (e.g., desktop browsers), and well supports web features, in- ID) and bank account information may be stolen, and further cluding the utilization of iframes/popups. financial losses may also be caused. In the web platform, iframes/popups are frequently used, but also often the root cause of several critical security is- Differential Context Vulnerability (DCV). Motivated by sues (e.g., frame hijacking [11] and clickjacking [23, 43]). above security concerns, we conduct the first security study of In past years, in regular browsers, their behaviors have been iframe/popup behaviors in the context of Android WebView. well studied, and a variety of mature iframe/popup protec- In this paper, we use the term “context” to refer to a web tion solutions (e.g., Same Origin Policy (SOP) [6], HTML5 environment that includes GUI elements (e.g., the address iframe sandbox [4], and navigation policies [11]) have been and tab bars), corresponding web management APIs (e.g., the deployed. setting APIs in WebView), and security policies (e.g., SOP USENIX Association 28th USENIX Security Symposium 977 Table 1: A Summary of Differential Context Vulnerabilities (DCVs) Critical Features Different Contexts Attacks Explanations Consequences & Behaviors Browsers WebView Sensitive functionalities behind postMessage and JavaScript Bridges can be leveraged, Main-Frame Address Special common origins Java APIs Origin Hiding Attack which may cause the leakage of sensitive Creation Bar (e.g., null) Of Main-Frame information (e.g., location), and risky access on Hardware (e.g., camera and microphone) Management of Android WUI overlap attack No protection on the WUI Tab Bar new popups Frameworks WUI closure attack rendering sequence Traditional navigation Permissive navigation Phishing attacks based attack policies Main-Frame Address Java APIs Harmful conflict between Navigation Bar Privileged navigation WebView Customizations attack and web APIs and navigation policies). As a consequence, our study uncovers a novel class of vulnerabilities and design flaws in WebView. These vulner- abilities are rooted in the inconsistencies between different contexts of regular browsers and WebView. As summarized in Table1, several critical web features and behaviors (i.e., main- frame creation, popup creation, and main-frame navigation) Figure 1: WebView Programming Features are involved (see more details in Section3). These features and behaviors are harmless or even safe in the context of regular browsers, but become risky and dangerous in the con- 1) For origin-hiding attacks, existing defense solutions for text of WebView. To demonstrate their security implications, postMessage [11, 44, 47, 52] and web-mobile bridges we devise several concrete attacks. We show through these [18, 21, 38, 45, 49] usually provide security enforcement attacks, remote adversaries (e.g., web or network attackers relying on origin validation. However, unfortunately, the on iframes/popups) can obtain several unexpected and risky key origin information of the untrusted iframe/popup can privileges and abilities: be hidden during attacks, which leads to the bypass of the security enforcement. Origin-Hiding 1) : hiding the origin when 2) For WUI redressing attacks, they are similar to Android • breaking the integrity of web messaging (i.e., postMes- UI redressing attacks [15, 20, 35]. However, the associ- sage) [8], which allows the communication between ated Android UI protection solutions (e.g., [13, 41]) are mutually distrusted web frames; and circumscribed to prevent WUI addressing attacks. This is • secretly accessing web-mobile bridges [21], which link mainly because that these protections work by monitoring mobile native the web layer with the or layer (e.g., Java exceptional Android UI state changes between different for Android) (Figure1); apps, while the WUI state change occurs within an app Existing work has shown that postMessage’s message during attacks. receivers [44, 47] and web-mobile bridges [21, 49, 53] 3) For main-frame navigation attacks, one related solution is often carry sensitive functionalities. Thus, these function- the iframe sandbox security mechanism, which can effec- alities can be further stealthily accessed by the untrusted tively limit the navigation capability of an arbitrary iframe. iframe/popup through the attack. As a result, sensitive However, through DCV attacks, an untrusted iframe can information (e.g., GPS location) may be stolen, and impor- still break the above limitation and cause privilege escala- tant hardware (e.g., microphone) may be unauthorizedly tion. accessed. 2) WebView UI Redressing: performing phishing attacks by More details about the vulnerabilities and the weakness of overlapping the foremost benign WUI with an untrusted existing defense solutions are presented in Section3. For WUI; convenience, considering the root reason of this new type of 3) (Privileged) Main-Frame Navigation: freely redirecting vulnerability (i.e., the inconsistencies between the contexts of the main frame to a fake website. regular browsers and WebView), we refer to the vulnerabili- ties as Differential Context Vulnerabilities or DCVs, and the Moreover, we examine the effectiveness of existing protec- associated attacks as DCV attacks. tion solutions, which include not only the solutions designed for regular browsers (inherited by WebView), but also the DCV-Hunter & Findings. We next study and assess the se- solutions proposed for Android UI and WebView. We find curity impact of DCVs on real-world hybrid apps. To achieve that these solutions are
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages19 Page
-
File Size-