arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.08417cs.SEcs.CR
收藏

基于多语言交叉过程上下文的漏洞检测:评估现代LLM的有效性与成本

Vulnerability Detection with Interprocedural Context in Multiple Languages: Assessing Effectiveness and Cost of Modern LLMs

North Carolina State University(北卡罗来纳州立大学);Federal University of Alagoas(阿拉戈斯联邦大学)

Kevin Lira, Baldoino Fonseca, Davy Baía, Márcio Ribeiro, Wesley K. G. Assunção

AI总结:

本文研究了多语言交叉过程依赖漏洞检测中四种现代LLM的有效性、推理成本及解释质量,发现Gemini 3 Flash在C语言中具有最佳成本效益,Claude Haiku 4.5在93.6%的案例中正确识别并解释漏洞。

摘要:

大型语言模型(LLMs)已成为自动化漏洞检测的有前景方法。然而,大多数先前研究仅探索了LLMs在单个函数内检测漏洞,忽略了与交叉过程依赖相关的漏洞。这些研究忽略了跨越多个函数的数据和控制流中出现的漏洞。因此,利用调用者和被调用者的上下文可能有助于识别漏洞。本研究实证地探讨了四种现代LLM(Claude Haiku 4.5、GPT-4.1 Mini、GPT-5 Mini和Gemini 3 Flash)在检测交叉过程依赖漏洞中的有效性、推理成本和解释质量。为此,我们对ReposVul数据集中的509个漏洞进行了实证研究,系统地变化交叉过程上下文的级别(目标函数代码-only、目标函数+调用者、目标函数+被调用者),并评估四种现代LLM在C、C++和Python中的表现。结果表明,Gemini 3 Flash在C漏洞中提供了最佳的成本效益权衡,达到F1 >= 0.978,估计成本为每配置0.50-0.58美元,而Claude Haiku 4.5在93.6%的评估案例中正确识别并解释了漏洞。总体而言,这些发现对设计能够跨多种编程语言代码库通用的AI辅助安全分析工具具有直接的启示。

英文摘要:

Large Language Models (LLMs) have been a promising way for automated vulnerability detection. However, most prior studies have explored the use of LLMs to detect vulnerabilities only within single functions, disregarding those related to interprocedural dependencies. These studies overlook vulnerabilities that arise from data and control flows that span multiple functions. Thus, leveraging the context provided by callers and callees may help identify vulnerabilities. This study empirically investigates the effectiveness of detection, the inference cost, and the quality of explanations of four modern LLMs (Claude Haiku 4.5, GPT-4.1 Mini, GPT-5 Mini, and Gemini 3 Flash) in detecting vulnerabilities related to interprocedural dependencies. To do that, we conducted an empirical study on 509 vulnerabilities from the ReposVul dataset, systematically varying the level of interprocedural context (target function code-only, target function + callers, and target function + callees) and evaluating the four modern LLMs across C, C++, and Python. The results show that Gemini 3 Flash offers the best cost-effectiveness trade-off for C vulnerabilities, achieving F1 >= 0.978 at an estimated cost of $0.50-$0.58 per configuration, and Claude Haiku 4.5 correctly identified and explained the vulnerability in 93.6% of the evaluated cases. Overall, the findings have direct implications for the design of AI-assisted security analysis tools that can generalize across codebases in multiple programming languages.

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

↑