Cloudflare successfully launched a remote Spectre attack, extracting sensitive information from workers at up to 12 bits per second.

Cloudflare has successfully replicated a remote Spectre attack on its production Cloudflare Workers, reading JWT tokens stored on another Worker with a maximum speed of 12 bits per second and over 99% accuracy. The experiment targeted attackers and victim Workers managed by Cloudflare, and the attack method used in the study has already been countered.
A revisit of remote Specter attacks on Cloudflare Workers | Cloudflare Blog
Remote-Timer-as-a-Service: Efficient Microarchitectural Leakage in the Cloud with Remote Timers
(PDF file) https://arxiv.org/pdf/2608.17043
Cloudflare Workers is a service that allows users to execute JavaScript and other code they have prepared on Cloudflare's edge servers. While typical servers separate OS processes for each user, Workers use V8 isolate, a JavaScript engine called 'V8,' to isolate multiple users within the same OS process in order to reduce startup time and processing load. Although each Worker is allocated its own memory area for JavaScript, multiple users share the same process, making it crucial to implement countermeasures against attacks that exploit the internal workings of the CPU.
Spectre is an attack that exploits the CPU's 'speculative execution.' To speed up processing, the CPU may predict the destination of a conditional branch and begin processing before the destination is determined. If the prediction is wrong, the processing result is discarded, but a small trace may remain in the CPU cache, etc. Attackers measure the difference in memory access times and infer data that would not normally be readable.
However, to detect even slight differences in cache speed with Spectre, a highly accurate clock is required. As a countermeasure, Cloudflare has made it so that the time within Workers does not advance while CPU processing is in progress, and has also disabled the use of multithreading and shared memory. In 2021, they introduced 'Dynamic Process Isolation (DyPrIs)' to the production environment, which moves Workers that detect suspicious CPU activity to a separate process. In 2021, research was conducted on attacks using 'remote timers' that utilize a highly accurate external time via WebSocket, based on the idea that 'even if there is no highly accurate clock inside the Workers, a clock can be placed on the other side of the network.' However, even under ideal conditions such as placing the timer on the same machine, the read speed remained at 120 bits per hour.

While the time difference between a cache hit and a cache miss is only a few nanoseconds, remote timers include significant delay fluctuations due to network communication, making it difficult to distinguish between the two directly. Therefore, the research team utilized a mechanism called 'Pseudo Least Recently Used (PLRU)' to determine which data to evict from the L1 cache. They repeatedly amplified a small speed difference, converting it to a size that could be distinguished even over a network. They were able to improve accuracy to the point where even a small number of measurements could handle differences of less than milliseconds.
The figure below shows the measurement results of amplified cache hits and cache misses. The upper row shows measurements taken by a timer over the network, and the lower row shows the baseline values measured by an internal high-precision timer. In the lower row, the processing time after PLRU amplification is clearly divided depending on the initial state of the cache. In the upper row, the distributions overlap due to network fluctuations, but there is a difference in the median values, and cache hits and cache misses can be statistically distinguished by multiple measurements.

Another challenge was to place the attacker's and victim's workers in the same execution environment and maintain the necessary state for the attack for an extended period. The research team combined Cloudflare's 'Durable Objects,' which can handle long-running processes, with WebSockets. Cloudflare explains that by periodically returning control during the process, they were able to maintain a single isolate for 5 to 20 hours or more.
Improvements have also been made to the process of evicting specific data from the cache. Instead of precisely searching for the target cache location as in the past, a data area far larger than the cache capacity is allocated, and a new location is selected each time. By increasing the likelihood that the selected location has already been evicted from the cache, the cumbersome cache location search using a remote timer is avoided.
The research team combined multiple methods to execute a series of attacks in a production environment of Cloudflare Workers. After reading memory from the attacking worker, they pre-placed sensitive information in a victim worker they controlled and confirmed that it could be read from another worker.
Ultimately, they successfully placed a JWT token on a Worker acting as the victim and read its contents bit by bit. Using majority voting and thresholds based on multiple measurement results, they determined whether the result was 0 or 1, achieving a read speed of 12 bits/second in the production environment, which is up to approximately 360 times faster than the previous 120 bits per hour, with an accuracy exceeding 99%. They stated that further speed increases are possible, but accuracy would decrease.
The image below shows the result of analyzing the first byte of a JWT token bit by bit. The measurement is repeated to estimate whether it corresponds to 0 or 1.

On the other hand, the reason why the conventional DyPrIs failed to stop the attack has also been revealed. DyPrIs monitors the CPU's hardware performance counters and isolates workers that appear to be Spectre attacks into a separate process. However, because DyPrIs only isolated workers after each execution was complete, it was possible to read the information before isolation began by using WebSockets to extend a single execution for a long time. In addition, DyPrIs determined the attack by comparing the number of branch prediction failures with the number of iTLB accesses, but it was found that the Spectre-specific behavior became less noticeable when iTLB access increased due to a large amount of WebSocket communication.
Based on the research findings, Cloudflare improved its detection methods for DyPrIs, taking into account long-running workers and processes with high I/O activity. Furthermore, by introducing V8 Sandbox, the attack method using 64-bit pointers, as used in this case, is no longer directly applicable. In September 2025, Cloudflare also introduced process isolation using CPU 'Memory Protection Keys (MPK)' for workers.
MPK is a mechanism that divides the memory within the same OS process into multiple protected areas, and the CPU verifies permission for memory access. Cloudflare Workers restricts direct access from one isolated memory to another by placing different V8 isolate heaps in separate protected areas. This acts as an additional barrier to prevent inter-isolate reads, as used in this research. However, Cloudflare explains that MPK alone cannot prevent all Spectre attacks.
The diagram below illustrates how MPK protects memory in different isolated locations. If access rights to the protection key of the target memory are not granted, the hardware will block access.

According to Cloudflare, the attack method demonstrated has already been addressed in production environments, and no evidence of actual exploitation was found in a review of the past three years. They also stated that they are continuing to investigate whether repeated network communication, such as timers, before and after computation processes can be used as detection criteria for DyPrIs.
Related Posts:
in Web Service, Security, Posted by log1d_ts







