Speculative execution side-channel vulnerability affecting modern microprocessors
Spectre is a class of microarchitectural side-channel attacks that exploit speculative execution in modern CPUs to leak sensitive data across security boundaries.
Discovered independently by Jann Horn of Google Project Zero and researchers from several universities, Spectre affects virtually all modern processors that implement speculative execution — including Intel, AMD, ARM, and IBM chips.
Unlike traditional software vulnerabilities, Spectre stems from fundamental hardware design optimizations. It forces the CPU to speculatively execute instructions that should never run, leaving measurable side effects in cache state that can be probed by an attacker.
Exploits conditional branch misprediction. The attacker trains the branch predictor to speculatively execute code with an out-of-bounds index, causing the CPU to transiently read memory it should not access.
Key insight: The CPU performs the memory access speculatively before verifying the bounds check. Even though the result is eventually discarded, the access pattern leaves traces in the cache that can be measured.
Manipulates the branch target buffer (BTB) to redirect speculative execution to attacker-chosen locations. This allows indirect branches to be hijacked during speculative execution, potentially exposing arbitrary kernel memory to user-space processes.
The attack follows three conceptual phases:
Complete elimination of Spectre requires hardware changes. Software mitigations include:
LFENCE insertion to block speculative execution past bounds checksNote: Mitigations often carry performance penalties ranging from negligible to 30% depending on workload, particularly for system calls and indirect branch-heavy code.
Spectre can potentially read arbitrary memory in the victim's address space — including passwords, encryption keys, and other secrets — without leaving traces in traditional logs. The attack is difficult to detect and can be executed from JavaScript in a web browser.