{'fraction_non_alphanumeric': 0.030779464231722804, 'fraction_numerical': 0.009937312289613191, 'mean_word_length': 4.844957587181904, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
SpyHammer: Using RowHammer to Remotely Spy on Temperature

RowHammer is a DRAM vulnerability that can cause bit errors in a victim DRAM row by just accessing its neighboring DRAM rows at a high-enough rate. Recent studies demonstrate that new DRAM devices are becoming increasingly more vulnerable to RowHammer, and many works demonstrate system-level attacks for privilege escalation or information leakage. In this work, we leverage two key observations about RowHammer characteristics to spy on DRAM temperature: 1) RowHammer-induced bit error rate consistently increases (or decreases) as the temperature increases, and 2) some DRAM cells that are vulnerable to RowHammer cause bit errors only at a particular temperature. Based on these observations, we propose a new RowHammer attack, called SpyHammer, that spies on the temperature of critical systems such as industrial production lines, vehicles, and medical systems. SpyHammer is the first practical attack that can spy on DRAM temperature. SpyHammer can spy on absolute temperature with an error of less than 2.5 {\deg}C at the 90th percentile of tested temperature points, for 12 real DRAM modules from 4 main manufacturers.


I. INTRODUCTION
RowHammer is a DRAM vulnerability where a DRAM cell experiences a bit-flip when the cells nearby it are rapidly and frequently accessed [1]. Recent works [2,3] demonstrate that modern DDR4 DRAM devices are more vulnerable to RowHammer than their predecessor DDR3 devices, suggesting that RowHammer is an important DRAM vulnerability issue that is becoming increasingly severe as DRAM manufacturing technology nodes scale down. Using RowHammer, many works demonstrate attacks that 1) escalate privileges at systemlevel, 2) leak secret information, and 3) manipulate critical application outputs .
In this work, we propose SpyHammer, a new attack that uses RowHammer to spy on DRAM temperature with high accuracy. Our attack can be performed with minimal knowledge of the target computing system. SpyHammer can be used to compromise the security and confidentiality of several critical systems that use DRAM. SpyHammer can compromise a victim computing system to achieve two goals. First, it can identify the utilization of a computer system, as the compute and memory intensity of a workload can change the temperature of the system. For example, an attacker could infer if a server is at its peak hour by identifying the temperature using SpyHammer. Second, it can measure the ambient temperature, which may convey information about the state of a larger system that contains the target computing system (e.g., a car, a drone, or an industrial manufacturing machinery). For example, the temperature of a car's engine may rise if the engine is operating at high revs. SpyHammer can also compromise privacy. For example, by spying the temperature of a house (or different instances of a house), an attacker can infer the habits of the person(s) living in that house. Tracking the temperature could give information about at which times the person(s) leaves or enter the house, in which instance of the house the person is, etc.
To this end, we leverage two key observations about Row-Hammer to spy on DRAM temperature: 1) RowHammerinduced bit error rate consistently increases (or decreases) when the temperature increases, and 2) some DRAM cells that are vulnerable to RowHammer experiment bit errors only at a specific temperature. Using these observations, we build an attack, called SpyHammer, that infers the temperature of DRAM chips by just characterizing DRAM cells that exhibit RowHammer-induced bit errors in the address space of the attacker, without requiring any hardware or system software modifications. We propose two variants of the SpyHammer attack, each with a different threat model.
First, a variant of SpyHammer spies on relative temperature changes that requires no prior physical access to or knowledge of the victim DRAM module. Although two DRAM modules of the same model and manufacturing date may have different Bit Errors per Row (BER) for a given temperature (i.e., we can not infer absolute temperature changes), we observe that the correlation between BER and temperature is very similar for the two DRAM modules. We use this observation to spy on relative temperature changes. Since the attacker has no prior information about the victim DRAM module, the attacker must reverse engineer the victim DRAM module using remote RowHammer-based techniques [18,31]. To estimate the temperature of the victim DRAM module, we propose to build a polynomial regression model using a DRAM module (to which the attacker has physical access and can control the operating temperature) that is exactly the same model as the victim DRAM module.
Second, a variant of SpyHammer to spy on absolute temperatures that requires to characterize the victim DRAM module before the attack. The key idea is to build an accurate polynomial regression model using the victim DRAM module that will be used to infer the temperature of the victim DRAM module with high accuracy.
Monitoring the BER of a DRAM module reliably requires the attacker to hammer a large region of memory. To reduce the cost of the attack, we propose a SpyHammer optimization that spies on temperature by monitoring the DRAM cells that manifest bit flips only at one specific temperature point, called canary cells. We identify canary cells in the enrollment process, where cells that flip at more than one temperature point are removed from the canary cells. After the enrollment phase, an attacker can estimate the temperature of the victim DRAM by monitoring only a few selected canary cells, thus reducing the number of memory accesses required to perform the attack.
To evaluate SpyHammer, we perform an extensive and thorough DRAM RowHammer characterization on 12 real DRAM modules (120 DRAM chips) using temperature steps of 1°C in a controlled environment. Our results show that an attacker can spy on 1) absolute temperature (with prior characterization of the victim DRAM module) with an error of ±1°C, and 2) relative temperature changes (without prior characterization of the victim DRAM module) with an error of ±5°C, for most DRAM modules we test.
We make the following main contributions: • We propose SpyHammer, the first attack that can spy on DRAM temperature without any modification to the victim system. • We propose a two variants of SpyHammer: 1) a variant that can spy on relative temperature changes using RowHammer without having any prior information about the DRAM module and without any changes to the victim DRAM module, and 2) a variant that can spy on absolute temperature changes using RowHammer when the attacker can characterize the DRAM module before deploying the victim DRAM module. • We perform a thorough characterization and analysis of the correlation between RowHammer and temperature, using 12 real DDR4 DRAM modules (120 DRAM chips). • We perform a detailed study on the accuracy of the two variants of SpyHammer, which shows that we can spy with a maximum error (at the 90 th percentile of tested temperature points) of 1) ±2.5°C on absolute temperature values, and 2) ±3.5°C on relative temperature changes, in all 12 DRAM modules (120 DRAM chips) from the four manufacturers we test.

