Microsoft's Rust findings put unsafe contracts on the review list

FORGE Lab found standard-library soundness bugs with AI-assisted research. The useful response is to audit the assumptions inside unsafe wrappers and test whether real applications reach those paths.
Microsoft FORGE Lab reported on November 9 that it found memory-safety defects in Rust's core and standard libraries, including cases triggered through safe Rust code. Researchers used an agentic scanner to help find candidates, then reproduced and assessed the bugs before working with Rust maintainers on reports and fixes. The result points to a specific review target: assumptions inside unsafe code that safe callers are allowed to break.
Rust's ownership rules eliminate many errors, but safe library functions still rely on small unsafe implementations. Those implementations must remain sound for every legal use of the public API. A caller can supply an unusual trait implementation, cause a panic or interact with process-wide state without writing an unsafe block.
Three assumptions deserve a second pass
The report groups the findings into three patterns. First, a callback can panic while an unsafe routine has temporarily broken an invariant; unwinding then exposes that state to cleanup code. Second, a caller-provided trait can return inconsistent values, such as a different slice on repeated calls. Third, the operating system or C library can change shared state in ways the Rust code did not model.
These are contract failures, not evidence that Rust's safety model is useless. They show where the compiler hands responsibility to library authors. Microsoft's examples include a clone path that could drop uninitialised memory after a panic and an environment operation whose lock did not exclude another thread. Some reported issues remained open when the article was published.
An unsafe wrapper is only as sound as the assumptions it makes about safe callers and the system around it.
Separate soundness from exploitability
A standard-library bug can invalidate a safety guarantee without becoming a practical vulnerability in every application. Microsoft notes that its examples need unusual trigger conditions. For one signal-stack issue, its testing found no reliable exploitation path under the examined conditions and judged practical exploitation unlikely.
That distinction should govern triage. Record the affected API and version, the required trigger and whether the application's own code can reach it. Check whether a fix is available or under review. Prioritise reachable paths that cross trust boundaries rather than treating every proof of concept as an active compromise.
Use agents to widen the audit, humans to close it
FORGE's agentic tooling helped search code and system behaviour, but researchers investigated the underlying code, reproduced each issue and assessed impact. That division of labour is the part worth adopting. An agent can generate hypotheses about panic paths, trait behaviour and operating-system interactions; a reviewer must verify the invariant and the real call path.
For teams maintaining unsafe Rust, add those three assumption classes to code review and regression tests. The immediate win is an explicit safety contract for each wrapper, plus evidence that the contract still holds when safe callers behave unexpectedly.
Sources
- FORGE Lab uses agentic tools to identify memory safety issues in Rust · Microsoft FORGE Lab
Written by the Devence Lab research team.




