NeuroLog: 可审计的推理——通过LLM事实、Datalog和SMT进行神经符号漏洞发现
NeuroLog: Reasoning You Can Audit -- Neuro-Symbolic Vulnerability Discovery via LLM Facts, Datalog, and SMT
AI总结:
提出NeuroLog流水线,结合LLM提取事实、Souffle规则组合和Z3后处理,实现无需构建的漏洞发现,并在多个真实项目中重新发现CVE级漏洞。
摘要:
C/C++源代码的漏洞发现要求分析人员在重量级静态分析器(需要在单个查询运行之前构建工作环境)和自由形式的LLM(可以轻松读取源代码,但在真实代码库中会编造细节并丢失跨函数数据流)之间做出选择。我们提出了NeuroLog,一个端到端的无需构建的流水线,为每一层分配其独特擅长的角色:LLM一次提取一个函数的类型化数据流事实;Souffle规则网格将这些事实组合成跨函数发现;Z3后处理过滤不可行的发现,并为每个幸存者生成SAT模型。为了超越纯静态推理,我们还融入了运行时证据:来自少量语料库种子的可能范围不变量以近乎零成本收紧SMT问题。第二个LLM代理读取每个SAT模型并编写一个Python程序,生成候选崩溃输入,由AddressSanitizer框架验证。结合静态窄化SMT(Saturn, Pinpoint)和Datalog与SMT(Formulog)是现有技术;本文的新颖之处在于基于LLM的事实库、无需构建的流水线,以及将SAT模型作为工件(用于崩溃合成)而非是/否判定。在stb、cJSON、libxml2、一个FFmpeg解复用器片段和curl 8.3.0上,NeuroLog端到端地重新发现了八个CVE级问题,包括CVSS-9.8的SOCKS5堆溢出CVE-2023-38545,每个都经过ASan确认。在libarchive HEAD上,我们在cpio读取器和XAR/WARC/7zip写入器中发现了五个内存安全错误(其中四个先前未报告);全部已向上游报告,多个修复已合并,其中cpio释放后使用在七小时内得到确认。在stb上提取耗时约37秒,成本0.005美元;崩溃合成通过两次LLM迭代将静态发现转化为102字节的stb_vorbis崩溃(无需模糊测试);来自三个Matroska种子的可能不变量过滤器消除了FFmpeg解复用器可行集中的13.2%。
英文摘要:
Vulnerability discovery on C/C++ source asks the analyst to choose between heavyweight static analysers, which need a working build before a single query runs, and free-form LLMs, which read source readily but invent details and lose track of cross-function dataflow on real codebases. We present NeuroLog, an end-to-end build-free pipeline that assigns each layer the role it is uniquely good at: an LLM extracts typed dataflow facts one function at a time; a Souffle rule mesh composes those facts into cross-function findings; a Z3 post-pass filters infeasible findings and emits a SAT model for each survivor. To go beyond pure static reasoning we also fold in runtime evidence: likely range invariants from a handful of corpus seeds tighten the SMT problem at near-zero cost. A second LLM agent reads each SAT model and writes a Python program that produces a candidate crashing input, validated by an AddressSanitizer harness. Combining static-narrowing-SMT (Saturn, Pinpoint) and Datalog-with-SMT (Formulog) is prior art; new here are an LLM-derived fact base, a no-build pipeline, and the SAT model as an artifact (input to crash synthesis) rather than a yes/no verdict. Across stb, cJSON, libxml2, an FFmpeg demuxer slice, and curl 8.3.0, NeuroLog re-discovers eight CVE-class issues end-to-end, including the CVSS-9.8 SOCKS5 heap overflow CVE-2023-38545, each ASan-confirmed. On libarchive HEAD we surface five memory-safety bugs (four previously unreported) across the cpio reader and the XAR/WARC/7zip writers; all filed upstream, several fixes merged, with the cpio use-after-free acknowledged in seven hours. Extraction takes ~37 s and $0.005 on stb; crash synthesis turned a static finding into a 102-byte stb_vorbis crash in two LLM iterations (no fuzzer); a likely-invariant filter from three Matroska seeds eliminates 13.2% of the FFmpeg-demuxer feasible set.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。