# 🔒 AI-assisted review finds memory-safety bugs inside Rust’s standard library

AI Today · published 2026-11-10T23:51:50Z · https://ai-today.com/news/d2242b1e-4459-43c0-be6b-58e2d38a11ca?lang=en

- 🔬 Microsoft’s FORGE Lab used AI-assisted tools to find standard-library bugs in Rust.
- ⚠️ Unsafe internals could misbehave even when called through ordinary safe Rust code.
- 🔧 Researchers investigated, reproduced and reported the findings to Rust maintainers.
- 📅 Two team-reported issues remained open on November 9; triggering conditions are specific.

🛡️ Microsoft’s FORGE Lab used the AI-assisted Hyenas tool to identify several memory-safety problems in Rust’s standard libraries. The bugs sit inside internal unsafe code but can, under particular conditions, be triggered through ordinary safe Rust. Researchers investigated and reproduced the findings and worked with Rust maintainers on fixes. The November 9 report identifies three recurring causes: unexpected panics, misplaced trust in caller-supplied functions and changing operating-system state. Two issues reported by the team remained open at publication.

🦀 Rust aims to prevent many common memory errors when a program is compiled. Its rules track, among other things, ownership of memory and how long that memory can be used. The standard library still needs direct memory access and operating-system interaction in some places. Those areas are marked unsafe, with developers taking responsibility for conditions the compiler cannot fully verify.

🤖 FORGE Lab examined these internals with help from Hyenas, a research version of the MDASH AI vulnerability scanner. Some of the bugs were found with that tool. Human researchers investigated the code, reproduced the failures and assessed potential security consequences. They then reported findings and worked with Rust maintainers on fixes. Two team-reported issues were still open at publication; the post also discusses related findings by others and fixes under review.

🧯 The first pattern involves a function unexpectedly aborting its normal flow, called a panic in Rust. If a copy operation stops partway through, an internal data structure may be only partly filled. Cleanup code must safely handle that state. The report shows a case where cleanup accessed uninitialised memory. A fix keeps the intermediate state away from normal cleanup until construction has safely finished.

🔗 The second pattern concerns trust in functions supplied by a caller. Such a function may return different data on two calls. An earlier length check may then say nothing about the memory actually read later. Library code must retain the checked result or reliably enforce the required property another way. The report also describes a corrected string-handling case where a type now directly guarantees valid UTF-8.

🖥️ The third pattern sits at the operating-system boundary, including process exit, memory mappings and shared environment data. Other threads and libraries can alter that state. Microsoft sees this as a promising area for AI-assisted review because analysis needs knowledge of the surrounding system. Whether a library bug endangers a particular application depends on its reachable execution path: the cases discussed require conditions such as a panic at a precise point or an unusual caller-supplied implementation. The work provides concrete ways to correct foundational library code.

## Sources

- [FORGE Lab uses agentic tools to identify memory safety issues in Rust](https://www.microsoft.com/en-us/security/blog/2026/11/09/forge-lab-uses-agentic-tools-to-identify-memory-safety-issues-in-rust/)

---
This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources.
