Eliciting Malicious Behavior in Browser Extensions
Total Page:16
File Type:pdf, Size:1020Kb
Hulk: Eliciting Malicious Behavior in Browser Extensions Alexandros Kapravelos, University of California, Santa Barbara; Chris Grier, University of California, Berkeley, and International Computer Science Institute; Neha Chachra, University of California, San Diego; Christopher Kruegel and Giovanni Vigna, University of California, Santa Barbara; Vern Paxson, University of California, Berkeley, and International Computer Science Institute https://www.usenix.org/conference/usenixsecurity14/technical-sessions/presentation/kapravelos This paper is included in the Proceedings of the 23rd USENIX Security Symposium. August 20–22, 2014 • San Diego, CA ISBN 978-1-931971-15-7 Open access to the Proceedings of the 23rd USENIX Security Symposium is sponsored by USENIX Hulk: Eliciting Malicious Behavior in Browser Extensions † ‡ Alexandros Kapravelos Chris Grier ∗ Neha Chachra Christopher Kruegel † Giovanni Vigna Vern Paxson ∗ † ‡ UC Santa Barbara UC Berkeley UC San Diego ∗International Computer Science Institute kapravel, chris, vigna @cs.ucsb.edu grier, vern @cs.berkeley.edu [email protected] { } { } Abstract to monetize a victim’s web browsing session and readily access web-related content and private data. We present Hulk, a dynamic analysis system that de- Our work examines extensions for Google Chrome tects malicious behavior in browser extensions by mon- that are designed with malicious intent—a threat dis- itoring their execution and corresponding network activ- tinct from that posed by attackers exploiting bugs in be- ity. Hulk elicits malicious behavior in extensions in two nign extensions, which has seen prior study [6, 5]. Ex- ways. First, Hulk leverages HoneyPages, which are dy- tensions for Google Chrome are primarily distributed namic pages that adapt to an extension’s expectations in through the Chrome Web Store.1 Like app stores for web page structure and content. Second, Hulk employs other platforms, such as Android or iOS, inherent risks a fuzzer to drive the numerous event handlers that mod- arise when downloading and executing programs from ern extensions heavily rely upon. We analyzed 48K ex- untrusted sources. Reports have documented not only tensions from the Chrome Web store, driving each with malicious extensions [27], but miscreants purchasing ex- over 1M URLs. We identify a number of malicious ex- tensions (and thereby access to their userbases via update tensions, including one with 5.5 million affected users, mechanisms) to add malicious functionality [2, 25]. In stressing the risks that extensions pose for today’s web addition to the web store, extensions can also be directly security ecosystem, and the need to further strengthen installed by users and other programs. Installed by a pro- browser security to protect user data and privacy. cess called sideloading, these extensions pose a recog- nized risk that browser vendors have attempted to prevent 1 Introduction through modifications to the browser [22]. Sideloaded extensions are especially problematic since they can be All major web browsers today support broad extension installed without user knowledge, and are not subject to ecosystems that allow third parties to install a wide range review by a web store. Despite efforts to stifle sideloaded of modified behavior or additional functionality. Inter- extensions, they remain a significant problem [12]. net Explorer has binary add-ons (Browser Helper Ob- In this paper we present Hulk, a tool for detecting ma- jects), while Firefox, Chrome, Opera, and Safari support licious behavior in Google Chrome extensions. Hulk re- JavaScript-based extensions. Some browsers have online lies on dynamic execution of extensions and uses several web stores to distribute extensions to users. For exam- techniques to trigger malicious functionality during exe- ple, the most popular extension in Chrome’s Web Store, cution. One technique we developed to elicit malicious AdBlock, has over 10 million users. Other popular ex- behavior is the use of HoneyPages: specially-crafted web tensions serve a variety of functions, such as preserving pages designed to satisfy the structural conditions that privacy, changing the aesthetics of the browser’s UI, or trigger a given extension. We interpose on all queries and integrating with web services such as Google Translate. modifications to the DOM tree of the HoneyPage to au- The amount of critical and private data that web tomatically create elements and mimic DOM tree struc- browsers mediate continues to increase, and naturally tures for extensions on the fly. Using this technique, we this data has become a target for criminals. In addition, can readily observe malicious behavior that inserts new the web’s advertising ecosystem offers opportunities to iframe or div elements. profit by manipulating a user’s everyday browsing be- In addition, we built a fuzzer to drive the execution havior. As a result, malicious browser extensions have become a new threat, as criminals realize the potential 1https://chrome.google.com/webstore/category/extensions USENIX Association 23rd USENIX Security Symposium 641 of event handlers registered by extensions. In our ex- performing other actions. The permission system deter- periments, we use the fuzzer to trigger all event handlers mines which sites an extension can access, the allowed associated with web requests, exercising each with 1 mil- API calls, and the use of binary plugins. We describe lion URLs. Although we undertook extensive efforts to relevant parts of the permission system later in this sec- trigger malicious behavior, the possibility remains that tion. See Barth et al. for a more detailed description of Hulk lacks the mechanisms to satisfy all of the conditions Chrome’s extension architecture [5]. necessary for eliciting an extension’s malicious behavior. Our analysis of 48,332 Chrome extensions found that 2.2 Installing Extensions malicious extensions pose a serious threat to users. By developing a set of rules that label execution logs from The Chrome Web Store is the official means for users Hulk, we identified 130 malicious extensions and 4,712 to find and install extensions. The web store is similar “suspicious” extensions, most of which appear in the to other app stores, such as those for iOS and Android, Chrome Web Store. Several large classes of malicious in that developers create extensions and upload them to behavior appear within our set of extensions: affiliate the store for users to download. Extension developers fraud, credential theft, ad injection or replacement, and can also push out updates without requiring any action social network abuse. In one case, an extension perform- by the end-user. ing ad replacement had nearly 2 million users, similar in In addition to the Chrome Web Store, extensions can size to some of the largest botnets. also be installed manually by a user or an external pro- In summary, we frame our contributions as follows: gram. We refer to the installation of extensions out- side the web store as sideloading. Chrome version 25 We present Hulk, a system to perform dynamic • (released February, 2013) included changes to prevent analysis for Chrome extensions. silent installation of Chrome extensions and require that We demonstrate the effectiveness of HoneyPages the user indicate consent for installation [22]. In May, • and event handler fuzzing to elicit malicious behav- 2014, Chrome took further steps to prevent sideload- ior in browser extensions. ing by requiring all installed extensions to be hosted in the Chrome Web Store [18]. While these changes in- We perform the first broad study of malicious • crease the difficulty of sideloading, it is still possible Chrome extensions. for programs to force silent installation of extensions, We characterize several classes of malicious since the attacker already has control of the machine. For • Chrome extensions, some with very large footprints our study we obtained a set of extensions that are side- (up to 5.5M installations) and propose solutions to loaded into Chrome by other Windows programs, many eliminate entire classes of malicious behavior. of which are known malware. 2 Background 2.3 Extension Permissions We begin by reviewing the Google Chrome extension Permissions. Chrome requires extensions to list the model and the opportunities this model provides to mali- permissions needed to access the different parts of the cious extensions. extension API. For example, Figure 1 shows a portion of a manifest file requesting permission to access the webRequest and cookies API. The webRequest per- 2.1 Chrome Extension Composition mission allows the extension to “observe and analyze Google Chrome supports extensions written in traffic and to intercept, block, or modify requests in- JavaScript and HTML (distributed as a single zip flight” by allowing the extension to register callbacks file). A small number of extensions also include binary associated with different parts of the HTTP stack [15]. code plugins, although these are subject to a manual Similarly, the cookies API allows the extension to get, security review process [15]. Each extension contains a set, and be notified of changes to cookies. (mandatory) manifest that, along with other extension The extension API permissions operate in con- parameters, describes the permissions the extension uses junction with the optional host permissions, which and the list of resources that the browser should load. limit the API permissions to access resources only The permission system is designed in the spirit of least for the