[论文解读] Inferring Fine-grained Control Flow Inside SGX Enclaves with Branch Shadowing
论文提出了一种分支影子侧信道攻击,通过利用分支预测、BTB和LBR来揭示 SGX enclaves 内的细粒度控制流,并提出包括 Zigzagger 在内的缓解措施。
In this paper, we explore a new, yet critical, side-channel attack against Intel Software Guard Extension (SGX), called a branch shadowing attack, which can reveal fine-grained control flows (i.e., each branch) of an enclave program running on real SGX hardware. The root cause of this attack is that Intel SGX does not clear the branch history when switching from enclave mode to non-enclave mode, leaving the fine-grained traces to the outside world through a branch-prediction side channel. However, exploiting the channel is not so straightforward in practice because 1) measuring branch prediction/misprediction penalties based on timing is too inaccurate to distinguish fine-grained control-flow changes and 2) it requires sophisticated control over the enclave execution to force its execution to the interesting code blocks. To overcome these challenges, we developed two novel exploitation techniques: 1) Intel PT- and LBR-based history-inferring techniques and 2) APIC-based technique to control the execution of enclave programs in a fine-grained manner. As a result, we could demonstrate our attack by breaking recent security constructs, including ORAM schemes, Sanctum, SGX-Shield, and T-SGX. Not limiting our work to the attack itself, we thoroughly studied the feasibility of hardware-based solutions (e.g., branch history clearing) and also proposed a software-based countermeasure, called Zigzagger, to mitigate the branch shadowing attack in practice.
研究动机与目标
- 激发和评估 SGX enclaves 在超越粗粒度页面级攻击的细粒度控制流泄漏方面的安全风险。
- 研究一种新的旁信道——分支影子——利用分支预测历史来揭示 enclave 的执行痕迹。
- 评估针对当前 SGX 防御的攻击,并提出具有可测量开销的实际缓解措施。
提出的方法
- 开发一种分支影子技术,将 BTB 与 LBR 结合,以确定 enclave 内的目标分支是否被采取及其目标。
- 使用 Intel PT 定时和 LBR 经历周期数据,以尽可能减少噪声地精确推断分支结果。
- 通过 APIC 定时器和缓存控制操作执行时序与内存寻址,来同步 victim 与 shadow 代码以实现准确探测。
- 在低地址位对齐 shadow 与 victim 的分支地址,以允许 BTB 冲突和共享预测状态。
- 探测不同类型的分支(有条件、无条件、间接),并解释 LBR 与经过的周期以推断分支历史和目标。
- 提出缓解措施,包括基于硬件的分支历史清除和基于软件的 Zigzagger 以缓解该攻击。
实验结果
研究问题
- RQ1操作系统控制的攻击者是否能够在 SGX enclaves 内推断出比粗粒度页面级访问模式更细粒度的控制流?
- RQ2如何将 BTB 与 LBR 的特性结合起来,在 enclave 内揭示分支级执行痕迹?
- RQ3有哪些实用的对策可以缓解分支影子攻击,同时保持可接受的性能开销?
主要发现
- 分支影子攻击可以在基本块级别识别 enclave 内的细粒度控制流。
- 使用 LBR 和 Intel PT 可在相较于先前定时方法的测量噪声更低的情况下,获得精确的分支历史信息。
- 该攻击能够从 SGX 应用中提取敏感信息,并绕过若干最先进的 SGX 防御措施(例如 deterministic multiplexing、 Sanctum、 SGX-Shield、 T-SGX)。
- 基于硬件和软件的缓解措施是可行的,所提方法的开销低于 1.3x。
- 该攻击展示了有条件、无条件和间接分支在完整 enclave 执行痕迹中的泄漏。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。