Prime+Probe 1, Javascript 0: Overcoming Browser-Based Side-Channel Defenses Anatoly Shusterman Ayush Agarwal Sioli O’Connell Ben-Gurion Univ
Total Page:16
File Type:pdf, Size:1020Kb
Prime+Probe 1, JavaScript 0: Overcoming Browser-based Side-Channel Defenses Anatoly Shusterman Ayush Agarwal Sioli O’Connell Ben-Gurion Univ. of the Negev University of Michigan University of Adelaide [email protected] [email protected] [email protected] Daniel Genkin Yossi Oren Yuval Yarom University of Michigan Ben-Gurion Univ. of the Negev University of Adelaide and Data61 [email protected] [email protected] [email protected] Abstract While traditionally such attacks were implemented using native code [7, 29, 49, 58, 60, 79, 80], recent works have The “eternal war in cache” has reached browsers, with mul- demonstrated that JavaScript code in browsers can also be tiple cache-based side-channel attacks and countermeasures used to launch such attacks [24, 30, 57, 69]. In an attempt being suggested. A common approach for countermeasures is to mitigate JavaScript-based side-channel leakage, browser to disable or restrict JavaScript features deemed essential for vendors have mainly focused on restricting the ability of an carrying out attacks. attacker to precisely measure time [15, 16, 84]. To assess the effectiveness of this approach, in this work Side-channel attackers, in turn, attempt to get around these we seek to identify those JavaScript features which are es- restrictions by creating makeshift timers with varying accu- sential for carrying out a cache-based attack. We develop racies through the exploitation of other browser APIs, such a sequence of attacks with progressively decreasing depen- as message passing or multithreading [42, 66, 72]. More re- dency on JavaScript features, culminating in the first browser- cently, Schwarz et al. [67] presented Chrome Zero, a Chrome based side-channel attack which is constructed entirely from extension that protects against JavaScript-based side-channels Cascading Style Sheets (CSS) and HTML, and works even by blocking or restricting parts of the JavaScript API com- when script execution is completely blocked. We then show monly used by side channel attackers, based on a user-selected that avoiding JavaScript features makes our techniques archi- protection policy. Going even further, DeterFox [14] aims to tecturally agnostic, resulting in microarchitectural website eliminate side-channel attacks by ensuring completely de- fingerprinting attacks that work across hardware platforms terministic JavaScript execution, and NoScript [51] prevents including Intel Core, AMD Ryzen, Samsung Exynos, and JavaScript-based attacks by completely disabling JavaScript. Apple M1 architectures. A common trend in these approaches is that they are symp- As a final contribution, we evaluate our techniques in hard- tomatic and fail to address the root cause of the leakage, ened browser environments including the Tor browser, Deter- namely, the sharing of microarchitectural resources. Instead, Fox (Cao el al., CCS 2017), and Chrome Zero (Schwartz et most approaches attempt to prevent leakage by modifying al., NDSS 2018). We confirm that none of these approaches browser behavior, striking different balances between security completely defend against our attacks. We further argue that and usability. Thus, we ask the following question. the protections of Chrome Zero need to be more comprehen- sively applied, and that the performance and user experience What are the minimal features required for mounting mi- of Chrome Zero will be severely degraded if this approach is croarchitectural side-channel attacks in browsers? Can at- taken. tacks be mounted in highly-restricted browser environments, despite security-orientated API refinements? 1 Introduction Besides being influenced by defenses, microarchitectural attacks are also affected by an increased hardware diversifi- The rise in the importance of the web browser in modern cation in consumer devices. While the market for high-end society has been accompanied by an increase in the sensitiv- processors used to be dominated by Intel, the past few years ity of the information the browser processes. Consequently, have seen an increase in popularity of other alternatives, such browsers have become targets of attacks aiming to extract as AMD’s Zen architecture, Samsung’s Exynos, and the re- or gain control of users’ private information. Beyond attacks cently launched Apple M1 cores. that target software vulnerabilities and attacks that attempt to Most microarchitectural attack techniques, however, are profile the device or the user via sensor APIs, browsers have inherently dependent on the specifics of the underlying CPU also been used as a platform for mounting microarchitectural hardware, and are typically demonstrated on Intel-based ma- side-channel attacks [22], which recover secrets by measuring chines. While microarchitectural attacks on non-Intel hard- the contention on microarchitectural CPU components. ware do exist [46, 85], these are also far from universal, and Countermeasure Chrome Zero Can Be Technique External Policy Level Bypassed? Requirements None None 3 Cache Contention [24, 57, 69] None Reduced timer resolution Medium 3 Sweep Counting [69] None No timers, no threads Paranoid 3 DNS Racing Non-Cooperating DNS server No timers, threads, or arrays — 3 String and Sock Cooperating WebSockets server JavaScript completely blocked — 3 CSS Prime+Probe Cooperating DNS server Table 1: Summary of results: Prime+Probe Attacks can be Mounted Despite Strict Countermeasures are also highly tailored to their respective hardware platforms. attack implemented solely in CSS and HTML, yet is capable Thus, given the ever increasing microarchitectural diversifica- of achieving a high accuracy even when JavaScript is com- tion, we ask the following secondary question. pletely disabled. To the best of our knowledge, this is the first microarchitectural attack with such minimal requirements. Can microarchitectural side-channel attacks become architecturally-agnostic? In particular, are there universal Architecturally-Agnostic Side Channel Attacks. Next, side channel attacks that can be mounted effectively across we tackle the challenge of mounting side channel attacks diverse architectures, without requiring hardware-dependent across a large variety of computing architectures. We show modifications? that the reduced requirements of our techniques essentially make them architecturally-agnostic, allowing them to run on highly diverse architectures with little adaptation. Empirically 1.1 Our Contribution demonstrating this, we evaluate our attacks on AMD’s Ryzen, Samsung’s Exynos and Apple’s M1 architectures. Ironically, Tackling the first set of questions, in this paper we show that we show that our attacks are sometimes more effective on side channel attacks can be mounted in highly restricted these novel CPUs by Apple and Samsung compared to their browser environments, despite side-channel hardening of well-explored Intel counterparts, presumably due to their sim- large portions of JavaScript’s timing and memory APIs. More- pler cache replacement policies. over, we show that even if JavaScript is completely disabled, side-channel attacks are still possible, albeit with a lower Evaluating Existing Side Channel Protections. Having accuracy. We thus argue that completely preventing side chan- reduced the requirements for mounting side channel attacks nels in today’s browsers is nearly impossible, with leakage in browser contexts, we tackle the question of evaluating the prevention requiring more drastic design changes. security guarantees offered by existing API hardening tech- Next, tackling the second set of questions, we introduce niques. To that aim, we deploy Chrome Zero [67] and measure architecturally-agnostic side channel techniques, that can op- the attack accuracy in the presence of multiple security poli- erate on highly diverse architectures from different vendors. cies. We show that while disabling or modifying JavaScript Empirically evaluating this claim, we show side channel leak- features does attenuate published attacks, it does little to block age from browser environments running on AMD, Apple, attacks that do not require the disabled features. ARM and Intel architectures with virtually no hardware- As a secondary contribution, we find that there are sev- specific modifications. Notably, to the best of our knowledge, eral gaps in the protection offered by Chrome Zero, and that this is the first side-channel attack on Apple’s M1 CPU. fixing those adversely affects Chrome Zero’s usability and performance. This raises questions on the applicability of the Reducing Side Channel Requirements. We focus our in- approach suggested in [67] for protecting browsers. vestigation on website fingerprinting attacks [34]. In these attacks, an adversary attempts to breach the privacy of the Attacking Hardened Browsers. Having shown the effi- victim by finding out the websites that the victim visits. While cacy of our techniques in both Chrome and Chrome Zero initially these attacks relied on network traffic analysis, sev- environments, we also evaluate our attacks on several popular eral past works demonstrated that an attacker-controlled web- security-oriented browsers, such as the Tor Browser [71] and site running on the victim machine can determine the identity DeterFox [14]. Here, we show that attacks are still possible, of other websites the victim visits [6, 39, 53, 57, 74]. albeit at lower accuracy levels. To identify the set of JavaScript features required for cache Summary of Contribution. In summary, in this paper we attacks, we build on the work of [69].