Go deeper into the causes of the vulnerability, such as a stack buffer overflow, I have a number of questions, which I find difficult to answer:
Maybe a stupid question, but still, why in the OS, such as Windows, buffer recording on the stack occurs in the direction already recorded information: http://s27.postimg.org/udizo3itf/Stack_Overflow_2.png and not something like that: http://s18.postimg.org/q6kje5up5/Stack_Overflow_22.png Then, if the allocated memory is not enough to contain the buffer, the program just crashes (an attempt to appeal to unallocated memory) and the return address from the function not overwrites.
Does the stack overflow attack make sense only when the target program has the high permissions in the system? How this vulnerability helps attacker, for example, to create backdoor? If the stack overflow attack needs to inject shellcode, so it means that the attacker already gets system control and can do everything he want(stack overflow attack is unnecessary), or it means that the user has to do something that is needed for attacker(in this case, the attacker can persuade a user to run an executable file that does everything he needs - stack overflow attack is unnecessary).
Please specify where my reasoning is wrong.