Does anyone care to explain how this would work? If you used OpenSSL from Rust you would still be vulnerable to Heartbleed. Or am I missing something?
Does anyone care to explain how this would work? If you used OpenSSL from Rust you would still be vulnerable to Heartbleed. Or am I missing something?
Also they say:
>> Many kinds of browser security bugs, such as the recent Heartbleed vulnerability, are prevented automatically by the Rust compiler.
Are they referencing reverse heartbleed here? Browsers themselves were not vulnerable to heartbleed, I don't even this they were vulnerable to reverse heartbleed.
There is no way Servo would have prevented the heartbleed bug, no browser could have, I feel like that sentence has no place in this blog post.
The point I was trying to make is that you can't make that kind of mistake in the safe Rust language. You will fail a bounds check even if you decide to trust client provided lengths.
"Servo protects you from that really scary thing the internet has been atwitter with for the past week whereas other browsers leave you high and dry"
I know that is not what you said and probably not what you meant but it just seemed like an odd way to word IMHO.
Clients could have been vulnerable to Heartbleed. Feel free to correct me on this, but I believe the only reason they weren't is that Chrome uses OpenSSL compiled without the heartbeat feature, and Firefox uses NSS.
If you called OpenSSL from Rust, it would be the same as calling C from Java.
Gist of issue, Rust's static type checker would prevent bugs that caused HeartBleed.
I believe its more a case that it would have been a run-time error due to Rust's automatic bounds checking. This is because Rust uses 'fat pointers' for strings, vectors and slices that include bounds information rather than a single, raw pointer like in C. Do note there are unsafe ways around bounds checking, but these are restricted to unsafe blocks, which makes them easier to audit.
"It is designed to be more memory safe (far and away the #1 cause of browser engine security bugs!)"
I'm not entirely sure this is a correct claim, unless you mean 'system calls are implemented by the kernel, which is written in C.'
While it's true that FFI in Rust is really good, most things (notably, _not_ crypto) are just straight-up written in Rust.
Edit: Servo's src/support directory is a good example of my general sense that large Rust projects still tend to rely on a good deal of C libraries:
As an example, we used to use Netsurf's C library for CSS stuff, but now we have our own parser and style system written in 100% Rust.