← Back to all chapters

Chapter 11Down the Rabbit Hole: Why DRAM Keeps Losing to Rowhammer

9 min read
rabbit-holesecurityhardwarememory

In 2025, a team at ETH Zurich and Google took an ordinary desktop with SK Hynix DDR5, default settings, and got root. The first bit flip took about 109 seconds. They flipped bits on all 15 DDR5 modules tested (made January 2021 to December 2024), and root took about five minutes. It's called Phoenix, CVE-2025-6202, going to IEEE S&P 2026.

DDR5 was supposed to be the generation where this was handled, with an in-chip defense and on-die ECC. The attack went through both. Twelve years after 2014, why do the defenses keep falling over? One early design decision, only now being walked back.

Buckets that leak#

A DRAM cell is one transistor and one capacitor; the bit is the charge. Charge leaks, so every cell is refreshed on a schedule: every 64 ms on DDR3 and DDR4, 32 ms on DDR5.

To read anything, the controller activates a whole row: the wordline goes high, cells dump charge onto bitlines, sense amplifiers read the values and write them straight back (reading drained them). Then the row is precharged and another can open.

Picture a library with shelves a millimeter apart. You keep yanking one book off a shelf and slamming it back. The librarian re-shelves everything every 64 ms. If you're fast enough, a book on a neighboring shelf falls first. That's Rowhammer: activate one row over and over, and a physically adjacent row leaks charge fast enough to flip before its next refresh.

1/3Idle
row 1   ▓▓▓▓▓▓▓▓▓▓   aggressor
row 2   ▓▓▓▓▓▓▓▓▓▓   victim  (full charge)
row 3   ▓▓▓▓▓▓▓▓▓▓   aggressor

Every cell holds full charge right after a refresh.

Hammering one row. Step through.

It isn't vibration#

Kim et al.'s 2014 paper names three electrical mechanisms: the wordline's voltage swing couples into the neighbor and partially turns on its access transistors; manufacturing defects create tiny conductive bridges between rows; and repeated toggling injects hot carriers that change the neighbor's leakage over time.

That paper found errors in 110 of 129 DDR3 modules, every module made in 2012-13, with as few as 139,000 activations. A year later Project Zero turned it into kernel privilege escalation from an unprivileged process. Rowhammer.js did it from JavaScript. It has since reached phones, RDMA networks and GPUs.

Two later results broke the "immediate neighbor" model: Half-Double (Google, 2021) reached a row two away, and RowPress (ISCA 2023) showed you needn't hammer at all, just hold a row open.

RowPress Figure 9: three panels for manufacturers S, H and M, plotting the minimum time an aggressor row must stay open to flip a bit against the aggressor row activation count, on log-log axes. All curves fall in a straight line from about 10^4.7 microseconds at one activation to a few microseconds at 10^4 activations, with dashed lines at 7.8 microseconds, 70.2 microseconds and 10 ms.

Figure 9 from Luo et al., "RowPress: Amplifying Read Disturbance in Modern DRAM Chips" (ISCA 2023), arXiv:2306.17061, licensed CC BY 4.0. Cropped and recompressed.

The longer the aggressor stays open, the fewer activations needed: about 17.6x fewer at 7.8 µs open time, about 159x fewer at 70.2 µs, and at around 30 ms a single activation sufficed. A defense that counts activations is blind to an attack that barely activates anything.

  • Plain hammering (baseline)1x
  • Open 7.8 µs17.6x fewer
  • Open 70.2 µs159x fewer
RowPress: activations needed to flip a bit, as the aggressor row stays open longer (fewer is easier).

The number that keeps falling#

HC_first is how many hammers it takes to get the first flip. It falls with every process node: smaller cells hold less charge, tighter spacing couples more. A 2020 study across 1,580 chips:

GenerationHC_first (old node to new node)
DDR369.2K to 22.4K
DDR417.5K to 10K
LPDDR416.8K to 4.8K

The worst chip flipped at 9.6K total activations, 4.8K per side. Flips at a fixed activation count rose about 500x over the same span. Projections for future chips sit near 128.

The attacker's budget: one bank can re-activate every tRC, about 47 ns, so a 64 ms window holds roughly 64 ms / 47 ns ≈ 1.36 million activations. At 139K you must aim about a tenth of the budget at one victim. At 4.8K it's trivial. At 128, a defense must catch something in a rounding error of the window, across billions of rows, cheaply.

  • One bank, 64 ms windowabout 1,360K
  • HC_first, 2014139K
  • HC_first, LPDDR4 worst4.8K
  • HC_first, projectedabout 128
Activations: what fits in a 64 ms window against what it takes to flip a bit (thousands).

The cheapest possible defense#

The 2014 paper proposed PARA: every time a row closes, flip a biased coin and with probability p refresh a neighbor. No counters, no state. The chance a victim is never rescued across N aggressor activations:

P_miss = (1 - p)^N

With p around 0.001 to 0.005 the miss probability falls below hardware error budgets, at under 0.75% performance cost. My worked example: p = 0.002 with the coin picking one of two neighbors gives 0.001 per activation, and over 50,000 hammers:

>>> (1 - 0.001) ** 50_000
1.9e-22

