arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.16220cs.CR
收藏

将保护置于正确位置:针对 Spectre v1 的加密代码定向加固

Place Protections at the Right Place: Targeted Hardening for Cryptographic Code against Spectre v1

Yiming Zhu, Wenchao Huang, Yan Xiong

AI总结:

本文提出基于不动点算法的 LightSLH 框架,定向检测并加固加密代码中的 Spectre v1 漏洞,以可证明安全性显著降低开销,并发现编译器与 scatter-gather 访问模式的新风险。

摘要:

Spectre v1 攻击对安全关键软件(尤其是加密实现)构成重大威胁。然而,现有软件缓解措施往往在未评估指令脆弱性的情况下不加区分地加固指令,从而引入过高开销。我们提出一种分析框架,采用新型不动点算法检测 Spectre 漏洞并实施定向加固。该不动点算法考虑逐步加固引发的程序行为变化,从而实现精确、可靠且高效的漏洞检测。该框架还为不同加固策略和攻击者模型提供灵活性,支持定制化的定向加固。我们将该框架实例化为 LightSLH,它以可证明的安全性加固程序。我们在来自 OpenSSL、Libsodium、NaCL 和 PQClean 的加密算法上评估 LightSLH。在所有实验案例中,LightSLH 在当前可证明保护策略中提供最低开销,其中 50% 的案例开销为 0%。值得注意的是,对 LightSLH 的分析揭示了两个此前未知的安全问题:(1)编译器可能引入 LLSCT 所忽视的风险;LLSCT 是一种在 LLVM IR 层面被证明安全的加固方法。我们利用编译器插入的栈加载成功构造侧信道,证实了该风险。(2)即使对于具有缓存行粒度的观察者,scatter-gather 算法生成的内存访问模式仍依赖于秘密。这些发现和结果凸显了对特定指令施加准确保护的重要性。

英文摘要:

Spectre v1 attacks pose a substantial threat to security-critical software, particularly cryptographic implementations. Existing software mitigations, however, often introduce excessive overhead by indiscriminately hardening instructions without assessing their vulnerability. We propose an analysis framework that employs a novel fixpoint algorithm to detect Spectre vulnerabilities and apply targeted hardening. The fixpoint algorithm accounts for program behavior changes induced by stepwise hardening, enabling precise, sound and efficient vulnerability detection. This framework also provides flexibility for diverse hardening strategies and attacker models, enabling customized targeted hardening. We instantiate the framework as LightSLH, which hardens program with provable security. We evaluate LightSLH on cryptographic algorithms from OpenSSL, Libsodium, NaCL and PQClean. Across all experimental cases, LightSLH provides the lowest overhead among current provable protection strategies, including 0\% overhead in 50\% cases. Notably, the analysis of LightSLH reveals two previously unknown security issues: (1) The compiler can introduce risks overlooked by LLSCT, a hardening method proven secure at the LLVM IR level. We successfully construct a side channel by exploiting compiler-inserted stack loads, confirming this risk. (2) Memory access patterns generated by the scatter-gather algorithm still depend on secrets, even for observers with cache line granularity. These findings and results highlight the importance of applying accurate protections to specific instructions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