Skip to main content
QUICK REVIEW

[论文解读] Cryptographically Enforced Control Flow Integrity

Ali José Mashtizadeh, Andrea Bittau|arXiv (Cornell University)|Aug 7, 2014
Security and Verification in ComputingComputer Science参考文献 7被引用 18
一句话总结

本文提出密码学强制控制流完整性(CCFI),一种细粒度且实用的防御机制,通过在控制流元素(如返回地址和函数指针)上使用消息认证码(MAC)来防止控制流劫持。通过利用硬件加速的AES-NI指令并将在专用寄存器中存储的密钥,CCFI即使在强大敌手模型下也能检测控制数据的篡改,实现在真实软件栈上3–18%的性能开销。

ABSTRACT

Recent Pwn2Own competitions have demonstrated the continued effectiveness of control hijacking attacks despite deployed countermeasures including stack canaries and ASLR. A powerful defense called Control flow Integrity (CFI) offers a principled approach to preventing such attacks. However, prior CFI implementations use static analysis and must limit protection to remain practical. These limitations have enabled attacks against all known CFI systems, as demonstrated in recent work. This paper presents a cryptographic approach to control flow integrity (CCFI) that is both fine-grain and practical: using message authentication codes (MAC) to protect control flow elements such as return addresses, function pointers, and vtable pointers. MACs on these elements prevent even powerful attackers with random read/write access to memory from tampering with program control flow. We implemented CCFI in Clang/LLVM, taking advantage of recently available cryptographic CPU instructions. We evaluate our system on several large software packages (including nginx, Apache and memcache) as well as all their dependencies. The cost of protection ranges from a 3-18% decrease in request rate.

研究动机与目标

  • 解决软件中控制流劫持的根本性漏洞,该漏洞会破坏传统防御机制(如栈溢出保护和ASLR)的有效性。
  • 克服先前控制流完整性(CFI)系统依赖粗略静态分析和粗粒度指针分组的局限性。
  • 开发一种实用且细粒度的CFI机制,以抵御复杂攻击,包括具有任意内存读写访问权限的攻击。
  • 通过运行时指针分类(例如,按内存地址)来避免静态分析带来的可扩展性和兼容性问题。
  • 将密码学生效检查集成到标准编译器工具链(Clang/LLVM)中,以实现仅需极少代码修改的现实世界部署。

提出的方法

  • 在每次将控制流关键数据(如返回地址、函数指针、虚函数表指针)存储到内存时,应用消息认证码(MAC)。
  • 将MAC与控制流数据一同存储,并在每次加载时进行验证以检测篡改。
  • 使用存储在专用CPU寄存器中的密钥,防止密钥通过内存泄露漏洞被窃取。
  • 将内存地址和指针类型(如返回指针与函数指针)纳入MAC输入,以防止指针交换攻击。
  • 利用硬件加速的AES-NI指令,仅用40个周期即可计算MAC,最大限度降低性能开销。
  • 随机化内存分配以降低可预测性,使针对指针的重放攻击更难实现。

实验结果

研究问题

  • RQ1密码原语能否在不依赖静态分析的前提下实现细粒度的控制流完整性?
  • RQ2硬件加速的MAC能否提供足够的性能,使密码学CFI在生产软件中成为实用方案?
  • RQ3CCFI能否防止所有已知的控制流劫持攻击,包括那些可绕过传统CFI系统的攻击?
  • RQ4通过运行时属性(如内存地址)对指针进行分类,相较于编译时静态分类,如何提升安全性?
  • RQ5CCFI在多大程度上可与现有软件栈集成,且仅需极少代码修改?

主要发现

  • 在包含任意内存读写访问权限的强大敌手模型下,CCFI成功防止了所有已知的控制流劫持攻击。
  • 该系统在真实世界软件(包括nginx、Apache、memcached及其依赖项)上实现了3–18%的性能开销,且仅需少量代码修改。
  • 仅有两个软件包(libapr和Nginx)需要手动修改代码以实现MAC计算兼容性。
  • 在MAC中使用基于地址的分类可防止破坏现有CFI系统的指针交换攻击。
  • 硬件加速的AES-NI可实现高效的MAC计算(仅需40个周期),从而无需为性能而省略或简化检查。
  • CCFI与现有CFI系统向后兼容,且可扩展以支持额外的分类标准,如类型或编译时分组。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。