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 \n 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.
Branch target reuse: practical spectre-v2 attacks in JIT engines via stale branch prediction entries / Wiebing, S., Zhu, Y., Biondi, A., Giuffrida, C.. - (2026), pp. 6136-6150. (CCS '26: 2026 ACM SIGSAC Conference on Computer and Communications Security The Hague, Netherlands 15-19/11/2026) [10.1145/3830454.3846672].
Branch target reuse: practical spectre-v2 attacks in JIT engines via stale branch prediction entries
Zhu Yuhui
;
2026
Abstract
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 \n 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.| File | Dimensione | Formato | |
|---|---|---|---|
|
main.pdf
Accesso aperto
Descrizione: Branch Target Reuse: Practical Spectre-v2 Attacks in JIT Engines via Stale Branch Prediction Entries
Tipologia:
Versione Editoriale (PDF)
Licenza:
Creative commons
Dimensione
894.63 kB
Formato
Adobe PDF
|
894.63 kB | Adobe PDF | Visualizza/Apri |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


