Skip to main content
QUICK REVIEW

[论文解读] TeeRex: Discovery and Exploitation of Memory Corruption Vulnerabilities in SGX Enclaves

Tobias Cloosters, Michael Rodler|arXiv (Cornell University)|Jul 15, 2020
Security and Verification in Computing被引用 16
一句话总结

TeeRex 是一个自动化符号执行框架,通过分析可信执行环境(enclave)二进制代码,自动发现并利用 Intel SGX 环境中的内存破坏漏洞。它在真实世界的 enclave 中识别出关键缺陷,例如任意内存写入和控制流劫持,涉及 Intel、百度、WolfSSL 以及主要生物识别指纹软件的 enclave,揭示了主机与 enclave 接口之间广泛存在的可利用漏洞。

ABSTRACT

Intel's Software Guard Extensions (SGX) introduced new instructions to switch the processor to enclave mode which protects it from introspection. While the enclave mode strongly protects the memory and the state of the processor, it cannot withstand memory corruption errors inside the enclave code. In this paper, we show that the attack surface of SGX enclaves provides new challenges for enclave developers as exploitable memory corruption vulnerabilities are easily introduced into enclave code. We develop TeeRex to automatically analyze enclave binary code for vulnerabilities introduced at the host-to-enclave boundary by means of symbolic execution. Our evaluation on public enclave binaries reveal that many of them suffer from memory corruption errors allowing an attacker to corrupt function pointers or perform arbitrary memory writes. As we will show, TeeRex features a specifically tailored framework for SGX enclaves that allows simple proof-of-concept exploit construction to assess the discovered vulnerabilities. Our findings reveal vulnerabilities in multiple enclaves, including enclaves developed by Intel, Baidu, and WolfSSL, as well as biometric fingerprint software deployed on popular laptop brands.

研究动机与目标

  • 调查真实世界 SGX enclave 中内存破坏漏洞的普遍性及其可利用性,特别是主机与 enclave 接口处的漏洞。
  • 解决缺乏自动化工具检测 enclave 二进制代码中此类漏洞的问题,尤其是在 SGX 独特威胁模型下。
  • 开发一个不仅能够检测漏洞,还能支持概念性证明(PoC)利用代码构建的框架,以验证和修复漏洞。
  • 揭示尽管 SGX 提供强大的隔离保证,但遗留代码和 SGX SDK 使用中的常见编程模式仍会引入可利用缺陷。

提出的方法

  • TeeRex 使用符号执行静态分析 enclave 二进制代码,建模主机与 enclave 之间的控制流和数据流。
  • 其符号执行引擎中集成 SGX 特有的语义,包括 enclave 入口/出口机制、内存隔离和权限分离。
  • 框架包含针对任意内存写入、控制流劫持和空指针解引用的定制漏洞检测器。
  • 通过建模全局状态依赖关系,支持状态依赖的利用构造,并生成可行的输入条件以触发漏洞利用。
  • TeeRex 集成约束求解与污点传播技术,识别触发内存破坏原原子操作的输入向量。
  • 它生成详细的漏洞报告,并通过自动生成触发可利用条件的输入,促进 PoC 利用代码的开发。

实验结果

研究问题

  • RQ1在真实世界的 SGX enclave 二进制代码中,内存破坏漏洞的普遍存在程度如何,特别是使用 Intel SGX SDK 开发的 enclave?
  • RQ2考虑到 SGX enclave 二进制代码独特的执行模型和隔离语义,符号执行能否有效适应以检测内存破坏漏洞?
  • RQ3常见的编程模式和遗留代码移植实践如何在主机与 enclave 接口处引入可利用缺陷?
  • RQ4自动化框架是否不仅能检测漏洞,还能协助构建已发现漏洞的 PoC 利用代码?
  • RQ5SGX enclave 中最普遍的漏洞模式是什么,它们如何影响可信执行环境(TEE)的安全保证?

主要发现

  • TeeRex 在多个公开的 SGX enclave 中发现了可利用的内存破坏漏洞,包括来自 Intel、百度、WolfSSL 以及 Synaptics 和 Goodix 的生物识别指纹软件的 enclave。
  • 这些漏洞主要出现在主机与 enclave 的边界处,由于未对不受信任的输入进行充分验证,导致任意内存写入和控制流劫持。
  • 许多发现的缺陷源于后期移植的遗留代码或对 Intel SGX SDK 的误用,而该 SDK 缺乏内置的输入验证机制。
  • 该框架成功为所有识别出的漏洞构建了概念性证明(PoC)利用,证实了其实际可利用性以及完全破坏 enclave 的潜在风险。
  • 漏洞的根本原因揭示出重复出现的模式,例如未检查的函数指针操作和对来自不受信任源的数据指针处理不当。
  • 研究结果表明,类似漏洞很可能存在于私有部署的 enclave 中,凸显了 SGX 部署实践中存在的关键安全缺口。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。