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

Patch2QL:通过自动生成的静态分析规则发现开源软件供应链中的同源缺陷

Patch2QL: Discover Cognate Defects in Open Source Software Supply Chain With Auto-generated Static Analysis Rules

Fuwei Wang, Yongzhi Liu, Zhiqiang Dong

AI总结:

针对开源软件供应链中同源缺陷检测难的问题,提出Patch2QL技术,通过自动生成SAST规则检测同源缺陷,在上游和下游项目中均发现大量安全问题,效果优于通用方法。

摘要:

在开源软件(OSS)生态系统中存在复杂的软件供应链,上下游开发者广泛借用和复用代码,这导致反复出现的缺陷、修复遗漏和传播问题大量发生。这些问题被统称为同源缺陷,其规模和威胁尚未得到广泛关注与系统研究。软件成分分析和代码克隆检测方法无法覆盖供应链场景下的各类变体问题,而代码静态分析,即静态应用安全测试(SAST)技术则难以针对特定缺陷。本文提出了一种通过自动生成SAST规则来检测开源软件中同源缺陷的新技术。具体而言,该技术通过结构比对以及控制流到数据流的分析,从代码补丁前后的版本中提取关键语法和语义信息,并生成匹配这些关键要素的规则。我们实现了名为Patch2QL的原型工具,并将其应用于C/C++语言的基础开源软件。实验中,我们在最热门的上游软件中发现了7个中等到严重级别的新漏洞,以及大量潜在安全问题。在分析供应链中的下游项目时,我们发现了数量可观的典型同源缺陷,明确了这一问题带来的威胁。此外,与通用SAST和基于特征码的机制相比,生成的规则在发现同源缺陷的所有变体方面表现更优。

英文摘要:

In the open source software (OSS) ecosystem, there exists a complex software supply chain, where developers upstream and downstream widely borrow and reuse code. This results in the widespread occurrence of recurring defects, missing fixes, and propagation issues. These are collectively referred to as cognate defects, and their scale and threats have not received extensive attention and systematic research. Software composition analysis and code clone detection methods are unable to cover the various variant issues in the supply chain scenario, while code static analysis, or static application security testing (SAST) techniques struggle to target specific defects. In this paper, we propose a novel technique for detecting cognate defects in OSS through the automatic generation of SAST rules. Specifically, it extracts key syntax and semantic information from pre- and post-patch versions of code through structural comparison and control flow to data flow analysis, and generates rules that matches these key elements. We have implemented a prototype tool called Patch2QL and applied it to fundamental OSS in C/C++. In experiments, we discovered 7 new vulnerabilities with medium to critical severity in the most popular upstream software, as well as numerous potential security issues. When analyzing downstream projects in the supply chain, we found a significant number of representative cognate defects, clarifying the threat posed by this issue. Additionally, compared to general-purpose SAST and signature-based mechanisms, the generated rules perform better at discover all variants of cognate defects.

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

↑