Branch Target Reuse: Practical Spectre-v2 Attacks in JIT Engines via Stale Branch Prediction Entries
Sander Wiebing, Yuhui Zhu, Alessandro Biondi, Cristiano Giuffrida
摘要
Self-Modifying Code (SMC) is the foundation of dynamic code generation in commodity JIT engines. Modern processors provide coherence mechanisms that ensure stale, overwritten code cannot be executed architecturally, but their guarantees during microarchitectural execution remain less understood. The only previously known SMC-based transient execution primitive (SCSB), is limited to x86 and relies on a very short instruction/data-cache coherence window, shaping the common view that SMC-based transient execution attacks are impractical in real-world JIT engines. In this paper, we overturn this assumption and introduce Branch Target Reuse (BTR), the first practical in-place Spectre-v2 attack. The key insight is that, while modern CPUs restore architectural code coherence after self-modification, they do not necessarily invalidate stale indirect branch prediction entries (i.e., branch targets ). In JIT engines, these stale targets can outlive the original code and later be reused when the code cache is repopulated, yielding a transient execute-after-free primitive. This allows attackers to hijack transient control flow to newly generated code at obsolete offsets, bypassing software hardening or reaching misaligned gadgets. We evaluate across SpiderMonkey, GraalVM, and the Linux kernel's cBPF JIT, and show that it is a cross-engine issue whose exploitability depends on code-cache management and garbage-collection noise. Focusing on the most vulnerable target, cBPF, we build two end-to-end exploits against the Linux kernel that leak the root password hash in minutes on Intel systems despite deployed mitigations and even when enabling cBPF's constant blinding defense.
问 Lune
几分钟看清这篇 Paper 的位置,不用再花一下午。
Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
相关 Paper
- Breaking the Barrier: Post-Barrier Spectre AttacksJohannes Wikner, Kaveh RazaviS&P 2025
- RETBLEED: Arbitrary Speculative Code Execution with Return InstructionsJohannes Wikner, Kaveh RazaviUSENIX Security 2022
- Training Solo: On the Limitations of Domain Isolation Against Spectre-v2 AttacksSander Wiebing, Cristiano GiuffridaS&P 2025
- Rage Against the Machine Clear: A Systematic Analysis of Machine Clears and Their Implications for Transient Execution AttacksHany Ragab, Enrico Barberis, Herbert Bos, Cristiano GiuffridaUSENIX Security 2021 · 76 次引用
- VMSCAPE: Exposing and Exploiting Incomplete Branch Predictor Isolation in Cloud EnvironmentsJean-Claude Graf, Sandro Rüegge, Ali Hajiabadi, Kaveh RazaviS&P 2026 · 4 次引用
