[论文解读] Binsec/Rel: Efficient Relational Symbolic Execution for Constant-Time at Binary-Level
Binsec/Rel 是一个用于常数时间分析的二进制级关系符号执行工具,能够进行漏洞发现和有界验证,相较于以往方法带来显著的速度提升,并揭示由编译器优化导致的 CT 违规。
The constant-time programming discipline (CT) is an efficient countermeasure against timing side-channel attacks, requiring the control flow and the memory accesses to be independent from the secrets. Yet, writing CT code is challenging as it demands to reason about pairs of execution traces (2- hypersafety property) and it is generally not preserved by the compiler, requiring binary-level analysis. Unfortunately, current verification tools for CT either reason at higher level (C or LLVM), or sacrifice bug-finding or bounded-verification, or do not scale. We tackle the problem of designing an efficient binary-level verification tool for CT providing both bug-finding and bounded-verification. The technique builds on relational symbolic execution enhanced with new optimizations dedicated to information flow and binary-level analysis, yielding a dramatic improvement over prior work based on symbolic execution. We implement a prototype, Binsec/Rel, and perform extensive experiments on a set of 338 cryptographic implementations, demonstrating the benefits of our approach in both bug-finding and bounded-verification. Using Binsec/Rel, we also automate a previous manual study of CT preservation by compilers. Interestingly, we discovered that gcc -O0 and backend passes of clang introduce violations of CT in implementations that were previously deemed secure by a state-of-the-art CT verification tool operating at LLVM level, showing the importance of reasoning at binary-level.
研究动机与目标
- 推动对定时侧信道攻击的强鲁棒防护,通过确保控制流和内存访问与秘密(常数时间)无关。
- 通过提供一个二进制级验证器来克服高层次 CT 分析的局限性,支持漏洞发现和有界验证。
- 开发一个可扩展且与编译器无关的分析工具,能够处理在 x86 和 ARM 上的真实密码实现。
- 引入面向二进制级信息流的关系符号执行技术,以提升可扩展性和精确性。
提出的方法
- 将关系符号执行(RelSE)扩展到二进制级分析,以建模在同一路径上尽量共享的两条跟踪。
- 引入二进制级信息流追踪的自顶向下简化,以减少求解器查询。
- 开发去污(untainting)和故障打包(fault-packing)技术,以细化秘密如何影响内存和执行。
- 使用 Dynamic Bitvector Automata (DBA) 作为中间表示来建模二进制程序和泄漏。
- 提供正式正确性基础,证明对 CT 的漏洞发现和有界验证的正确性。
- 在 338 个密码实现上展示有效性,包括自动化的反例生成和 CT 保留性研究。
实验结果
研究问题
- RQ1Binsec/Rel 是否能够扩展到真实的密码二进制,并在保持对常数时间的完整漏洞发现和有界验证的前提下扩展?
- RQ2如何提升二进制级信息流追踪以最大化共享并在关系符号执行中最小化求解器查询?
- RQ3编译器优化(例如 gcc -O0、clang 后端)是否会引入 LLVM 级 CT 工具未检测到的 CT 违规?
- RQ4在速度、覆盖率和在加密代码上证明 CT 的能力方面,Binsec/Rel 与自组合(self-composition)和 RelSE 相比如何?
主要发现
- Binsec/Rel 在 98 分钟内分析约 23 million 条指令,显著提升实际可扩展性。
- 该工具在漏洞发现和有界验证场景中相较于最先进的二进制级 CT 验证方法具有巨大优势。
- RelSE 和自组合单独在真实密码实现的二进制级 CT 上难以扩展,而 Binsec/Rel 提供了显著的加速。
- 编译器优化(gcc -O0 和 clang 后端过程)可能引入 LLVM 级 CT 工具漏检的 CT 违规,强调了二进制级分析的必要性。
- Binsec/Rel 在漏洞发现方面比可比方法快 700 倍,在有界验证方面的开销接近标准的符号执行。
- 该方法能够在 408 种配置和 296 个密码实现中自动重放先前的 CT 错误并生成反例,验证跨编译器与架构的 CT 保留性关注点。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。