arXiv:2410.07573cs.CRcs.CL2024-10EMNLP被引 16

用大模型检测PHP漏洞,首次实现有效样本提取与生成。

RealVul: Can We Detect Vulnerabilities in Web Applications with LLM?

  • 构建专用框架,通过归一化等技术提取关键漏洞特征。
  • 在180个真实项目上测试,显著提升漏洞识别准确率。
  • 适合安全研究者和开发者,用于自动化代码审计。

大语言模型(LLM)在软件漏洞检测中的潜力日益受到关注,但针对PHP语言的漏洞研究仍存在空白,且样本提取与处理困难,限制了模型对特定漏洞特征的学习。本文提出RealVul,首个面向PHP漏洞检测的基于LLM的框架。通过漏洞候选检测方法及归一化技术,有效分离潜在漏洞触发点,简化代码并去除冗余语义信息,使模型更聚焦于关键模式。同时,改进数据合成方法以缓解PHP漏洞样本不足问题。我们在180个真实PHP项目上,使用五种不同代码LLM进行评估,结果表明RealVul在检测效果和泛化能力上均优于现有方法,显著提升模型的漏洞识别性能。

原文摘要 · Abstract (English)

The latest advancements in large language models (LLMs) have sparked interest in their potential for software vulnerability detection. However, there is currently a lack of research specifically focused on vulnerabilities in the PHP language, and challenges in extracting samples and processing persist, hindering the model's ability to effectively capture the characteristics of specific vulnerabilities. In this paper, we present RealVul, the first LLM-based framework designed for PHP vulnerability detection, addressing these issues. By vulnerability candidate detection methods and employing techniques such as normalization, we can isolate potential vulnerability triggers while streamlining the code and eliminating unnecessary semantic information, enabling the model to better understand and learn from the generated vulnerability samples. We also address the issue of insufficient PHP vulnerability samples by improving data synthesis methods. To evaluate RealVul's performance, we conduct an extensive analysis using five distinct code LLMs on vulnerability data from 180 PHP projects. The results demonstrate a significant improvement in both effectiveness and generalization compared to existing methods, effectively boosting the vulnerability detection capabilities of these models.

漏洞检测大模型PHP安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。