论文标题
一种基于单位的符号执行方法,用于检测可执行代码中的内存损坏漏洞
A unit-based symbolic execution method for detecting memory corruption vulnerabilities in executable codes
论文作者
论文摘要
内存腐败是一类严重的软件漏洞,在被剥削并损害系统用户之前,需要从应用程序中检测和删除仔细的注意力。符号执行是一种众所周知的方法,用于分析程序和检测各种漏洞,例如内存腐败。尽管从理论上讲,这种方法是合理的且完整的,但是当应用于现实世界复杂程序时,它面临着一些挑战,例如路径爆炸。在本文中,我们提出了一种提高符号执行效率的方法,并在可执行的代码中检测四类内存损坏漏洞,即基于堆的缓冲区溢出,基于堆栈的基于堆栈的缓冲区溢出,无效的使用和双倍的使用。我们仅在测试单元而不是整个程序上执行符号执行,以避免路径爆炸。在我们的方法中,测试单元被视为程序代码的一部分,该单元可能包含脆弱的语句,并根据内存损坏漏洞的规格进行静态识别。然后,每个测试单元均由象征性执行,以计算单元的每个语句的路径和漏洞约束,这分别确定单位输入数据的条件分别用于执行该语句或激活其中的漏洞。解决这些约束为我们提供了测试单元的输入值,该单元执行所需的陈述并揭示其中的漏洞。最后,我们使用机器学习来近似系统和单元输入数据之间的相关性。因此,我们生成输入程序的系统输入,在所需的测试单元中获取脆弱的说明,并在其中揭示漏洞。此方法是作为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 avoid 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.