arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2210.04258cs.CRcs.SE
收藏

一种基于单元的符号执行方法,用于检测可执行代码中的内存损坏漏洞

A unit-based symbolic execution method for detecting memory corruption vulnerabilities in executable codes

Sara Baradaran, Mahdi Heidari, Ali Kamali, Maryam Mouzarani

AI总结:

本文提出一种基于单元的符号执行方法,通过仅对静态识别的测试单元执行符号执行并结合机器学习近似系统输入,有效缓解路径爆炸并检测四类内存损坏漏洞,在准确性和性能上优于同类工具。

摘要:

内存损坏是一类严重的软件漏洞,在被利用并危害系统用户之前,需要仔细关注以将其从应用程序中检测并移除。符号执行是一种著名的分析和检测程序中各种漏洞(如内存损坏)的方法。尽管该方法在理论上是可靠且完备的,但在应用于现实世界的复杂程序时,它面临一些挑战,例如路径爆炸。在本文中,我们提出了一种提高符号执行效率并检测可执行代码中四类内存损坏漏洞的方法,即基于堆的缓冲区溢出、基于栈的缓冲区溢出、释放后使用和双重释放。我们仅对测试单元而非整个程序执行符号执行,以降低路径爆炸的概率。在我们的方法中,测试单元被视为程序代码的一部分,可能包含漏洞语句,并基于内存损坏漏洞的规范进行静态识别。然后,对每个测试单元进行符号执行,以计算该单元每条语句的路径约束和漏洞约束,这些约束分别确定执行该语句或激活其中漏洞所需的单元输入数据条件。求解这些约束为我们提供了测试单元的输入值,这些输入值能够执行所需语句并揭示其中的漏洞。最后,我们使用机器学习来近似系统输入和单元输入之间的相关性。由此,我们生成进入程序、到达所需测试单元中的漏洞指令并揭示其中漏洞的系统输入。该方法被实现为 angr 框架的插件,并使用一组基准程序进行了评估。实验表明,它在准确性和性能上优于类似工具。

英文摘要:

Memory corruption is a serious class of software vulnerabilities, which requires careful attention to be detected and removed from applications before getting exploited and harming the system users. Symbolic execution is a well-known method for analyzing programs and detecting various vulnerabilities, e.g., memory corruption. Although this method is sound and complete in theory, it faces some challenges, such as path explosion, when applied to real-world complex programs. In this paper, we present a method for improving the efficiency of symbolic execution and detecting four classes of memory corruption vulnerabilities in executable codes, i.e., heap-based buffer overflow, stack-based buffer overflow, use-after-free, and double-free. We perform symbolic execution only on test units rather than the whole program to lower the chance of path explosion. In our method, test units are considered parts of the program's code, which might contain vulnerable statements and are statically identified based on the specifications of memory corruption vulnerabilities. Then, each test unit is symbolically executed to calculate path and vulnerability constraints of each statement of the unit, which determine the conditions on unit input data for executing that statement or activating vulnerabilities in it, respectively. Solving these constraints gives us input values for the test unit, which execute the desired statements and reveal vulnerabilities in them. Finally, we use machine learning to approximate the correlation between system and unit input data. Thereby, we generate system inputs that enter the program, reach vulnerable instructions in the desired test unit, and reveal vulnerabilities in them. This method is implemented as a plugin for angr framework and evaluated using a group of benchmark programs. The experiments show its superiority over similar tools in accuracy and performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