II. BACKGROUND
We provide a brief background on DRAM organization and RowHammer vulnerability. For more detailed background, we refer the reader to prior works [1][2][3].

A. DRAM Organization
The memory controller in the processor communicates with DRAM modules over one or multiple DRAM channels. Each module contains a set of DRAM chips that operate in lockstep. The DRAM cells within a DRAM chip are organized hierarchically. A DRAM chip comprises multiple DRAM banks that can operate independently. DRAM cells in a DRAM bank are laid out in a two-dimensional structure of rows and columns. Each DRAM cell on a DRAM row is connected to a common wordline via access transistors. A bitline connects a column of DRAM cells to a DRAM sense amplifier to access data.
Accesses to DRAM devices are typically performed in cache block granularity (64-bytes) in contemporary systems. An access to a DRAM cache block works in three steps. First, the memory controller sends an ACT command to activate a specific row within a DRAM bank, which prepares the row for a columns access (i.e., copies the row to the sense amplifiers). Second, the memory controller sends a READ (WRITE) command to read (write) a column in the row. Third, once all operations to the active row are completed, the memory controller sends a PRE command that closes the row and prepares the DRAM bank to open a new DRAM row (i.e., it precharges the bank).

B. RowHammer
Modern DRAM devices are subject to disturbance failures caused by high frequency accesses (i.e., hammer) to DRAM rows (i.e., aggressor rows) that result in unintentional bit flips in physically nearby rows that are not being accessed (i.e., victim rows). This phenomenon is referred to as RowHammer [1,2,72]. RowHammer-induced bit flips are exacerbated as DRAM technology nodes shrink and DRAM cells come closer to each other. This results in newer, high-density DRAM chips to become more vulnerable to RowHammer [2]. These bitflips manifest after a row's activation count reaches a certain threshold value within a refresh window (usually denoted as MAC [73] or HC f irst [2]).

C. PUFs and Physical Cryptography
Our work also relates to the recent areas of physical unclonable functions (PUFs) and physical cryptography. In these established fields, the intrinsic, physical characteristics of hardware are employed to either enable new cryptographic and security schemes, or to launch new classes of attacks. Optical PUFs and digital silicon PUFs have been pioneered early on by Pappu et al. and Gassend et al. [75,76], and have been advanced in a large number of follow-up works [77,78,. Also DRAM PUFs and Rowhammer PUFs have been suggested recently, creating yet another link between the PUF-field and the studies of this paper [47,[101][102][103][104].

III. THREAT MODELS
We assume two different threat models for 1) spying on relative temperature changes and 2) spying on absolute temperature changes.
A. Spying on Relative Temperature Changes.
We assume an attacker with no prior knowledge or physical access to the victim DRAM module. Thus, the victim's software and hardware can not be characterized or modified by the attacker prior to the attack.
With the goal of building models that correlate BER with temperature, the attacker can purchase many DRAM modules from different manufacturers, and has the infrastructure to control the DRAM temperature of those modules in a finegrained manner.
B. Spying on Absolute Temperature Changes.
We assume an attacker that has access to the victim DRAM module before performing the attack, and they can characterize the bit errors caused by RowHammer in a controlled environment at different temperatures.

IV. METHODOLOGY
We perform a thorough analysis of the potential of the SpyHammer attack using an FPGA-based infrastructure. To perform a SpyHammer attack on a real DDR4 system (i.e., with RowHammer defense mechanisms enabled), we can use the methodology proposed in previous work [3,74,105] to induce a significant amount of bit flips in real systems (not shown in this paper).

