




















Authors:Yiheng Cao, Yihao Chen, Xin Hu, Bihuan Chen, Jiayi Deng, Zhuotong Zhou, Susheng Wu, Yiheng Huang, Xueying Du, Xingman Chen, Miaohua Li, Xin Peng
Abstract:Detecting vulnerabilities in source code remains critical yet challenging, as conventional static analysis tools construct inaccurate program representations, while existing LLM-based approaches often miss essential vulnerability context and lack grounded reasoning. In this paper, we introduce VulWeaver, a novel LLM-based approach that weaves broken program semantics into accurate representations and extracts holistic vulnerability context for grounded vulnerability detection. VulWeaver first constructs an enhanced unified dependency graph (UDG) by integrating deterministic rules with LLM-based semantic inference to address static analysis inaccuracies. It then extracts holistic vulnerability context by combining explicit contexts from program slicing with implicit contexts, including usage, definition, and declaration information. Finally, VulWeaver employs meta-prompting with vulnerability type specific expert guidelines to steer LLMs through systematic reasoning, aggregated via majority voting for robustness. Extensive experiments on PrimeVul4J dataset show that VulWeaver achieves a precision of 0.82, recall of 0.71, and F1-score of 0.76, outperforming state-of-the-art learning-based, LLM-based, and agent-based baselines by 25%, 17%, and 21% in F1-score, respectively. Notably, VulWeaver attains a VP-S score of 0.58, 164% higher than the best baseline, confirming its strong discriminative power in distinguishing vulnerable code from patched counterparts. VulWeaver also demonstrates cross-language generalizability on the C/C++ PrimeVul dataset with minimal adaptation, achieving an F1-score of 0.78. For practical usefulness, VulWeaver detected 26 true vulnerabilities across 9 real-world Java projects, with 15 confirmed by developers and 5 CVE identifiers assigned. In industrial deployment, VulWeaver identified 40 confirmed vulnerabilities in an internal repository.
From: Yiheng Cao [view email]
[v1]
Sun, 12 Apr 2026 18:31:46 UTC (458 KB)
[v2]
Wed, 15 Jul 2026 11:03:35 UTC (527 KB)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。