Re:Chrome 0-day exploit used in Operation WizardOpium
by bouncycastle on Saturday November 02, 2019 @01:47PM
(#21428985)
The race condition exploits you're thinking of are not trivial and need specific code to pull off, unlikely to be a mistake like in C/C++. You just don't find them in normal Go programs.
Source (scroll down to the conclusion section): https://blog.stalkr.net/2015/04/golang-data-races-to-break-m...
Go compiles down to machine code, it has a stack and heap, it has structures on that stack and heap, and it has data races; those are all of the required components for a use after free. You can have data races compiled by the stock go compiler without the use of unsafe (also, why have race detector tooling if this is false?). It would probably be easier to exploit than here even because one wouldn't even need to bother with the ASLR pointer exfiltration they had to do here.
It may be harder to write exploitable code, but memory safety does not guarantee runtime memory safety. Especially in the face of concurrency.