A. Testing Infrastructure
We experimentally study DDR4 DRAM chips across a wide range of temperatures. We use a custom version of the SoftMC framework [52] that supports DDR4 modules, and a highly accurate temperature controller infrastructure.
1) SoftMC: Figure 1 shows the SoftMC setup for testing DDR4 DRAM modules. We use the Xilinx Alveo U200 [106] FPGA board in all of our tests.   [52] version that supports DDR4 modules.
We use an FPGA board with SoftMC ( Figure 1c) to perform all our RowHammer tests. We monitor and adjust the temperature of DRAM chips under test with a temperature controller ( Figure 1a). This infrastructure provides a fine-grained control over the timing between DRAM commands. We enforce all timing parameters defined by Jedec [73] to enforce reliable operation.
2) Temperature Controller: To regulate the temperature in DRAM modules, we use silicone rubber heaters pressed to both sides of the DDR4 module ( Figure 1c). To reduce the heat leakage, we apply two layers of insulation around the DRAM module under test and the heater pads: 1) a layer of reflective aluminum sheets covering the DRAM and the heater pads and 2) a layer of insulation sheets made of PTFE, a heat-resistant material. To measure the actual temperature of DRAM chips, we use a thermocouple, which we place between the rubber heaters and the DDR4 chips. We connect the heater pads and the thermocouple to a Maxwell FT200 temperature controller (Figure 1a), which keeps the temperature stable by implementing a closed-loop PID controller. Our host machine communicates with the temperature controller via an RS485 channel. Using this feature, we build a custom software that enables us to automatize the management of the temperature, and integrate it in our testing infrastructure. In our tests using this infrastructure, we measure temperature with an accuracy of ±0.1°C.

B. Testing Methodology
Disabling Sources of Interference. We disable all DRAM self-regulation events except the calibration signals like ZQ for signal integrity, so that we ensure that the observed errors are solely caused by RowHammer. We also make sure that our tests finish before retention errors manifest.
To the best of our knowledge, we also disable all DRAMlevel (e.g., TRR [73]) and system-level RowHammer mitigation mechanisms (e.g., pTRR [107]) along with all forms of rank-level error-correction codes (ECC), which could obscure RowHammer bit-flips. Based on the prior work's observations [2,3], on-DRAM-die RowHammer mitigation mechanisms (i.e., TRR) take action when the DRAM services a refresh (REF) command. The DRAM modules we test do not implement error correction internally.
RowHammer Access Sequence. We use a common access sequence used in previous works as the worst case test pattern, in which 1) we hammer the two rows that are adjacent to the victim row (i.e., aggressor rows), and 2) we access the aggressor rows as fast as possible.
Data Pattern. We conduct our experiments on a DRAM module by using the module's worst-case data pattern (W CDP ). We identify the W CDP as the pattern that experiences the largest number of bit-flips among seven different data patterns that prior research on DRAM characterization uses [2,33,[43][44][45][46]55], presented in Table I: colstripe, checkered, rowstripe, and random (we also test the complements of the first three). For each RowHammer test, we write the corresponding data pattern to the victim row (V in Table I

Row Address
Colstripe 3,5,7] 0x55 0xaa 0xff random * V is the physical address of the victim row † We also test the complements of these patterns Memory Access Pattern. In all of our tests we perform a double-sided RowHammer attack [1,2].
Metrics. We compare the BER across all our tests at a constant hammer count of 150K per aggressor row. We also identify the DRAM cells that flip only at a particular temperature point (i.e., canary cells).
Iterations. To collect reliable results and estimate temperatures with SpyHammer, we repeat every single experiment for a particular DRAM module and temperature 20 times. We use the 20 repetitions of the experiments in different ways, depending on the particular evaluation (e.g., for estimating the accuracy on absolute temperature values in Section VII-A, we use the first 10 repetitions to build the estimation model and the other 10 repetitions to estimate the model's accuracy).  V. SPYHAMMER ATTACK In this section, we describe how to perform a SpyHammer attack that spies on relative temperature changes of the victim DRAM chip. In Section VI, we describe how to perform a SpyHammer variant that spies on the absolute temperature of the victim DRAM module.

C. Tested DRAM Modules
Overview. The basic SpyHammer attack is based on two key observations. First, the RowHammer-induced BER consistently increases (decreases) when the temperature increases [72]. We use this observation to infer if the temperature increases or decreases compared to a reference temperature point by just monitoring the BER in a DRAM region. Second, the form of the curve that relates BER and temperature is usually very similar across modules from the same manufacturer and manufacturing date.
Based on these observations, SpyHammer can detect relative changes on DRAM chip temperature by 1) continuously monitoring the BER of the victim DRAM module at different points in time, and 2) correlating the BER changes with temperature changes using a temperature-error model obtained from a module that is from the same manufacturer and has the same manufacturing date as the victim DRAM module.
Obtaining consistent and reliable BER numbers might require to hammer a large region of the DRAM module, which can make the SpyHammer attack intrusive. To solve this problem, we propose an optimization to reduce the number of hammers needed to spy on temperature. This optimization is based on the observation that some DRAM cells are vulnerable to RowHammer only at a very narrow temperature range [72]. We use this observation to make SpyHammer faster and less intrusive by identifying the cells that flip only at one temperature point, which we call canary cells. By using canary cells instead of BER to spy on temperature, we can reduce the number of DRAM accesses to perform the SpyHammer attack.
The canary cell optimization is performed in two steps. First, the attacker enrolls canary cells for different temperatures. The enrollment stage is performed in parallel with BER monitoring, and it associates particular canary cells to particular BER values. For an accurate enrollment phase, the victim DRAM needs to go through different temperatures that change the BER. The duration of the enrollment phase varies depending on the variability of the temperature in the victim DRAM module. Second, once the attacker identifies the canary cells for different temperatures, the attacker monitors canary cells to spy the temperature of the victim DRAM module.
SpyHammer neither requires previous information about the victim DRAM module, nor the characterization of the victim DRAM module (see Section III-A) to spy on relative temperature changes (see Section VI for a SpyHammer attack on absolute temperatures). However, to build an accurate model for temperature estimation, the attacker needs to characterize a DRAM module that is as similar as possible to the victim (e.g., same manufacturer and model). This means that the attacker needs to reverse engineer the manufacturer and model of the victim DRAM module remotely.
We perform the SpyHammer attack in five steps: 1) identify the victim DRAM model, 2) build a polynomial regression model from a DRAM module that is the same model as the victim, 3) allocate a contiguous DRAM memory region in the victim system, 4) monitor the BER of the victim DRAM module continuously, 5) enroll and monitor canary cells in the victim DRAM module.

