3 ms·
> Are those two¹ bugs possible only in memory unsafe programming languages CVE-2020-16009 is a bug in V8 (Chrome's implementation of JavaScript). You could wr
by kentonv 6y ago
> Are those two¹ bugs possible only in memory unsafe programming languages
CVE-2020-16009 is a bug in V8 (Chrome's implementation of JavaScript).
You could write a JavaScript implementation in Rust. However, to achieve acceptable performance, you would almost certainly need to use a lot of "unsafe" code. A performant JavaScript implementation has to be able to generate raw machine code, after all, and then execute it. And the garbage collector probably isn't going to manage memory in a way that the Rust compiler can verify for correctness.
So no, "use a memory-safe language" isn't a simple answer to this kind of bug. Using Rust could reduce the attack surface somewhat but certainly would not completely prevent bugs.