Abstract
We introduce Blade, a new approach to automatically and efficiently eliminate speculative leaks from cryptographic code. Blade is built on the insight that to stop leaks via speculative execution, it suffices to cut the dataflow from expressions that speculatively introduce secrets (sources) to those that leak them through the cache (sinks), rather than prohibit speculation altogether. We formalize this insight in a static type system that (1) types each expression as either transient, i.e., possibly containing speculative secrets or as being stable, and (2) prohibits speculative leaks by requiring that all sink expressions are stable. Blade relies on a new abstract primitive, protect, to halt speculation at fine granularity. We formalize and implement protect using existing architectural mechanisms, and show how Blade's type system can automatically synthesize a minimal number of protects to provably eliminate speculative leaks. We implement Blade in the Cranelift WebAssembly compiler and evaluate our approach by repairing several verified, yet vulnerable WebAssembly implementations of cryptographic primitives. We find that Blade can fix existing programs that leak via speculation automatically, without user intervention, and efficiently even when using fences to implement protect.
| Original language | English |
|---|---|
| Article number | 49 |
| Pages (from-to) | 1-30 |
| Number of pages | 30 |
| Journal | Proceedings of the ACM on Programming Languages |
| Volume | 5 |
| Issue number | POPL |
| Early online date | 4 Jan 2021 |
| DOIs | |
| Publication status | Published - Jan 2021 |
Funding
We thank the reviewers and our shepherd Aseem Rastogi for their suggestions and insightful comments. Many thanks to Shravan Narayan, Ravi Sahita, and Anjo Vahldiek-Oberwagner for fruitful discussions. This work was supported in part by gifts from Fastly, Fujitsu, and Cisco; by the NSF under Grant Number CNS-1514435 and CCF-1918573; by ONR Grant N000141512750; by the German Federal Ministry of Education and Research (BMBF) through funding for the CISPA-Stanford Center for Cybersecurity; and, by the CONIX Research Center, one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA.
| Funders | Funder number |
|---|---|
| CISPAStanford Center for Cybersecurity | |
| CONIX Research Center | |
| National Science Foundation | 1918573, CNS-1514435, CCF-1918573 |
| Office of Naval Research | N000141512750 |
| Semiconductor Research Corporation | |
| Defense Advanced Research Projects Agency | |
| Bundesministerium für Bildung und Forschung | |
| Fujitsu | |
| CISPA-Stanford Center for Cybersecurity |
Keywords
- Constant-time
- Spectre
- Speculative execution
- Type system
Fingerprint
Dive into the research topics of 'Automatically eliminating speculative leaks from cryptographic code with blade'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver