Comment Re: So Rust does not even have a spec? WTF? (Score 2) 106
From Rust Vulnerability Analysis and Maturity Challenges
A MITRE CVE search for "Rust" in December 2022 returned recent vulnerabilities affecting a wide range of community-maintained libraries but also cargo itself, Rust's default dependency management and software build tool.
Perhaps one of Rust's most noteworthy features is its borrow checker and ability to track memory lifetimes, along with the unsafe keyword. The borrow checker's inability to reason about certain situations around the use of unsafe code can result in interesting and surprising vulnerabilities. CVE-2021-28032 is an example of such a vulnerability, in which the software library was able to generate multiple mutable references to the same memory location, violating the memory safety rules normally imposed on Rust code.
While this is only one example, other CVEs appeared for undefined behavior and other memory access errors in our basic CVE search. These existing CVEs seem to confirm our earlier observations on the limitations of the Rust security model. While it is hard to compare Rust-related CVEs to those of other languages and draw general conclusions about the safety of the language, we can infer that Rust's memory safety features alone are insufficient to eliminate the introduction of memory-related software vulnerabilities into the code at build time, even if the language and compiler do well at reducing them.
For example, Rudra discovered CVE-2021-25900, a buffer overflow in the smallvec library, as well as CVE-2021-25907, a double drop vulnerability (analogous to a double-free vulnerability due to Rust's use of default OS allocators) in the containers library.