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

用于漏洞检测的神经符号推理

Neuro-Symbolic Reasoning for Vulnerability Detection

Huazhong University of Science and Technology(华中科技大学);University of Alberta(阿尔伯塔大学);Macquarie University(麦考瑞大学)

Yanjie Zhao, Hongjie Chen, Li Lu, Zhou Yang, Xiao Cheng, Haoyu Wang

AI总结:

研究基于大语言模型的漏洞检测不可靠性,提出神经符号框架LeanGuard,通过将代码解释与安全义务判定分离,神经侧过滤事实,符号侧形式验证,证据感知裁决器权衡结果,在五个CWE类上实例化框架。

摘要:

询问大语言模型指针解引用是否安全,它常能给出似是而非的理由,但这不是证明。自动化漏洞检测需判定给定源代码操作是否会出现内存安全缺陷。本文追踪基于大语言模型的漏洞检测不可靠性根源,提出LeanGuard框架,将各行为分配给合适一方进行处理。

英文摘要:

Ask a large language model (LLM) whether a pointer dereference is safe, and it can often produce a plausible justification for ``yes''. The difficulty is that a fluent justification is not a proof. This gap is precisely where automated vulnerability detection lives: deciding, for a given operation in source code, whether a memory safety defect such as a null dereference, use-after-free, or double free can actually occur. We trace the unreliability of LLM-based vulnerability detection to a mechanism, the premature discharge of safety obligations, and argue that the remedy is not better prompting but a separation of roles: the component that interprets the code must not also be the one that decides a safety obligation is met. In this paper, we present LeanGuard, a neuro-symbolic framework that assigns each act to the side equipped for it. On the neural side, an LLM serves strictly as a semantic filter over candidate facts extracted from the abstract syntax tree (AST): it prunes spurious facts and keeps the real ones, but never discharges an obligation or decides the verdict on its own. On the symbolic side, the surviving facts are compiled into a verification model in Lean 4 (a formal proof assistant whose kernel accepts a conclusion only when it is formally proved), where every dangerous operation must be matched by a guard that provably covers it in scope; absent such a guard, the obligation stays open rather than being argued away. Because a function rarely arrives with full context, this symbolic model is necessarily partial: an unproved obligation is not yet a defect. An evidence-aware adjudicator therefore weighs the symbolic and neural verdicts by the quality of each. We instantiate the framework on five CWE classes to ask how far this division of labor can be pushed.

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

↑