Source-linked AI summary
The Spy in the Sandbox -- Practical Cache Attacks in Javascript
Yossef Oren, Vasileios P. Kemerlis, Simha Sethumadhavan, Angelos D. Keromytis
TL;DR
The paper addresses the limited practicality of cache attacks that traditionally require code execution on the victim’s machine. It presents a Javascript PRIME+PROBE attack launched from an untrusted webpage, showing that cache side channels can track user behavior at Internet scale. The paper also finds that mitigation is possible but may impose costs on benign browser and system uses.
Problem
Existing cache attacks commonly assume arbitrary binary-code execution on the victim’s machine, an attacker model that is less applicable outside IaaS/PaaS environments.
Method
The paper extends PRIME+PROBE to last-level caches using Javascript, 4K pages, and non-canonical eviction sets accessible from a browser sandbox.
Results
The attack runs from an untrusted webpage, supports covert communication and user-behavior tracking, and can scale to millions of targets under the stated assumptions.
Takeaways & Limitations
Side-channel-resistant algorithms and systems should be considered more broadly because the attack reaches most computers connected to the Internet under its supported platform assumptions.
Takeaways & Limitations
The attack depends on a late-model Intel CPU, HTML5 browser support, and a combination of cache, Javascript, and runtime properties whose mitigations can burden benign uses.
Abstract
from arXiv · showhide
We present the first micro-architectural side-channel attack which runs entirely in the browser. In contrast to other works in this genre, this attack does not require the attacker to install any software on the victim's machine -- to facilitate the attack, the victim needs only to browse to an untrusted webpage with attacker-controlled content. This makes the attack model highly scalable and extremely relevant and practical to today's web, especially since most desktop browsers currently accessing the Internet are vulnerable to this attack. Our attack, which is an extension of the last-level cache attacks of Yarom et al., allows a remote adversary recover information belonging to other processes, other users and even other virtual machines running on the same physical host as the victim web browser. We describe the fundamentals behind our attack, evaluate its performance using a high bandwidth covert channel and finally use it to construct a system-wide mouse/network activity logger. Defending against this attack is possible, but the required countermeasures can exact an impractical cost on other benign uses of the web browser and of the computer.
1 Introduction
The paper demonstrates a practical cache attack launched entirely from an untrusted webpage, overcoming the traditional requirement for binary code on the victim’s machine. Using Javascript to observe the shared last-level cache, it tracks user behavior and communicates through a covert channel, while requiring countermeasures that can burden benign browser and system uses.
- Motivation: Traditional cache attacks generally assume that the attacker can execute arbitrary binary code on the victim’s machine, limiting their practicality outside cloud environments.
- Attack model: The attack requires only that a victim with a supported Intel CPU and HTML5-capable browser visit an attacker-controlled webpage.The Javascript code tracks accesses to the shared last-level cache over time.
- Method: The attack exploits cache sharing across cores, users, processes, and protection rings to infer activity beyond the browser process.Inclusive Intel caches and cache-set mappings provide the micro-architectural basis for these observations.
- Method: The method extends PRIME+PROBE to last-level caches using common 4K pages rather than requiring large-page support.It creates non-canonical eviction sets despite Javascript’s lack of pointers and virtual-address access.
- Applications and defenses: The authors evaluate a Javascript covert channel, apply cache measurements to user-behavior tracking, and discuss countermeasures with systemwide costs.The covert channel’s nominal capacity is on the order of hundreds of kilobits per second.
2 Attack Methodology
The attack implements PRIME+PROBE entirely in JavaScript by discovering LLC eviction sets despite unknown physical addresses, then repeatedly measuring cache-set latency to profile activity. Evaluation shows the method can map substantial cache regions and distinguish flushed from resident variables across Intel CPUs.
- Attack design: The JavaScript implementation follows PRIME+PROBE: create eviction sets, prime cache sets, wait for victim activity, and probe latency changes.Higher probe latency indicates that victim activity evicted the attacker's data.
- Attack design: 4K pages and unknown physical addresses complicate LLC set discovery because only the lower 12 virtual and physical address bits coincide.The attack exploits page alignment and known cache-index bits to reduce the search space.
- Attack design: Repeated profiling creates non-canonical eviction sets covering most of the cache, except regions accessed by the JavaScript runtime.The discovered mapping changes across runs because traditional 4K pages do not provide a stable set identity.
- Evaluation: More than 25% of the cache was mapped in under 30 seconds and more than 50% after 1 minute on an Intel i7-3720QM running Firefox.The implementation contains fewer than 500 lines of JavaScript and is described as straightforward to parallelize.
- Evaluation: The flushed and un-flushed access-time distributions were distinguishable using JavaScript's high-resolution timer, confirming the profiling method on Haswell and Sandy Bridge CPUs.The measurements include delay imposed by the JavaScript runtime.
- Evaluation: A memorygram uses time on the X axis, cache sets on the Y axis, and pixel intensity to represent access latency.Black indicates low latency; white indicates that the attacker's data was evicted between measurements.
3 A Cache-Based Covert Channel in Javascript
The paper adapts last-level-cache covert-channel techniques to a browser setting, using a native transmitter and JavaScript receiver to communicate through shared cache activity. The resulting channel operates between host processes and can also probe from a virtual machine.
- Channel Design: The covert channel adapts last-level-cache attacks to a webpage-based receiver rather than requiring a co-resident virtual machine.The transmitter modulates data through repeated accesses to a 4K array, while JavaScript searches for the corresponding physical page frames.
- Channel Design: The transmitter encodes 64 bits per time period across the 64 cache sets covered by its 4K array.Additional copies repeat the access pattern so the receiver can locate the modulated data more easily.
- Channel Design: The receiver profiles physical memory, locates a page frame carrying the modulation pattern, demodulates it, and uploads the recovered data.The stated design avoids violating information-flow tracking protections.
- Evaluation: The system assumes a native-language transmitter and JavaScript receiver, making the malicious website’s sampling speed the limiting performance factor.The bandwidth evaluation searches for a predetermined memory-access pattern using repeated JavaScript cache measurements.
- Evaluation: 8kbps was the peak bandwidth when the JavaScript receiver ran inside a virtual machine, showing that the webpage could probe underlying hardware.The virtualized receiver used Firefox on Ubuntu inside VMWare Fusion.
4 User Behavior Tracking Through Cache Attacks
The paper applies JavaScript cache probing to detect user activity outside the browser, focusing on network and mouse events. A simple trained classifier detects both activity types and distinguishes them from one another, though its sampling rate limits packet-level resolution.
- Attack Design: The study targets mouse and network activity because their operating-system handlers have relatively large cache footprints and can be triggered from restricted JavaScript.The attack assumes a malicious page may remain open while the user works in another tab or application.
- Attack Design: The attack profiles cache sets, trains on active and idle periods, then monitors activity-specific sets during classification.Training used cache measurements sampled at high temporal resolution, followed by classifier-based monitoring.
- Classification: The classifier clusters Hamming weights of cache measurements, treating the most intensive operation during training as the activity being measured.Hamming weight counts cache sets active during a time period.
- Evaluation: The evaluation compares classifier outputs with externally collected ground truth from tcpdump and a separate browser’s mouse-event logs.Network traffic was generated with wget, while mouse activity was recorded over a webpage.
- Results: The simple classifier detected both mouse and network activity, while the mouse detector did not detect network activity and vice versa.The authors state that more advanced training and classification could improve performance.
- Results: At 500Hz, the classifier detected periods of network activity rather than individual packets; mouse logging exceeded ground truth because Chrome throttled webpage events to about 60Hz.The measurement rate therefore constrained network temporal resolution but not the reported mouse-event count.
- Implications: Network-activity detection could let a malicious website monitor concurrent web activity, complementing other indicators such as memory allocations, DOM events, and disk writes.The paper presents this as a step toward deeper inference about user activity.
5 Discussion
The discussion argues that browser-based cache attacks affect a broad population of systems and extend side-channel threats beyond traditional co-located attacker settings. It also emphasizes that mitigations can conflict with performance and benign browser functionality.
- Prevalence: More than 80% of desktop browsers in use were reported vulnerable, given supported Intel microarchitectures and the required HTML5 APIs.The cited prevalence estimate used StatCounter measurements from January 2015, while more than 80% of PCs sold after 2011 met the CPU requirement.
- Timing Robustness: Coarser JavaScript timing can be accommodated by repeating accesses during profiling and exploiting invalidation of multiple cache sets during measurement.The relevant single cache hit–miss timing difference is on the order of 50ns.
- Mobile Scope: The attack was also applicable to Android Browser from version 4.4, whereas iOS Safari 8.1 lacked the required High Resolution Time API at the time of writing.The mobile-device claim is bounded by browser API support.
- Countermeasures: The attack depends on a chain of microarchitectural and JavaScript design choices, including address-to-cache mapping, inclusive caches, fast memory access, high-resolution timing, and JavaScript permissions.The authors state that mitigation at each junction can impose drawbacks on benign system uses.
- Countermeasures: Changing cache mapping or adopting exclusive caches could hinder the attack but would impose performance costs and cannot be retrofitted to already deployed hardware.The paper notes that both existing design choices were intended to improve CPU and cache efficiency.
- Countermeasures: Reducing timer resolution could make the attack harder, but the timer supports applications including music, games, augmented reality, and telemedicine.The discussion therefore frames timer mitigation as a trade-off with legitimate JavaScript uses.
- Conclusion: The authors conclude that untrusted webpages can launch effective microarchitectural attacks, extending the reach of side-channel threats to systems requiring side-channel countermeasures.Their demonstrated applications track user behavior rather than recover cryptographic keys.