by olliej · 4y ago · 0 comments
I can’t speak for V8, but the majority of UaF in JSC have been due to GC bugs collecting objects early. Being in C++ isn’t relevant.
Many other bugs are in things that are doing absurd memory manipulation needed for execution speed of common primitives. The rust implementation of these would also necessarily be unsafe.
The problem is obviously building the safe layer. Sometimes that's really hard. There are obvious examples already in Rust - like creating a safe API over scoped threads, or io_uring, ghostcells, etc. Some things may not be representable using only safe code in Rust, with no overhead.
Another relevant thing you can't really safely express is FFI. That would be relevant here since there's this VM boundary.
And then you get JITs, which also have tons of security issues.
Idk, I'd be curious to read about this if there are any papers. Maybe the wasm people are thinking about this?
Certainly it's not unreasonable to say that a memory safe JIT'd VM is going to be tough make memory safe.