Microsoft says its AI tool found an 11-year-old Rust stdlib bug
CSO Online reports Microsoft researchers say they found Rust standard library flaws with AI help, so Rust users should track upstream fixes.
- Published
- Ecosystem
- Open sourceAI developer tools
- Exploitation
- No, Microsoft assessed practical exploitation as unlikely and found no reliable exploitation path under the conditions it examined, per CSO Online
What happened
According to CSO Online, Microsoft’s FORGE Lab researchers say they found a memory-safety bug in Rust’s standard library that went undetected for nearly 11 years, along with other flaws that can trigger undefined behavior even in applications written entirely in safe Rust. CSO reports that two of the findings affect stable Rust. The details come from a Microsoft blog post as described by CSO; the blog post itself is not among the sources used here.
CSO reports that the long-lived bug involves process::exit. Per Microsoft, calling it from a child thread could cause the runtime to remove the main thread’s alternate signal stack while it was still in use. If the main thread then overflowed its stack, the operating system might not deliver the signal correctly, giving a segmentation fault instead of Rust’s intended stack-overflow handling. Microsoft says it found no reliable exploitation path under the conditions it examined and assessed practical exploitation as unlikely, according to CSO.
CSO says the research used Hyenas, FORGE Lab’s AI-powered scanning system and the research version of MDASH, Microsoft’s agentic vulnerability-discovery system. Microsoft says some bugs were found with help from Hyenas, then the researchers examined the code, reproduced the issues, assessed impact and reported them to Rust maintainers.
Other findings CSO describes, all attributed to Microsoft:
- MapWindows::clone: a panic-safety problem where a panic during a user-provided clone operation could lead the destructor to access uninitialized memory. Microsoft says the reported fix stops the partially initialized buffer from being destroyed early.
- str::replace: an incorrect assumption about custom implementations of the nightly Pattern trait, which could produce invalid UTF-8 and later undefined behavior.
- CommandExt::exec: the function could modify the process-wide environment variable array while holding a read lock, and under certain conditions the environment pointer could reference freed memory. Microsoft says this affects stable Rust.
Microsoft says the practical risk is limited, since each flaw needs unusual conditions and a standard library bug becomes “a serious vulnerability only if a real program reaches the API in that way,” per CSO.
Not confirmed: CVE identifiers, fixed Rust versions and the exact release in which fixes will land. CSO reports that a proposed fix for the environment-variable issue (calling execve directly) was under review at publication, that two issues reported by Microsoft’s team remained open, and that the Rust project had not responded to CSO’s request for comment.
Am I affected?
Based on CSO’s account, exposure requires specific conditions:
- Stable Rust programs are in scope for the process::exit and CommandExt::exec findings, per Microsoft.
- The process::exit issue needs a child thread to call it and the main thread to later hit a stack overflow.
- The CommandExt::exec issue needs concurrent operations touching the shared environment array.
- The str::replace issue involves the nightly Pattern trait, so it matters mainly if you use nightly Rust with custom pattern implementations.
Whether specific Rust versions are affected is not confirmed in the source.
What to do now
- Search your Rust code for process::exit calls made from non-main threads and for CommandExt::exec use alongside other threads.
- Follow the Rust project’s issue tracker and release notes for fixes, since no fixed version is confirmed and some fixes were still under review per CSO.
- If you use nightly Rust with custom Pattern implementations, note the str::replace finding when reviewing that code.
- Treat this as low urgency: Microsoft itself assessed practical exploitation as unlikely, and no exploitation is reported in the source.