https://www.okta.com/blog/2020/04/what-the-jeff-bezos-whatsa...
I know that if you craft your buffer overflow just right it will overwrite other parts of memory with the new function.
But how do you know what parts will get overwritten?
Does that mean the new function can do almost anything?
https://stackoverflow.com/questions/14760587/how-does-a-nop-...
https://stackoverflow.com/questions/49620893/return-into-lib...
And yes, arbitrary code execution is a common goal of these exploits, though it may not always be possible--sometimes you only get a DoS attack or such.
The article has some detail about the remote code execution part of this exploit.
“What this means is that there was a software flaw in the WhatsApp code for handling MP4 media files. If an attacker triggered the flaw, the function in question would crash in a way that could allow a potential attacker to gain “RCE” or Remote Code Execution.
In layman's terms, this means the attacker could inject his own code into the application and, by triggering the flaw, make the application to run with all the privileges and access of the WhatsApp application itself.”
1) Discover/buy/steal Bezo's Whatsapp number (how did they do that...)
2) Discover/buy/steal a 0-day bug in Whatsapp.
3) Write and compile a program that reads SMS from the OS and beacons it to some server you control.
4) Create a corrupted video file that would trigger the video parsing bug, and within that video file place the compiled program from the previous step in the correct place so that it gets executed.
5) Send to Bezos.
This is usually no longer the case in modern applications. So attackers instead string together short snippets of code from the application itself and jump around between them to basically do what they want.
It's become more complex due to mitigation, but the general principle is the same.
Parsing is hard, and parsers are buggy and lead to all kind of unsafe C code