[论文解读] Binary Debloating for Security via Demand Driven Loading
该论文提出 BlankIt,一种基于二进制的、按需加载机制,通过使用输入感知的决策树预测器,仅在每个调用点动态加载所需函数,从而减少 C/C++ 库的攻击面。该方法在仅 18% 的平均运行时开销下,实现了 97.2% 的库代码暴露减少和 97.9% 的 ROP 小工具减少,有效削弱了控制流劫持攻击,且无需重新编译。
Modern software systems heavily use C/C++ based libraries. Because of the weak memory model of C/C++, libraries may suffer from vulnerabilities which can expose the applications to potential attacks. For example, a very large number of return oriented programming gadgets exist in glibc that allow stitching together semantically valid but malicious Turing-complete programs. In spite of significant advances in attack detection and mitigation, full defense is unrealistic against an ever-growing set of possibilities for generating such malicious programs. In this work, we create a defense mechanism by debloating libraries to reduce the dynamic functions linked so that the possibilities of constructing malicious programs diminishes significantly. The key idea is to locate each library call site within an application, and in each case to load only the set of library functions that will be used at that call site. This approach of demand-driven loading relies on an input-aware oracle that predicts a near-exact set of library functions needed at a given call site during the execution. The predicted functions are loaded just in time, and the complete call chain (of function bodies) inside the library is purged after returning from the library call back into the application. We present a decision-tree based predictor, which acts as an oracle, and an optimized runtime system, which works directly with library binaries like GNU libc and libstdc++. We show that on average, the proposed scheme cuts the exposed code surface of libraries by 97.2%, reduces ROP gadgets present in linked libraries by 97.9%, achieves a prediction accuracy in most cases of at least 97%, and adds a small runtime overhead of 18% on all libraries (16% for glibc, 2% for others) across all benchmarks of SPEC 2006, suggesting this scheme is practical.
研究动机与目标
- 为解决臃肿的 C/C++ 库(尤其是 glibc)带来的持续安全风险,这些库暴露了大量 ROP 小工具。
- 通过在运行时最小化动态加载的函数数量,减少链接库的攻击面。
- 开发一种实用的、基于二进制的防御机制,无需库的源代码或重新编译。
- 缓解传统 CFI 和 CPI 机制无法防御的高级控制流劫持攻击,如 ROP 和 JOP。
- 检测并防止 CFI 和 CPI 无法防御的非控制数据攻击。
提出的方法
- 系统使用反向支配边界静态识别调用点与库函数之间的控制依赖关系。
- 基于决策树的预测器根据输入特定行为,预测每个调用点所需的精确库函数集合。
- 在运行时,仅将预测的函数加载到内存中,而将其他所有函数从库的动态代码空间中清除。
- 运行时系统直接在二进制库(如 glibc、libstdc++)上运行,无需源代码或重新编译。
- 每次库调用返回后,整个调用链将从内存中清除,以防止已加载函数的重复使用。
- 通过优化的二进制插桩,将该方法无缝集成到应用程序的执行流程中,性能影响极小。
实验结果
研究问题
- RQ1按需加载机制能否显著减少 C/C++ 库中动态链接函数和 ROP 小工具的数量?
- RQ2输入感知的预测器能否以高准确率预测每个调用点所需的精确库函数集合?
- RQ3此类机制能否在不需库的源代码或重新编译的情况下减少攻击面?
- RQ4该方法是否对绕过 CFI 和 CPI 的高级攻击(如 ROP、JOP 和非控制数据攻击)依然有效?
- RQ5此类系统在真实工作负载中的运行时性能开销是多少?
主要发现
- 所提出的 BlankIt 系统在 SPEC2006 基准测试中,将链接库的平均暴露代码面减少了 97.2%。
- 链接库中的 ROP 小工具数量平均减少了 97.9%,显著削弱了控制流劫持能力。
- 决策树预测器在大多数情况下实现了至少 97% 的预测准确率,确保了极少的误报漏报。
- 所有 SPEC2006 基准测试的平均运行时开销为 18%,其中 glibc 仅 16%,其他库仅为 2%,表明其具备实用性。
- BlankIt 有效缓解了绕过 CFI 和 CPI 的攻击,包括非控制数据攻击和控制流弯曲(CFB)利用。
- 该系统完全在二进制级别运行,无需重新编译任何链接二进制文件,可部署于遗留软件。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。