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

使用语言模型检测流行编程语言中的漏洞

Vulnerability Detection in Popular Programming Languages with Language Models

Syafiq Al Atiiq, Christian Gehrmann, Kevin Dahlén

AI总结:

本文研究了语言模型在JavaScript、Java、Python、PHP、Go和C/C++等流行编程语言中的漏洞检测有效性,发现JavaScript表现最佳,且代码复杂性与检测性能仅存在弱相关性。

摘要:

漏洞检测对于维护软件安全至关重要,最近的研究探索了使用语言模型(LMs)来完成这项任务。尽管语言模型展现出了一定的前景,但其在不同数据集上的表现并不一致,特别是在泛化到未见过的代码时。此外,大多数研究集中在C/C++编程语言上,对其他流行语言的关注有限。本文通过研究语言模型在JavaScript、Java、Python、PHP和Go中进行漏洞检测的有效性来填补这一空白,同时以C/C++作为对比。我们利用CVEFixes数据集创建了一个多样化的特定语言漏洞集合,并对数据进行预处理以确保质量和完整性。我们在选定的语言上微调并评估了最先进的语言模型,发现漏洞检测的性能存在显著差异。JavaScript表现出最佳性能,与C/C++相比具有更好且更实用的检测能力。我们还检查了这六种语言中代码复杂性与检测性能之间的关系,发现代码复杂性指标与模型的F1分数之间仅存在弱相关性。

英文摘要:

Vulnerability detection is crucial for maintaining software security, and recent research has explored the use of Language Models (LMs) for this task. While LMs have shown promising results, their performance has been inconsistent across datasets, particularly when generalizing to unseen code. Moreover, most studies have focused on the C/C++ programming language, with limited attention given to other popular languages. This paper addresses this gap by investigating the effectiveness of LMs for vulnerability detection in JavaScript, Java, Python, PHP, and Go, in addition to C/C++ for comparison. We utilize the CVEFixes dataset to create a diverse collection of language-specific vulnerabilities and preprocess the data to ensure quality and integrity. We fine-tune and evaluate state-of-the-art LMs across the selected languages and find that the performance of vulnerability detection varies significantly. JavaScript exhibits the best performance, with considerably better and more practical detection capabilities compared to C/C++. We also examine the relationship between code complexity and detection performance across the six languages and find only a weak correlation between code complexity metrics and the models' F1 scores.

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

↑