A. Step 1: Identify the Victim DRAM Module
SpyHammer requires to reverse engineer the manufacturer and model of the victim DRAM module. Our methodology identifies the DRAM manufacturer first, and then identifies the technology node of the model. There are many techniques that enable us to reverse engineer the victim DRAM manufacturer and model remotely, without physical access or modification to the victim system. Next, we explain some of these techniques an attacker can use, based on new observations, and observations from previous works.
We classify our methodologies into two categories: 1) methodologies that are very simple and quick to implement, but that can lead two some inaccuracies in some cases (Section V-A1), and 2) methodologies that are more complex but that usually can provide more accurate results (Section V-A2). The best methodology for each particular case might depend on the required accuracy, or the time the attacker has to do the attack.
1) Quickly Identifying the DRAM Manufacturer and Model: We can quickly infer some characteristics of the DRAM manufacturer of the victim DRAM module remotely by using two simple techniques based on RowHammer. These techniques can not accurately distinguish between Mfr. A and Mfr. D modules, so they might have to be complemented with more sophisticated techniques (Section V-A2) when required.
Mfr. B: Unique Logical-to-Physical Row Mapping. DRAM manufacturers use DRAM internal mapping schemes to translate memory-controller-visible row addresses to physical row addresses in DRAM [1,16,26,33,34,44,53,56,61,[108][109][110][111][112][113]. We use the logical-to-physical row mapping to uniquely identify Mfr. B modules. We observe that Mfr. A, Mfr. C, and Mfr. D modules use a sequential logical-to-physical row mapping, whereas Mfr. B uses a unique logical-to-physical row mapping in which two adjacent row addresses sent from the memory controller might map to non-adjacent physical locations in the DRAM chip.
To discover the logical-to-physical row mapping of a DRAM module, we use the observation that, when performing a single-sided RowHammer attack, the rows with more RowHammer-induced bit flips are the rows that are physically adjacent to the attacker row. Using this observation, we perform a simple iterative algorithm that infers the logical-tophysical mapping. Table III shows the logical-to-physical row mapping from all four major DRAM manufacturers we test. In the table, each element in the address, physical (phy) or logical (log), represents a bit, where bit 0 is the least significant bit of the address.

Logical-to-Physical Row Mapping
Mfr.
‡ where y ranges from 3 to N. We make two observations. First, Mfr. B is the only manufacturer that uses a non-sequential logical-to-physical row mapping. Second, all Mfr. B modules have the same logical-to-physical row mapping in all modules we test. We verify that Mfr. B uses this mapping also for other modules other than the ones we use for performing our thorough characterization (Table II). We conclude that an attacker can identify Mfr. B modules by just reverse engineering their unique logical-tophysical row mapping.

Mfr. A and Mfr. D: Single-sided RowHammer Tests.
We make the new observation that performing single-sided RowHammer usually only affects to one neighboring row in Mfr. A and Mfr. D modules. For example, we observe that hammering row X causes bit flips only in X + 1, and hammering row X + 1 causes bit flips only in row X. In Mfr. B and Mfr. C modules, when performing a single-sided RowHammer attack, the two victim rows are susceptible to bit flips. We speculate that this observation is caused by architectural design decisions. 1 We conclude that we can use a single-sided RowHammer attack to identify DRAM modules from Mfr. A and D.
Identifying the DRAM Model. Modules from the same manufacturer might have different characteristics, depending on the manufacturing process, manufacturing date, etc. To identify the particular DRAM model of a DRAM module, we use the observation that the BER of modules from the same manufacturer but different technology nodes differ significantly. This observation could also be used to infer the DRAM manufacturer, as the absolute BER values from different manufacturers also differ very significantly in the modules we test (see Section VII-A).
2) Accurately Identifying the DRAM Manufacturer and Module: U-TRR [105] assesses the security guarantees of recent DRAM chips by reverse engineering proprietary ondie RowHammer mitigation mechanisms, commonly known as Target Row Refresh (TRR). TRR detects and refreshes potential RowHammer-victim rows, but its exact implementations are not openly disclosed. U-TRR is based on the new observation that data retention failures in DRAM enable a side channel that leaks information on how TRR refreshes potential victim rows. The authors show in their evaluation that it is possible to reverse engineer the TRR mechanism for many different DRAM models from 3 major manufacturers. Our observation is that each manufacturer implements TRR in a different way, and, for modules from the same manufacturer, there are also a wide variety of TRR implementations. We conclude that we can use the techniques proposed by [105] to uniquely identify a particular DRAM model.

