跳到正文
arXiv (AI + Vision + Imaging)· Marius Momeu, Koushik Sen·· 1 天前AI 评分20

LLM智能体审计Rust安全绑定:Crustify在16个crate中发现225个未定义行为缺陷

Agentic Discovery of Soundness Bugs in Safe Rust Bindings

AI 导读

Claude Opus 5.5与DeepSeek V4.1 Flash被用于审计Rust安全绑定接口,智能体无需提示即可发现未定义行为与偏离封装库两类缺陷,但很少发现不完整unsafe契约,且缺乏分诊纪律、很少用sanitizer确认。

正文 · 原文

arXiv:2611.31813v1 Announce Type: cross 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.

来源:arXiv (AI + Vision + Imaging) · arxiv.org