结合静态分析与机器学习预测的应用瘦身方法
Combined Static Analysis and Machine Learning Prediction for Application Debloating
AI总结:
本文提出结合静态保证与机器学习预测的软件瘦身框架 PDSG,在保证可靠性的同时显著缩减攻击面,并在 SPEC CPU 2017 上平均减少 82.5% 的 gadget,运行时开销仅为 8.9%。
摘要:
软件瘦身能够通过缩小攻击面来打断 gadget 链,从而有效阻止某些代码重用攻击。基于静态分析的方法利用调用图的静态性质,得到一个调用点在执行时可到达的精简函数集合。这种方法运行时开销低,但函数集合的计算较为保守,对缩减效果产生不利影响。相比之下,基于机器学习(ML)的方法精度更高,能够大幅缩减函数集合,从而显著改善攻击面。然而,基于 ML 的方法会出现误预测。误预测会带来开销,更糟糕的是,目前没有明确的方法区分误预测与真实攻击。\n在本文中,我们认为一种在运行时结合 ML 预测的软件瘦身方法在整个应用场景中是现实可行的,并且能够实现超越现有技术的显著攻击面缩减。我们开发了一个框架,称为带静态保证的预测式瘦身(Predictive Debloat with Static Guarantees,PDSG)。PDSG 是完全可靠的,并且作用于应用源代码。在运行时,它预测从某个调用点出发的动态被调用者集合,并且为了解决误预测问题,它采用一种基于调用链静态不变量的轻量级审计机制。我们离线推导这些不变量,并断言在发生误预测时它们在运行时成立。据我们所知,在 SPEC CPU 2017 上,与同类技术相比,该方法实现了最高的 gadget 缩减率,平均减少了 82.5% 的总 gadget 数量。它在运行时仅对总预测调用中的 3.8% 触发误预测检查,并利用 Datalog 验证动态调用序列是否符合静态调用关系。其开销为 8.9%,这使得该方案在实际部署中具有吸引力。
英文摘要:
Software debloating can effectively thwart certain code reuse attacks by reducing attack surfaces to break gadget chains. Approaches based on static analysis enable a reduced set of functions reachable at a callsite for execution by leveraging static properties of the callgraph. This achieves low runtime overhead, but the function set is conservatively computed, negatively affecting reduction. In contrast, approaches based on machine learning (ML) have much better precision and can sharply reduce function sets, leading to significant improvement in attack surface. Nevertheless, mispredictions occur in ML-based approaches. These cause overheads, and worse, there is no clear way to distinguish between mispredictions and actual attacks. In this work, we contend that a software debloating approach that incorporates ML-based predictions at runtime is realistic in a whole application setting, and that it can achieve significant attack surface reductions beyond the state of the art. We develop a framework, Predictive Debloat with Static Guarantees (PDSG). PDSG is fully sound and works on application source code. At runtime it predicts the dynamic callee set emanating from a callsite, and to resolve mispredictions, it employs a lightweight audit based on static invariants of call chains. We deduce the invariants offline and assert that they hold at runtime when there is a misprediction. To the best of our knowledge, it achieves the highest gadget reductions among similar techniques on SPEC CPU 2017, reducing 82.5% of the total gadgets on average. It triggers misprediction checks on only 3.8% of the total predictions invoked at runtime, and it leverages Datalog to verify dynamic call sequences conform to the static call relations. It has an overhead of 8.9%, which makes the scheme attractive for practical deployments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。