面向自动化应用程序专用软件栈
Towards Automated Application-Specific Software Stacks
摘要:
软件的复杂性近年来不断增加。在开发过程中解决这种复杂性的一种常见方法是将功能封装到共享库中。这允许开发人员重用已经实现的功能,而不是一遍又一遍地重新实现它们。然而,并不是共享库提供的所有功能都被应用程序实际使用。因此,使用共享库的应用程序会将未使用的代码加载到内存中,攻击者可以使用这些代码来执行代码重用和类似类型的攻击。同样的情况也适用于用脚本语言(如PHP或Ruby)编写的应用程序:解释器通常提供比应用程序实际需要的更多的功能,因此提供了更大的整体攻击面。在本文中,我们解决这个问题,并提出了第一步自动化的应用程序特定的软件栈。我们提出了一个编译器扩展,能够从共享库中删除不需要的代码-在领域知识的帮助下-也能够在编译过程中从解释器的代码库中删除未使用的功能。我们对一组不同的实际应用程序进行了评估,其中包括Nginx,Lighttpd和PHP解释器,平均删除了musl-libc(一种流行的libc实现)中71.3%的代码。对Web应用程序的评估表明,定制的PHP解释器可以减轻整个漏洞类,就像OpenConf一样。我们通过为Wordpress Web应用程序创建一个特定于应用程序的软件堆栈来展示我们的debloating方法的适用性:我们为Nginx Web服务器和PHP解释器定制libc库,而PHP解释器则为Wordpress Web应用程序定制。在这个真实场景中,libc的代码总共减少了65.1%,从而减少了代码重用攻击的可用代码。
英文摘要:
Software complexity has increased over the years. One common way to tackle this complexity during development is to encapsulate features into a shared library. This allows developers to reuse already implemented features instead of reimplementing them over and over again. However, not all features provided by a shared library are actually used by an application. As a result, an application using shared libraries loads unused code into memory, which an attacker can use to perform code-reuse and similar types of attacks. The same holds for applications written in a scripting language such as PHP or Ruby: The interpreter typically offers much more functionality than is actually required by the application and hence provides a larger overall attack surface. In this paper, we tackle this problem and propose a first step towards automated application-specific software stacks. We present a compiler extension capable of removing unneeded code from shared libraries and---with the help of domain knowledge---also capable of removing unused functionalities from an interpreter's code base during the compilation process. Our evaluation against a diverse set of real-world applications, among others Nginx, Lighttpd, and the PHP interpreter, removes on average 71.3% of the code in musl-libc, a popular libc implementation. The evaluation on web applications show that a tailored PHP interpreter can mitigate entire vulnerability classes, as is the case for OpenConf. We demonstrate the applicability of our debloating approach by creating an application-specific software stack for a Wordpress web application: we tailor the libc library to the Nginx web server and PHP interpreter, whereas the PHP interpreter is tailored to the Wordpress web application. In this real-world scenario, the code of the libc is decreased by 65.1% in total, thereby reducing the available code for code-reuse attacks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。