在代码属性图中表示LLVM-IR
Representing LLVM-IR in a Code Property Graph
摘要:
在过去的几年中,已经提出了一些静态的应用程序安全测试工具,利用所谓的代码属性图,一个图形模型,保持丰富的信息源代码,同时使其用户能够编写语言无关的分析。然而,它们有几个缺点。它们主要处理源代码,如果第三方依赖关系仅作为编译后的二进制文件可用,则排除对第三方依赖关系的分析。此外,它们的分析仅限于是否支持单个程序设计语言。虽然经常支持成熟的语言,如C/C++或Java,但由于语言设计的不断变化,仍在不断发展的语言,如Rust,没有考虑。为了克服这些限制,我们扩展了代码属性图的开源实现,以支持LLVM-IR,它可以被许多编译器和二进制提升器用作输出。在本文中,我们将讨论如何解决将中间表示的概念映射到CPG时出现的挑战。同时,我们优化得到的图是最小的,接近等价源代码的表示。我们的评估表明,现有的分析可以重复使用,无需修改,性能要求是可比的源代码上运行。这使得该方法适用于大型项目的分析。
英文摘要:
In the past years, a number of static application security testing tools have been proposed which make use of so-called code property graphs, a graph model which keeps rich information about the source code while enabling its user to write language-agnostic analyses. However, they suffer from several shortcomings. They work mostly on source code and exclude the analysis of third-party dependencies if they are only available as compiled binaries. Furthermore, they are limited in their analysis to whether an individual programming language is supported or not. While often support for well-established languages such as C/C++ or Java is included, languages that are still heavily evolving, such as Rust, are not considered because of the constant changes in the language design. To overcome these limitations, we extend an open source implementation of a code property graph to support LLVM-IR which can be used as output by many compilers and binary lifters. In this paper, we discuss how we address challenges that arise when mapping concepts of an intermediate representation to a CPG. At the same time, we optimize the resulting graph to be minimal and close to the representation of equivalent source code. Our evaluation indicates that existing analyses can be reused without modifications and that the performance requirements are comparable to operating on source code. This makes the approach suitable for an analysis of large-scale projects.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。