B. Step 2: Build the Polynomial Regression Model
Although the absolute BER of two different modules from the same manufacturer and technology node can differ significantly, the correlation between BER and temperature have a very similar relation (i.e., the shape of the polynomial regression curve is very similar in most cases). Thus, using the data obtained from the BER characterization, an attacker can 1) make a polynomial regression model from a DRAM module with the same characteristics as the victim DRAM module, and 2) use the model to estimate the relative temperature changes of the victim DRAM module.
Using a polynomial regression model, we can estimate the temperature change δ [in°C]. In our evaluation, we demonstrate that a polynomial regression model of order 3 is enough to estimate temperature with ±5°C accuracy when estimating relative temperatures changes, and ±1°C accuracy when estimating absolute temperatures, for most DRAM modules we test.

C. Step 3: Allocate a Contiguous Memory Region
Unlike other RowHammer attacks [7], SpyHammer does not require sophisticated techniques to place the victim memory row (not controlled by the attacker) into a particular physical row that is adjacent to the aggressor row controlled by the attacker. Instead, in SpyHammer, both the victim and the aggressor row are in the attacker's own memory space.
The attacker only has two requirements when allocating memory from the victim system. First, the memory region should be as contiguous as possible (i.e., the memory space is not very fragmented), so when performing hammers the aggressor and victim row are neighbors with high probability. This is important not only for maximising the BER, but also for not corrupting the memory of other processes that use memory in adjacent memory regions. Second, for using the canary cell optimization, the memory region should not migrate to different physical locations during the attack, as the canary cells change from region to region. When using BER to spy on temperature, this is not required, as different regions within the same DRAM module have similar BER (see Section VII-A).
To identify if the physical memory region changes at different points in time, the attacker can use memory deduplication to reverse-map any physical page into a virtual page [7].

D. Step 4: Monitor the BER of the Victim DRAM Module
SpyHammer is carried out in a memory region entirely in the attacker's address space. To characterize the BER of the memory region, the attacker simply needs to perform a Row-Hammer attack to every row within their address space with a double-sided RowHammer attack (as described in Section IV), and count the total number of RowHammer-induced bit flips in the memory region. More sophisticated attacks can be used to trigger the attack (e.g., Blacksmith [74]), but we evaluate a double sided attack to simplify the comparison and to extract more clear conclusions.
The attacker initially establishes an estimated reference temperature by correlating the measured BER to the estimated temperature using the polynomial regression model (Step 3). In subsequent BER measurements and temperature estimations, the attacker can estimate the relative temperature changes using the model.

E. Step 5: Enroll and Monitor Canary Cells
To improve performance and reduce the probability of the SpyHammer attack to be detected, we identify and monitor canary cells, i.e., cells that only flip at a particular temperature point. By using canary cells, an attacker only needs to characterize (i.e., hammer) a few cells in the memory region instead the entire memory region. Before using canary cells to estimate temperature, the attacker needs to identify those canary cells in a variety of different temperatures (i.e., enrollment). Enrollment requires characterizing the victim system during a large-enough time period to the system work in a wide variety of temperatures.
Enrolling Canary Cells. The canary enrollment process registers the cells that will be used as canaries for detecting temperature changes. This process requires to monitor DRAM cells while characterizing the BER (Step 4). To this end, the attacker 1) associates every different BER value (with a specified error tolerance) with the DRAM cells that experience bit flips at only at the associated BER (i.e., canary cells), and 2) eliminates duplicated canary cells from the previously generated BER-canary cells pairs. By using this methodology iteratively, the attacker can identify which cells are vulnerable to RowHammer at a specific BER value.
Monitoring Canary Cells to Estimate Temperature. After enrolling the canary cells, the attacker monitors canary cells (i.e., check if the enrolled canary cells are vulnerable to RowHammer) to detect temperature changes, instead of accessing large regions of DRAM to calculate the BER. By comparing the BER associated with different canary cells, the attacker can infer relative temperature changes using the same methodology as used in Step 4.
To minimize the number of DRAM accesses, the attacker can use a limited amount of canary cells per temperature, or access DRAM rows that have a large number of canary cells.

VI. SPYING ON ABSOLUTE TEMPERATURE VALUES WITH SPYHAMMER
This variant of the SpyHammer attack aims to spy on absolute values of temperature. For doing so, the attacker must characterize the victim DRAM module prior to the attack (see Section III-B) under different temperature conditions. Thus, the attacker does not need to reverse engineer the model of the victim DRAM module, as in Section V-A. Because the attacker uses the victim DRAM module to build the polynomial regression model, the temperature estimations are absolute and more accurate, as we demonstrate in Section VII-A. The rest of the attack remains the same as in Section V.
We discuss the limitations of this attack model in Section VIII-B.

