3 ms·
Note the emphasis on accidental memory safety violations. There's an enormous difference between attackers running JavaScript that they control and attackers h
by pcwalton 11y ago
Note the emphasis on accidental memory safety violations.
There's an enormous difference between attackers running JavaScript that they control and attackers having to exploit memory safety issues in JavaScript that you wrote. Virtually all attacks against JavaScript JITs have been of the former type, in that they rely on perfectly crafted hostile JavaScript that nobody would write on purpose. But in a node.js type of server side scenario, attackers do not have the ability to run arbitrary JavaScript. They only have the ability to interact with the JavaScript that was already written to be non-malicious. So it's much, much harder for an attacker to exploit memory safety problems in the JS engine in a server side scenario—so much harder, in fact, that I wouldn't be surprised if it's never been done.
If your argument is that JS JITs are hard to write, well, sure. But I think that's totally irrelevant to this conversation. Clang and LLVM are also hard to write and are just as trusted in this scenario.
- nickpsecurity 11y ago"Note the emphasis on accidental memory safety violations." Good points. Of course, I'm guessing you're saying it's still really hard to write memory-safe code with modern C++ constructs whereas others here suggest it's pretty easy. That point is tripping me up in these discussions. Did a quick Google on C++ safety and found you already said something about the topic: https://news.ycombinator.com/item?id=7587978 https://news.ycombinator.com/item?id=7587978 My statement is predicated on the premise that modern C++ can be done safely without issues like that. If not, then it's false and we're back to me recommending safer, systems languages. One thing to remember, though, is that there's tools to automatically transform C code into safe code. Softbound + CETS comes to mind. Might be able to use a C++-to-C compiler with one of those. There's also safer forms of C++ like Ironclad C++. http://www.cs.grinnell.edu/~osera/papers/ironclad-cc.pdf http://www.cs.grinnell.edu/~osera/papers/ironclad-cc.pdf So, the situation might be worse than people looking into C++ were hoping but not as bad as you think.