Cybersecurity

Claude found dozens of soundness bugs in rustc: what LLMs teach us about hunting logic bugs

On December 2, Anthropic's Frontier Red Team published research on finding logic bugs with LLMs. Plain agentic code review beat fuzzing and symbolic execution, and the approach surfaced new bugs in the Rust compiler, eBPF, macOS and Caliptra.

Four techniques, one lesson: simplicity wins

The team built a benchmark of 21 historical logic bugs disclosed between 2016 and 2026 in SQLite (9), zstd (3), brotli (1) and image-png (8). The model received only the unpatched source and had to submit an input that triggers each bug. The techniques were fuzzing with LLM-written asserts, symbolic execution with an LLM-built harness, agentic code review, and informal correctness proofs.

In the blind setting, agentic code review in Claude Code rediscovered 11 of the 21 bugs, while fuzzing and symbolic execution found none. When the violated invariant was provided, 20 to 21 of the 21 bugs were found, which shows that forming the hypothesis, not testing it, is the hard part.

A use-after-free in safe Rust: try it yourself

Claude was asked to prove that safe Rust is type-safe using the informal proof technique, and the attempt produced several dozen type safety issues. The authors stress that these are compiler bugs rather than security vulnerabilities. In the example below, ownership of the inner array moves to row inside the index expression and drop frees the Box, but the compiler fails to connect that move with the borrow of arr[0].

On the box, rustc 1.85.1 compiled this code without unsafe and without errors. Instead of 42 the program printed a different number on each run, for example 1605398485 and 1695830688. This is undefined behavior, so your output may differ. According to the authors, the bug has been reported and maintainers are working on a patch.

Rustuaf.rs
fn main() {
    let mut arr = [[Box::new(42)]];
    let alias = &mut arr[0][{ let [row] = arr; drop(row); 0 }];
    println!("{}", **alias); // use-after-free of arr's dead stack slot
}

The eBPF verifier and the 32-bit comparison trap

The same technique uncovered over a hundred soundness bugs in the eBPF verifier, one of them CVE-2026-98041. The verifier knows a map value pointer can never be zero, so it treats ptr != 0 as always true. The rule was also applied to 32-bit comparisons: if the low 32 bits of the pointer are zero, the condition is false at runtime and a path the verifier never checked gets executed.

The Python model below shows the mismatch. On the box it printed verifier=True runtime=True for the 64-bit case and verifier=True runtime=False for the 32-bit case. That gap is exactly what lets an unchecked memory read slip through.

Pythonwidth_check.py
# Model of the verifier rule from the eBPF logic bug: "a map-value pointer is never 0"
ptr = 0x7F3A_0000_0000  # valid, non-null pointer whose low 32 bits are zero

def verifier_assumes_taken(width_bits):
    # buggy rule: ignores the comparison width
    return True

def runtime_taken(value, width_bits):
    mask = (1 << width_bits) - 1
    return (value & mask) != 0

for width in (64, 32):
    print(f"{width}-bit 'ptr != 0': verifier={verifier_assumes_taken(width)} runtime={runtime_taken(ptr, width)}")

Other findings and advice for defenders

In the Caliptra silicon root of trust, Claude found a time-of-check-to-time-of-use bug in the firmware update flow (CVE-2026-11835, now patched). In macOS, it independently found CVE-2026-43783 in DesktopServicesHelper, which let a local user take ownership of any file not protected by SIP; it has been patched.

The authors recommend that defenders first apply agentic code review and informal correctness proofs to their own codebases before investing in specialized tooling. To pick up the fixes, keep your Linux kernel and macOS up to date.

Recommended reading

All articles