5 ms·
Thanks for sharing this. Wow, its a really suprising statistics to see 0 vuln found in 1.5m loc, even with Rust.
by menio 4y ago
Thanks for sharing this. Wow, its a really suprising statistics to see 0 vuln found in 1.5m loc, even with Rust.
- carlmr 4y agoI personally expect there are still some unfound memory errors in there, but it's such a stark contrast to C++ it's amazing. However memory errors in C++ account for 70% of vulnerabilities. I'd expect 30% to thus remain. Edit: meant to write memory errors not vulns.
- nindalf 4y agoIt's new code, there must be some logic errors, off-by-one errors, assumptions not expressed in the code etc. But that's not saying much, all new code has issues. The good thing is that since this code was written in a memory safe language, at least that eliminates an entire class of bugs.
- pdw 4y agoZero memory errors, not zero vulnerabilities. In high-quality C and C++ projects, about 70% of vulnerabilities are caused by memory errors. (https://alexgaynor.net/2020/may/27/science-on-memory-unsafety-and-security/ https://alexgaynor.net/2020/may/27/science-on-memory-unsafet...)
- GuB-42 4y agoNot zero vulnerabilities, zero memory errors. Memory errors make a good share of vulnerabilities, but not all vulnerabilities are memory errors. And not all memory errors are vulnerabilities, sometimes it is just an inexploitable bug. It is to be expected that there is no bug in the very thing that Rust is supposed to prevent. The same can be said of Java, JS or even PHP. What surprises me a little though is that there is zero memory error even in unsafe Rust. There has to be some unsafe code somewhere, for low level data structures and things like that.
- carlmr 4y ago>What surprises me a little though is that there is zero memory error even in unsafe Rust. There has to be some unsafe code somewhere, for low level data structures and things like that. Even unsafe Rust has more strict typing and borrow checking which C++ doesn't have. It does allow raw pointers, but it's still safer than C++. The other thing is that if say 1% of your loc is unsafe Rust, it's much easier to put this under more scrutiny than the whole C++ codebase. And 1% is a lot if you ask me. I almost never need unsafe at all. >There has to be some unsafe code somewhere, for low level data structures and things like that. In most cases you can just use the standard library code for these. They do contain unsafe of course, but it's in one of the most battle tested places.