Lovely, but N is HC_first. Drop it from 50,000 to 128 and the same p gives 0.999^128 ≈ 0.88. Restoring safety means cranking p, and every extra coin flip is an extra refresh costing bandwidth and power. A stateless defense can't keep up with a shrinking threshold for free.

What actually shipped: a spotter with a short memory#

Vendors shipped Target Row Refresh (TRR): a small table inside the chip of rows that look hot, whose neighbors it refreshes early. TRR was optional in JEDEC and shipped as an undocumented black box. A tracker that remembers N rows is beaten by N+1 aggressors.

AttackWhat it did
TRRespass (S&P 2020)Hammered up to about 19 rows at once to overflow trackers. Flips on 13 of 42 DDR4 modules, all three major vendors.
U-TRR (MICRO 2021)Used retention failures as a side channel to watch when TRR refreshed which rows. Bypassed TRR on 45 modules.
Blacksmith (S&P 2022)Non-uniform patterns with varying frequency and phase. Flipped bits on 40 of 40 DDR4 modules.
Phoenix (S&P 2026)Reverse-engineered SK Hynix's DDR5 TRR: sampling repeats over 128 refresh intervals, about 8x longer than assumed, leaving barely-sampled stretches. Patterns sync to those blind spots and re-align on a missed refresh. On-die ECC didn't help.

Half-Double adds a twist: TRR's own refresh of the intermediate row counts as an access and helps the disturbance reach the row two away. The defense became part of the attack.

TRR tracker (4 slots)row Arow Brow Crow Dfull: neighbours get early refreshesAttacker hammers 5 rowsABCDEno slot left: unwatched
A tracker with N slots loses to N+1 aggressors. Four slots here are illustrative; real tables are undocumented.

Counting instead of guessing#

The core split: sampling versus counting. Sampling keeps a bounded set of suspects and works only if real aggressors stay in it. Counting keeps ground truth; nothing overflows.

activations stream --> [ small table of suspects ]
                            |
      table full?  evict someone, forget their count
                            |
      refresh neighbours of whoever is in the table

works only while real aggressors stay in the table
Two ways to spot a hammered row (schematic).

Graphene (2020) used the Misra-Gries heavy-hitters algorithm: to find every item appearing more than N/k times in a stream of N you need only k - 1 counters, and estimates never undercount. So one counter per slice of the activation budget that matters, roughly 2 · N_ACT / T_RH. But storage scales inversely with threshold: as T_RH falls from 1,000 to 125, the CoMeT analysis has the table growing from about 207 KiB to about 1.5 MiB.

JEDEC's DDR5 answer is PRAC (Per Row Activation Counting, 2024): an exact counter per row, updated when the row closes. At a threshold the chip raises an alert and the controller must back off, within about 180 ns, roughly 3 more activations.

Right idea, expensive. The read-modify-write on every precharge inflates timings, with reported slowdowns up to around 10-18%. And Google says PRAC isn't in the DDR5 systems it evaluated: standardized for future revisions, not shipping. What's deployed today is TRR plus on-die ECC plus an older mechanism called RFM, and Phoenix went through all of it.

When the defense leaks#

Two fronts. One makes PRAC cheap and safe: MOAT (ASPLOS 2025) showed naive PRAC queues can be "tardy", letting a count reach about 1,150 against a threshold of 128; QPRAC (HPCA 2025) uses a priority queue of the most-activated rows and claims security down to a threshold of 71.

The other attacks PRAC itself. PRACLeak (ISCA 2025): back-off stalls show up as memory latency. A victim's activity triggers mitigations, which slow the attacker's accesses, readable as a side channel. A CCS 2025 follow-up argues sampling- and counting-based defenses both leak this way. Add a defense, add an oracle. Same with ECC: ECCploit (S&P 2019) found corrected reads take measurably longer, so timing reveals which flips the code absorbed, steering attackers toward multi-bit flips it can't catch.

The question I'm left with#

Where does a safe threshold even live? Every counting scheme needs one below HC_first, which went from 139K to 4.8K with projections near 128, and varies by vendor, die revision, batch, even within one chip. Low enough to be safe forever means mitigating constantly, overhead every buyer pays. And there's no accepted way to prove a DIMM Rowhammer-safe; "RowHammer-free" labels have already proven false.

Where it belongs is open too. DRAM-only defenses deploy easily but keep failing. Controller and OS-cooperative designs are flexible but need new primitives. SAFARI argues for self-managing DRAM; VUSec and Microsoft Research argue commodity systems still need software defenses.

Beyond CPUs: GPUHammer

GPUHammer (USENIX Security 2025) flipped bits in GDDR6 on an RTX A6000, and a single flipped weight bit dropped an ML model's accuracy from about 80% to 0.1%. The A6000 ships with ECC off by default; ECC GPUs like the H100 detect and correct these flips.

Next I want to dig into the PRAC optimization race (MOAT, QPRAC, Chronus, CoMeT), because that's where it gets decided whether "count everything exactly" is affordable enough to ship.

Sources#

© 2026 Bharat Kaurav. Built with Next.js & Tailwind.

>_ bk@netherwatcheresc to close

Welcome, reader. Type help to see what this shell can do.