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

CLNX:为C/C++漏洞贡献提交识别搭建代码与自然语言的桥梁

CLNX: Bridging Code and Natural Language for C/C++ Vulnerability-Contributing Commits Identification

School of Cyber Science and Engineering, Huazhong University of Science and Technology(华中科技大学网络空间科学与工程学院);Hubei Key Laboratory of Distributed System Security(湖北省分布式系统安全重点实验室);Hubei Engineering Research Center on Big Data Security(湖北省大数据安全工程研究中心)

Zeqing Qin, Yiwei Wu, Lansheng Han

AI总结:

针对现有大模型识别C/C++漏洞贡献提交依赖高资源预训练的问题,提出轻量框架CLNX,通过结构与词元层面的代码自然化处理增强BERT类模型能力,在公开数据集上取得显著提升,搭载CLNX的CodeBERT达SOTA并在真实场景识别出38个OSS漏洞。

摘要:

大语言模型(LLMs)在漏洞识别领域展现出巨大潜力。过去十年间,C/C++语言相关漏洞占开源软件(OSS)漏洞总数的一半,且OSS的更新主要通过提交(commit)完成,因此提升LLMs识别C/C++漏洞贡献提交(VCCs)的能力至关重要。但现有研究主要聚焦于在海量代码数据集上对LLMs进行进一步预训练,这种方式资源消耗大且存在效率难题。本文以轻量方式增强基于BERT的LLMs识别C/C++ VCCs的能力,提出CodeLinguaNexus(CLNX)作为促进C/C++程序与LLMs交互的桥梁。CLNX基于提交信息,在保留关键细节的同时,高效将源代码转换为更自然的表示形式。具体而言,CLNX首先进行结构层面的自然化处理以分解复杂程序,随后进行词元层面的自然化处理以解读复杂符号。我们在包含25872个C/C++函数及其对应提交的公开数据集上评估CLNX,结果显示CLNX显著提升了LLMs识别C/C++ VCCs的性能。此外,搭载CLNX的CodeBERT取得了新的最优(state-of-the-art)效果,并在真实场景中识别出38个OSS漏洞。

英文摘要:

Large Language Models (LLMs) have shown great promise in vulnerability identification. As C/C++ comprises half of the Open-Source Software (OSS) vulnerabilities over the past decade and updates in OSS mainly occur through commits, enhancing LLMs' ability to identify C/C++ Vulnerability-Contributing Commits (VCCs) is essential. However, current studies primarily focus on further pre-training LLMs on massive code datasets, which is resource-intensive and poses efficiency challenges. In this paper, we enhance the ability of BERT-based LLMs to identify C/C++ VCCs in a lightweight manner. We propose CodeLinguaNexus (CLNX) as a bridge facilitating communication between C/C++ programs and LLMs. Based on commits, CLNX efficiently converts the source code into a more natural representation while preserving key details. Specifically, CLNX first applies structure-level naturalization to decompose complex programs, followed by token-level naturalization to interpret complex symbols. We evaluate CLNX on public datasets of 25,872 C/C++ functions with their commits. The results show that CLNX significantly enhances the performance of LLMs on identifying C/C++ VCCs. Moreover, CLNX-equipped CodeBERT achieves new state-of-the-art and identifies 38 OSS vulnerabilities in the real world.

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

↑