VII. EVALUATION
We evaluate the SpyHammer accuracy and sensitivities when using both BER (Section VII-A) and canary cells (Section VII-B) to spy on relative temperature changes and absolute temperature.

A. BER Characterization and Analysis
We characterize and analyze the correlation between BER and temperature for four different manufacturers. Figure 2 shows the RowHammer-induced BER for temperatures from 50 • C to 95 • C. We analyze 12 DRAM modules, 3 identical modules (i.e., manufacturing data, technology node, chip identifier, etc.) for each DRAM manufacturer. We use a memory region of 192MB (i.e., 24K DRAM rows) for each DRAM module, and we repeat each experiment 20 times for each temperature point. We plot a line for each module (in the same color as the points in the plot) that represents the polynomial regression model we use for each module.     We make five observations. First, the absolute BER values of 2 identical modules from the same manufacturer can differ significantly. For example, Module Id. 3 from Mfr. A shows in the order of 2.5× more bit flips than Module Id. 2. Second, the form of the curve for a particular DRAM module is similar to the curve from other modules from the same manufacturer. For example, although thee absolute BER values differ slightly, all curves from Mfr. D modules have approximately the same shape. Third, the BER can increase (e.g., Mfr. A) or decrease (e.g., Mfr. B) depending on the DRAM manufacturer. Fourth, most modules (i.e., Mfrs. A, B and D) show a linear relation between BER and temperature. In Mfr. C, we observe that the relation is not linear if the temperature is higher than 70°C. Fifth, the BER across the 20 repetitions of the experiment is very similar, as there is little variation within the y-axis for each temperature point.
We conclude that the similar correlation between BER and temperature within the same manufacturer can be used to estimate the victim temperature. 2 To do so, we find that a polynomial regression model of order 3 is good enough to accurately model the correlation beetween BER an temperature for all modules we test. Table IV shows   We observe that the the regression curve is reasonably similar between modules from the same manufacturers. We conclude that we can spy on temperature by using a polynomial regression model from a DRAM module that is the same model as the victim DRAM module. However, we assume that the accuracy of the model can significantly change depending on the DRAM module and the threat model.
Methodology for Measuring Accuracy. To evaluate the accuracy of the polynomial regression model to estimate temperature, we select a sequence of 720 random temperature points in the tested range (i.e., from 50°C to 95°C), and we measure the accuracy of the estimation for all temperatures in the sequence. For spying on relative temperature changes, we use the change between consecutive temperature points in the sequence, and for spying on absolute temperature, we use each temperature point in the sequence. We make sure that the sequence of random temperatures include extreme temperature changes (e.g., from 95°C to 50°C), and small temperature changes (e.g., from 50°C to 51°C).

Accuracy when Spying on Relative Temperature Changes.
We study the accuracy of spying the relative temperature changes of the victim DRAM module using a polynomial regression model obtained from a DRAM module that is the same model as the victim DRAM module. Figure 3 shows the probability distribution of the temperature error when we use the polynomial regression model. For each victim DRAM module of each manufacturer, we use a polynomial regression model obtained from one of the other two modules we test from the same manufacturer. Table V shows the maximum error in the estimation of the relative temperature changes (in°C), for 90 th percentile of the error distribution. We show values for temperature changes up to 45°C (L), and for temperature changes up to 5°C (S), which should be the common case if the BER monitoring frequency is large enough.  We make two observations. First, the error of the temperature estimated by the regression model reasonably low for modules from Mfr. B (Module Id. 4, 5, 6) and Mfr. D (Module Id. 10,11,12), because the correlation between BER and temperature is very similar across all modules from the same manufacturer. We find that the error is larger for Mfr. A (Module Id. 1, 2, 3) and Mfr. C (Module Id. 7,8,9) because in each of these manufacturers there is one module that has a slightly different curve than the other two modules. Second, in many cases, the estimation error is zero (i.e., error = 0°C). We observe that when the temperature change is small (e.g., <5°C), the estimation error is small for all modules (<3.5°C), whereas when the temperature change is large (e.g., up to 45°C) the estimation error is much larger (only 3 modules have less than 3.5°C error).
We make two conclusions. First, for all possible temperature changes (i.e., from very small to very large temperature changes), a polynomial regression model works well if the modules show very similar correlations between BER and temperature. Second, for small temperature changes, we can get accurate temperature estimations from all modules we test. By sampling with enough frequency, this should be always the case in regular conditions.

