2 ms·
> Although his exploit used some memory corruptions, the vulnerable code was written in a memory-safe programming language: JavaScript! That's not really anyt
by staticassertion 4y ago
> Although his exploit used some memory corruptions, the vulnerable code was written in a memory-safe programming language: JavaScript!
That's not really anything new. There was what amounts to an "ACL" issue at the JS level, which exposed the vulnerable C++ code. Sort of like if you have a vulnerable web app behind an improperly configured firewall - you wouldn't say you exploited the firewall though if you owned the service behind it, although you could say that you exploited both.
VMs using unsafe languages have always had this problem. QEMU has this, V8, JVM, Flash, etc.
> This post looked at a great vulnerability demonstrating that even if you replace existing code with JavaScript, you could still be prone to memory corruption.
Well, no one replaced anything with javascript. It's a javascript VM. If it were a C VM the issue wouldn't be any better or worse, "attacker is executing code in the VM" is the assumed situation.
So yeah I think it's totally fine and good to say that VMs make for interesting exploit chains across languages and runtimes - that's for sure true and one of the biggest issues with implementing safe VMs (sharing memory across runtimes, needing to keep memory as RWX, all sorts of nutty stuff). But what we see here is exactly the same standard thing we always see - an unsafe C++ program did unsafe things with untrusted input.
- cxr 4y ago> There was what amounts to an "ACL" issue It's a capability leak. <https://erights.org https://erights.org> > Well, no one replaced anything with javascript. They did. They replaced the process for implementing VM internal operations with a process where VM internals are partially written in JS itself. If the sequence that the spec calls "GatherAsyncParentCompletions" had been implemented in C++, this leak wouldn't have occurred, because they would have been using an idiomatic list type (whether language-idiomatic, or a specialized data type standardized across the codebase), instead of a JS array.
- staticassertion 4y ago> They did. Got it, very interesting context, thank you.