Microsoft’s AI bug hunter finds Rust flaw that went undetected for practically 11 years

The primary concerned a panic-safety downside in Rust’s MapWindows::clone implementation. The operate created a buffer earlier than totally initializing its contents after which known as a user-provided clone operation to populate it. If that operation triggered a panic, Rust’s unwinding mechanism may invoke the buffer’s destructor, which might try and entry uninitialized reminiscence. Microsoft mentioned the reported repair prevents the partially initialized buffer from being destroyed earlier than initialization is full.

One other discovering concerned str::change. The researchers discovered that the operate may make an incorrect assumption a couple of customized implementation of the nightly Sample trait. A customized implementation may provide a non-ASCII byte the place the code anticipated an ASCII character, inflicting the alternative operation to supply invalid UTF-8 information. Subsequent string operations may then set off undefined habits, Microsoft mentioned.

System-level bugs have an effect on secure Rust

Microsoft mentioned the primary two classes of weaknesses had been already being studied in 2021 by Rudra, a static analyzer developed by members of the analysis group. The usual library had additionally addressed panic-safety issues way back to 2015, however comparable weaknesses proceed to look in its implementations.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles