Knowing What You Trust: Three patterns behind memory safety bugs we found in Rust's standard library, and why Rust's safety model still matters even though it isn't perfect.
Microsoft’s FORGE Lab found several memory safety issues in Rust’s standard library (std and core), including cases where code written entirely in safe Rust can trigger undefined behavior.
Yeah, they don’t define what’s “defined” behavior due to a lack of a formal standard, but there are some things they specifically want to defend against.
There does exist a formal standard (and certified toolchain), but it’s not official as far as I’m aware.
Bit of a misnomer, since I don’t think Rust actually has “defined behavior” in the technical sense…
or has it actually gotten a formal specification since I last looked?
From The Rust Reference
Not quite a standard, but fair enough for colloquial usage. A bit funny that they have to explicitly define undefined.
Yeah, they don’t define what’s “defined” behavior due to a lack of a formal standard, but there are some things they specifically want to defend against.
There does exist a formal standard (and certified toolchain), but it’s not official as far as I’m aware.
https://blog.rust-lang.org/2025/03/26/adopting-the-fls/
https://rust-lang.github.io/fls/
Hey this is great news! I’m surprised I hadn’t seen this before.
Oh, I hadn’t heard of them before. Interesting. Thank you.