Unpopular Science
Sidenote illustration by Jess DG Hayes for chapter 18, “A Leaky Crystal Ball”
Sidenote illustration by Jess DG Hayes

Chapter 18 of 50

A Leaky Crystal Ball

“Be wary of anyone who claims to be able to see the future.”
Wit to Shallan, Rosharan year 1174

Speculative execution optimizes performance by executing instructions before knowing if they’re needed, leaving microarchitectural traces in cache memory even when results are discarded. Attacks such as Meltdown and Spectre exploit this, by constructing code sequences where a secret value determines which memory addresses are accessed during speculation. By measuring which addresses load quickly afterward (indicating they were cached), attackers can determine if specific bits were 0 or 1, allowing secrets to be extracted across privilege boundaries.

Topics

  • CPU Pipeline Architecture
  • Speculative Execution
  • Meltdown & Spectre
  • Cache Timing Channels
  • Branch Predictor Training
  • Microarchitectural State
  • Kernel Memory Extraction
  • Mitigations & Performance
  • KPTI & Retpolines
  • Hardware Vulnerabilities
  • 30% Performance Cost

Sidenote

Top (Celebrity in Disguise): A secret value is hidden in either Room A or Room B, represented by the celebrity and their doppelgänger. The attacker does not know which room contains the real secret. Middle (Reporter’s Probe): The reporter (attacker) sends a crafted request: ordering crème brûlée to Room A. This dish is special because only the celebrity would ever receive it. The CPU (chef) will prepare it only if the celebrity is in Room A. Bottom (Timing Side Channel): The reporter then makes a normal order, sweet potato pie. If the torch is still warm, the pie finishes faster — revealing that the crème brûlée preparation occurred, and thus that the celebrity is in Room A. If no torch warmth remains, the celebrity must be in Room B. This mirrors speculative execution: incorrect paths are rolled back architecturally, but their side effects persist in microarchitectural state, leaking secrets through timing.

Coming to YouTube

Beyond Popular Science: the films

Each chapter is becoming a short film: the book’s own words, read to camera, with its figures, sources and equations animated alongside.

The films go out under the UK edition’s title, Beyond Popular Science. The fifty chapters are the same in both editions.

Coming soon

Subscribe to the channelYouTube (opens in a new tab)
Front cover of Unpopular Science by David H. Silver: hand-drawn science doodles by Jess DG Hayes around the title

This chapter is one of fifty in Unpopular Science.

For readers curious enough to want the actual mathematics, tired of science communication that oversimplifies or sensationalizes. Science as it actually is: demanding, complex, but well worth the effort.