二进制代码中未初始化堆栈变量的静态检测
Static Detection of Uninitialized Stack Variables in Binary Code
摘要:
在第一次堆栈粉碎攻击发生二十多年后,利用堆栈异常的内存损坏漏洞仍然普遍存在,并在实践中发挥着重要作用。在这些漏洞中,未初始化的变量由于其令人不快的不可预测性而发挥着特殊的作用:由于编译器被定制为快速操作,因此在实践中不使用昂贵的过程间分析程序来检测此类漏洞。因此,暴露未初始化内存读取的复杂关系在二进制代码中仍然未被发现。最近的漏洞报告显示了在实践中如何利用未初始化内存读取的多功能性,特别是对于内存泄漏和代码执行。近年来的研究提出了针对源代码的检测和预防技术。然而,到目前为止,二进制可执行文件中的这些类型的软件错误还没有得到太多的关注。在本文中,我们提出了一个静态分析框架,发现未初始化的变量在二进制可执行文件。我们开发了将二进制文件提升为知识表示的方法,该方法为专门设计的检测未初始化读取的算法奠定了基础。我们的原型实现是能够检测未初始化的内存错误在复杂的二进制文件,如Web浏览器和操作系统内核,我们检测到7个新的错误。
英文摘要:
More than two decades after the first stack smashing attacks, memory corruption vulnerabilities utilizing stack anomalies are still prevalent and play an important role in practice. Among such vulnerabilities, uninitialized variables play an exceptional role due to their unpleasant property of unpredictability: as compilers are tailored to operate fast, costly interprocedural analysis procedures are not used in practice to detect such vulnerabilities. As a result, complex relationships that expose uninitialized memory reads remain undiscovered in binary code. Recent vulnerability reports show the versatility on how uninitialized memory reads are utilized in practice, especially for memory disclosure and code execution. Research in recent years proposed detection and prevention techniques tailored to source code. To date, however, there has not been much attention for these types of software bugs within binary executables. In this paper, we present a static analysis framework to find uninitialized variables in binary executables. We developed methods to lift the binaries into a knowledge representation which builds the base for specifically crafted algorithms to detect uninitialized reads. Our prototype implementation is capable of detecting uninitialized memory errors in complex binaries such as web browsers and OS kernels, and we detected 7 novel bugs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。