ZeroFalse:利用大语言模型提升静态分析的精确率
ZeroFalse: Improving Precision in Static Analysis with LLMs
AI总结:
针对静态应用安全测试工具误报过多的问题,提出结合静态分析与大语言模型的ZeroFalse框架,通过补充流敏感追踪等信息交由LLM判定,在基准和真实项目中实现90%以上的精确率与召回率,可有效提升SAST可靠性。
摘要:
静态应用安全测试(SAST)工具是现代软件开发不可或缺的组成部分,但其推广应用受到误报过多的制约——误报不仅会削弱开发者的信任,还需要耗费高昂成本进行人工分类排查。我们提出ZeroFalse框架,该框架将静态分析与大语言模型(LLMs)相结合,在保留检测覆盖率的同时减少误报。ZeroFalse将静态分析器的输出视为结构化契约,在交由LLM判定之前,为其补充流敏感追踪信息、上下文证据以及特定于CWE(通用缺陷枚举)的知识。这种设计既保留了静态分析的系统性覆盖范围,又能充分利用LLM的推理能力。我们使用10个当前最先进的LLM,在基准测试集和真实项目中对ZeroFalse进行了评估。表现最优的模型在OWASP Java Benchmark上取得了0.912的F1分数,在OpenVuln数据集上取得了0.955的F1分数,召回率和精确率均保持在90%以上。结果进一步表明,针对CWE定制的提示词效果始终优于通用提示词,且面向推理的LLM能提供最可靠的精确率-召回率平衡。这些发现表明ZeroFalse是一种实用且可扩展的方案,可提升SAST的可靠性,支持其集成到现实世界的CI/CD流水线中。
英文摘要:
Static Application Security Testing (SAST) tools are integral to modern software development, yet their adoption is undermined by excessive false positives that weaken developer trust and demand costly manual triage. We present ZeroFalse, a framework that integrates static analysis with large language models (LLMs) to reduce false positives while preserving coverage. ZeroFalse treats static analyzer outputs as structured contracts, enriching them with flow-sensitive traces, contextual evidence, and CWE-specific knowledge before adjudication by an LLM. This design preserves the systematic reach of static analysis while leveraging the reasoning capabilities of LLMs. We evaluate ZeroFalse across both benchmarks and real-world projects using ten state-of-the-art LLMs. Our best-performing models achieve F1-scores of 0.912 on the OWASP Java Benchmark and 0.955 on the OpenVuln dataset, maintaining recall and precision above 90%. Results further show that CWE-specialized prompting consistently outperforms generic prompts, and reasoning-oriented LLMs provide the most reliable precision-recall balance. These findings position ZeroFalse as a practical and scalable approach for enhancing the reliability of SAST and supporting its integration into real-world CI/CD pipelines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。