Memory Safety Bugs Found in Rust Standard Library
November 15, 2026
Microsoft's FORGE Lab has published research detailing several memory safety bugs in Rust's standard library, including cases where code written entirely in safe Rust can trigger undefined behavior. The findings are notable because Rust's core selling point is its memory safety guarantees, which are designed to eliminate the buffer overflows, use-after-free bugs, and other memory-related vulnerabilities that plague C and C++ codebases.
The research used Hyenas, FORGE's AI-powered vulnerability scanning system, to examine the unsafe code that underlies Rust's safe APIs. Much of the standard library relies on unsafe code internally to provide its safe interface, and when that unsafe code breaks its safety contract, even safe Rust programs can encounter behavior the language is designed to prevent.
The researchers identified three recurring patterns of misplaced trust in the standard library's unsafe code. The first pattern involves trusting code not to panic, where unsafe operations assume that intermediate states will not be observed by panic handlers. The second pattern involves trusting user-provided trait implementations to be correct, where the safety of an operation depends on user code behaving according to the documented contract. The third pattern involves trusting the underlying system, where bugs at the boundary between Rust and the operating system or hardware can undermine safety guarantees.
The findings come at a time when Rust adoption is accelerating rapidly. Microsoft made Rust a Tier-1 internal language alongside C++, C#, and TypeScript. GitHub rewrote the Copilot agent runtime in Rust. Android, the Linux kernel, Bun, and Cloudflare are all moving code to Rust. Billions of people are estimated to interact with Rust-based software daily, often without knowing it. This makes bugs in the standard library particularly consequential, as they can affect software far beyond the code where they originate.
The FORGE Lab team emphasizes that Rust's safety model still matters even though its memory safety is not perfect. The bugs found were in the unsafe code underlying safe APIs, not in the safe Rust language itself, and the number of issues is small compared to the constant stream of memory safety bugs in C and C++ codebases. The Rust maintainers have triaged the reported issues, with most fixed and two remaining open at publication time.
The research also highlights the role of AI-assisted tools in vulnerability research. Hyenas helped identify candidate bugs that human researchers then validated, reproduced, and reported. The combination of AI scanning and expert verification proved effective at finding subtle soundness issues in code that has been reviewed by experienced Rust contributors, suggesting that AI tooling can meaningfully expand the reach of security audits.
Sources: [1] Memory Safety Bugs in Rust Standard Library, FORGE Lab / Yechan Bae, November 9, 2026