Accuracy when Spying on Absolute Temperature Values.
We study the accuracy of spying the absolute temperature of the victim DRAM module using a polynomial regression model obtained from the victim DRAM module itself. Figure 4 shows the probability distribution of the error when estimating the absolute temperature. Table VI shows the maximum error in the estimation of the absolute temperatures (in°C), for 90 th percentile of the error distribution.  We make the main observation that the absolute temperature estimations are very accurate for most of the DRAM modules. All modules we tested show an error lower than 2.5°C for 90 th percentile. We conclude that 1) using a regression model from the same victim DRAM module provides accurate results, and 2) a polynomial regression model is enough to accurately estimate absolute temperatures in most modules.
BER Variations in Different DRAM Regions. To make the attack less intrusive and simple (i.e., reduce the probability of being detected), an attacker can monitor the BER in a smaller DRAM region to reduce the number of RowHammer accesses. We study if different DRAM regions within a DRAM module have a similar BER behavior. Figure 5 shows the correlation between the BER and the temperature, for 48 different DRAM regions of 4MB, for all DRAM modules we test.  We make two observations. First, the correlation of BER with temperature follows the same trend for all regions we test (i.e., the curves for different regions within the same module are similar). Second, the variation on absolute BER values across different regions is reasonably small for all DRAM modules.
We conclude that the attacker can use any region in memory to perform the attack, which simplifies the requirements of the attack (i.e., no need for reverse engineering the physical location of the memory region to find an appropriate region).
Sensitivity to Different Region Sizes. To improve performance and reduce the probability of the attack to be detected, the attacker can reduce the size of the DRAM region used for performing the attack. Figure 6 shows the mean error of the temperature change estimated by the polynomial regression model, for different region sizes from 512 rows (4MB) to 24k rows (192MB). The the color of the bars represents the two threat models we evaluate: 1) spying on relative temperature changes, and 2) spying on absolute temperatures.
We make three observations. First, we can reduce the region size from 24k to 2k with minor or none increase in the mean error for all cases we test. Second, for region sizes lower than 2k, the mean error increases significantly in many cases.  a very significant error increase in the absolute temperature estimation. Third, the mean error values show similar trends for both relative temperature changes and absolute temperature, for most modules we test. However, the error increases more quickly when reducing the region size when estimating absolute temperatures. We conclude that the attacker can use regions of size as small as 2k rows (i.e., 16MB) for spying on temperature, while maintaining reasonable levels of accuracy.

B. Canary Cell Analysis
Canary cells can be used to reduce to optimize the SpyHammer attack by reducing the number of hammers required to perform the attack (see Section V). We analyze the number of canary cells we observe for each temperature point that can be used to estimate the temperature of the victim DRAM module. Figure 7 shows the number of canary cells (in logarithmic scale) per temperature point, and the minimum number of canary cells across all temperature points. In the enrollment process, we repeat each experiment 10 times for each temperature point, and we select those cells that experience bit flips at least once.
We make two observations. First, all temperature points we test have at least 18 canary cells (Module Id. 11, and 12) in the worst case, in all modules we test. The minimum number of canary cells is large enough, as it only requires one single canary cell to estimate the temperature at a particular temperature point. Second, there are more canary cells on the extremes of the temperature range. This phenomenon is caused by the limited temperature range, so some canary cells at the  We conclude that all modules we test have a large enough number of canary cells (i.e., more than one) for each temperature point, so they can be used to reliably infer the DRAM temperature.
Canary Cell Accuracy. We measure the accuracy of SpyHammer when using canary cells. Figure 8 shows the probability distribution of the temperature errors when spying on absolute temperature using canary cells. 3 We use 10 iterations of our experiments to perform the enrollment process (i.e., identify the canary cells), and another 10 different iterations of our experiments to monitor the canary cells and spy on temperature.
We make two main observations. First, canary cells can estimate the temperature accurately (i.e., no errors) with more than 25% probability, with some cases close to 50% (e.g., Module Id. 4,8). Second, canary cells can be used to estimate temperature with less than ±5°C error with very high probability.
We conclude that canary cells can be used to estimate temperature with significant accuracy, while reducing the number of hammers significantly. For example, if an attacker wants to know if the temperature is 60°C, it only has to monitor a canary cell that flips only at that temperature point, instead of hammering a large region of memory (see Section VII-A).

A. Discussion
SpyHammer is the first practical attack that spies on DRAM temperature without any software or hardware modification to the victim system. As many prior works demonstrate, DRAM devices are becoming increasing vulnerable to Row-Hammer [2,72], and they can be remotely induced at system level [6,31], without physical access, which makes SpyHammer challenging to mitigate.
Unlike other RowHammer attacks [5][6][7]31], SpyHammer is much simpler to perform because of two main reasons. First, SpyHammer happens entirely in the attacker address space, not requiring to trigger bit flips in other processes. This makes the attack more difficult to detect. Second, the attacker does not require to perform complex memory templates, and it does not depend on the memory allocator of the system [7]. As we demonstrate in Section VII-A, the correlation between BER and temperature is very similar across different regions of the same DRAM module, thus SpyHammer also does not need to understand the exact physical location of the allocated memory.
For these reasons, we believe that SpyHammer is a simple practical attack that can compromise the security and privacy of any system that uses modern DRAM modules.

B. Limitations
SpyHammer has one main limitation. To spy on absolute temperature changes, the attacker requires to characterize the victim DRAM module previously to performing the attack, in an environment controlled by the attacker with precise temperature control. Without previous access to the victim DRAM device, we can only infer relative temperature changes over time. This is also the case for any mechanism proposed by previous work [114]. The reason of this limitation is that each DRAM chip, even if they are from the same manufacturer and technology node, presents unpredictable variation caused by process variation. For example, we find that the BER of two modules from the same manufacturer and technology node can differ up to a factor of 2.5× (see Figure 2).

