Skip to content

Microsoft finds an 11-year-old memory safety bug in Rust itself

FORGE Lab used an AI vulnerability scanner called Hyenas to turn up four flaws in the Rust standard library, including one dating back to 2015.

Microsoft’s FORGE Lab published four memory safety bugs in Rust’s standard library on 9 November, found with help from Hyenas, its AI-powered vulnerability scanner. The headline find is in process::exit: calling it from a child thread tears down the main thread’s alternate signal stack while that thread is still running, a bug that had sat undetected since 2015. Microsoft says it’s now fixed.

The other three show the same shape of problem in different places: a clone panic that can expose uninitialised memory, a custom Pattern implementation that can make str::replace build an invalid, non-UTF-8 String, and CommandExt::exec writing to the process environment under only a read-lock, which opens a race condition.

Why it matters: Rust’s type system rules out whole classes of bugs, but the standard library still leans on unsafe code to deliver that guarantee, and these four cases all trace back to the same three assumptions: trusting code not to panic, trusting a caller’s implementation to behave, and trusting process-wide state like signal stacks and environment variables to stay put. Anyone auditing unsafe Rust, in the standard library or their own crates, now has a concrete checklist of what to doubt.

The caveat: Microsoft frames this as research into where unsafe code hides, not a list of actively exploited bugs. Only the process::exit fix is confirmed shipped; the other three are reported, not necessarily all patched yet.

Share

Related reading

More from The Wire

All briefs