arXiv:2503.09002cs.SEcs.AI2025-03被引 50

用大模型自动生成检测漏洞的分析器,发现92个长期隐藏的系统级漏洞。

KNighter: Transforming Static Analysis with LLM-Synthesized Checkers

  • 基于历史补丁自动生成专用漏洞检测器,避免直接扫描全系统
  • 在Linux内核中发现92个新漏洞,平均潜伏4.3年,77个已确认
  • 适合安全研究者和系统开发者,可提升代码审查效率与可靠性

静态分析是检测操作系统内核等关键系统漏洞的强大技术,但设计和实现分析器耗时且受限于预定义漏洞模式。尽管大语言模型(LLMs)在静态分析方面展现潜力,但直接用于大规模系统扫描因计算开销和上下文限制而不可行。我们提出KNighter,首个通过历史漏洞模式自动生成静态分析器的方案。其核心思路是利用LLM根据历史补丁知识生成专用检测器,而非直接分析整个系统。该方法采用多阶段合成流程,通过原始补丁验证检查器正确性,并通过自动化迭代优化减少误报。在Linux内核上的评估表明,KNighter生成的检测器能发现现有手动编写分析器遗漏的多种漏洞模式。迄今已发现92个新漏洞,平均潜伏4.3年;其中77个已确认,57个已修复,30个获得CVE编号。本工作建立了基于检测器合成的可扩展、可靠且可追溯的LLM驱动静态分析新范式。

原文摘要 · Abstract (English)

Static analysis is a powerful technique for bug detection in critical systems like operating system kernels. However, designing and implementing static analyzers is challenging, time-consuming, and typically limited to predefined bug patterns. While large language models (LLMs) have shown promise for static analysis, directly applying them to scan large systems remains impractical due to computational constraints and contextual limitations. We present KNighter, the first approach that unlocks scalable LLM-based static analysis by automatically synthesizing static analyzers from historical bug patterns. Rather than using LLMs to directly analyze massive systems, our key insight is leveraging LLMs to generate specialized static analyzers guided by historical patch knowledge. KNighter implements this vision through a multi-stage synthesis pipeline that validates checker correctness against original patches and employs an automated refinement process to iteratively reduce false positives. Our evaluation on the Linux kernel demonstrates that KNighter generates high-precision checkers capable of detecting diverse bug patterns overlooked by existing human-written analyzers. To date, KNighter-synthesized checkers have discovered 92 new, critical, long-latent bugs (average 4.3 years) in the Linux kernel; 77 are confirmed, 57 fixed, and 30 have been assigned CVE numbers. This work establishes an entirely new paradigm for scalable, reliable, and traceable LLM-based static analysis for real-world systems via checker synthesis.

静态分析大模型应用漏洞检测Linux内核

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