跳到正文
arXiv cs.AI· Marius Momeu, Koushik Sen·· 1 小时前精选AI 评分71

LLM 智能体审计 Rust 安全接口,Crustify 在 16 个 crate 中发现 225 个未定义行为 bug

Agentic Discovery of Soundness Bugs in Safe Rust Bindings

AI 导读

论文提出用 LLM 智能体作为 Rust 安全接口的审计员,定义了未定义行为、偏离被封装库、不完整 unsafe 契约三类缺陷分类,并用 Claude Opus 5.5 与 DeepSeek V4.1 Flash 实测,发现开放模型在同等奖励下以四分之一成本找到同样多的缺陷。

推荐理由

论文给出 LLM 智能体审计 Rust 安全接口的缺陷分类与实测数据,并开源了 Crustify 系统,可评估用开放模型低成本找 bug 的可行性。

正文 · 原文

View PDF HTML (experimental)

Abstract:Rust crates confine unsafe code, such as calls into C or C++ libraries or system calls, behind safe interfaces that must uphold Rust's invariants. If an interface encodes one rule of the code beneath it too weakly, a program written in purely safe Rust can cause undefined behavior. Static analyzers and fuzzers are bound to fixed patterns or to the paths they execute. We propose LLM agents as auditors of these interfaces, and study how well they do it.
We first define a taxonomy of the defects of such interfaces, including undefined behavior, divergences from the wrapped library, and incomplete unsafe contracts. We then measure, in repeated audits of a real-world crate by a closed and an open model, Claude Opus 5.5 and DeepSeek V4.1 Flash, which defect classes agents find, how well they triage them, and what makes them find more. Agents find the first two classes unprompted, but find few incomplete contracts even when asked. Their findings are almost always real, even without an independent reviewer, yet they lack triage discipline: they seldom confirm with a sanitizer, and they stop early. With the same guidance, the open model finds as many defects as the closed one at a quarter of the cost.
We integrate these insights in Crustify, an agentic system for automating C-to-Rust tasks, and run it at scale. In 16 widely used crates, including the bindings to the C libraries OpenSSL, SQLite, libgit2, and libcurl and to the C++ engine V8, Crustify found 225 undefined-behavior bugs, 23 behavioral divergences, and 36 incomplete unsafe contracts, between 3 and 61 per crate at a median cost under $50 per audit. In the Linux kernel's Rust abstractions, it found 11 more undefined-behavior bugs and 4 incomplete contracts. Maintainers have fixed 26 of the 83 findings that we reported.
Subjects: Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI); Programming Languages (cs.PL); Software Engineering (cs.SE)
Cite as: arXiv:2611.31813 [cs.CR]
  (or arXiv:2611.31813v1 [cs.CR] for this version)
  https://doi.org/10.48550/arXiv.2611.31813

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Marius Momeu [view email]
[v1] Tue, 24 Nov 2026 02:06:23 UTC (46 KB)

来源:arXiv cs.AI · arxiv.org