IX. COUNTERMEASURES
SpyHammer can spy on DRAM temperature without any modification to the victim system. The correlation between RowHammer-induded errors and temperature is inherent to the DRAM device. There are two types of countermeasures against SpyHammer.
First, general RowHammer defense mechanisms that prevent agains RowHammer bit flips, independently of the temperature. A good RowHammer defense mechanism that can mitigate most RowHammer bit flips would be also effective to prevent SpyHammer. There is an emerging body of work that provides efficient RowHammer defense mechanisms [1,19,48,73,107,113, that can be also used to mitigate SpyHammer. For example, BlockHammer [113] selectively throttles memory accesses that could otherwise potentially cause RowHammer bit-flips. The key idea of BlockHammer is to 1) track row activation rates using area-efficient Bloom filters, and 2) use the tracking data to ensure that no row is ever activated rapidly enough to induce RowHammer bit-flips.
Second, specific RowHammer defense mechanisms that obfuscate the relation between BER and temperature by introducing a temperature-dependent parameters in the mechanism. These types of mechanisms are impractical, as they only target our SpyHammer attack, whereas general RowHammer defenses can protect against all types of RowHammer attacks.
Thus, we conclude that SpyHammer should be mitigated with general and effective RowHammer mitigation mechanisms. To date, existing DRAM modules still do not employ such effective techniques [2,72,74,105].

X. RELATED WORK
This is the first attack that can remotely spy on temperature without compromising the victim system (i.e., no software or hardware modification to the victim system).
Attacks that Spy on Temperature. Xiong et al. [114] proposes an attack that spies on DRAM temperature by using the observation that when the temperature increases [33], the leakage of the DRAM cells also increases, thus retention errors are manifested earlier. The main limitation of this attack is that, to observe bit errors caused by retention failures, the cell needs to be discharged for many seconds. This work has two main limitations. First, the technique requires disabling DRAM refreshes in the victim system, which can corrupt the data in critical data structures of the operating system, which would break the system. Second, disabling refreshes requires modifications to the victim system, which in turn requires the attacker to have physical access to the device before conducting the attack. Compared to Xiong et al. [114], SpyHammer can spy on temperature without any hardware or software modifications to the victim system. Also, SpyHammer does not require to disable refreshes, which enables to remotely spy on temperature without corrupting the data of other processes running on the same system.
Characterization of Real DRAM Chips. Three major works extensively characterize RowHammer using real DRAM chips [1,2,72]. The first RowHammer work [1] that that investigates the vulnerability in detail for the first time 1) analyzes 129 commodity DDR3 DRAM modules, 2) characterizes the sensitivity of RowHammer to refresh rate, activation rate, and the physical distance between aggressor and victim rows, and 3) analyzes several potential solutions. The second extensive RowHammer characterization [2], conducted in 2020, analyzes RowHammer scalability by performing experiments on 1580 DDR3, DDR4, and LPDDR4 commodity DRAM chips from different DRAM generations and technology nodes, demonstrating that RowHammer has become more problematic over time. The third work [72], conducted in 2021, studies the sensitivity of RowHammer to DRAM chip temperature, aggressor row active time, and victim DRAM cell's physical location, by performing experiments on 248 DDR4 and 24 DDR3 modern DRAM chips from four major manufacturers.
Even though these works rigorously characterize various RowHammer aspects, they do not analyze the effects of temperature in great detail: 1) they do not perform fine-grained analyses (e.g., 1°C steps), 2) they do not empirically analyze their observations from the attacker perspective in great detail, and 3) they do not build and experimentally demonstrate new RowHammer attacks based on the correlation between RowHammer vulnerability and temperature.

XI. CONCLUSION
Recent studies demonstrate that new DRAM devices are becoming increasingly more vulnerable to RowHammer, and many works demonstrate system-level attacks for privilege escalation or information leakage. In this work, we leverage two key observations about RowHammer characteristics to spy on DRAM temperature: 1) RowHammer-induced bit error rate consistently increases (or decreases) when the temperature increases, and 2) some DRAM cells that are vulnerable to RowHammer cause bit errors only at particular temperature. Based on these observations, we build a new RowHammer attack, called SpyHammer, that spies on temperature of critical systems such as industrial production lines, unmanned or semi-automated vehicles, and medical systems, without any modification to the victim system. We propose two variants of SpyHammer for two different threat models. First, if the attacker cannot characterize the victim DRAM module before the attack, they can use SpyHammer to spy on relative temperature changes on the victim system. Second, if the attacker can characterize the victim DRAM module before the attack, they can use SpyHammer to spy on absolute temperature. Our evaluation shows that SpyHammer can 1) spy on relative temperature changes with an error of ±3.5°C, and 2) spy on absolute temperature changes with an error of ±2.5°C, for all 12 DRAM modules from 4 manufacturers, at the 90 th percentile of tested temperature points.
We conclude that SpyHammer is a simple and effective attack that can spy on temperature of critical systems with no modifications or prior knowledge about the victim system. We believe that SpyHammer will be a threat to security and privacy of systems until a definitive RowHammer defense mechanism is adopted, which is a big challenge given the tendency of RowHammer vulnerability to worsen with technology scaling.