Stack Canaries
A stack canary is a security mechanism used in computer programming to detect buffer overflows. It involves placing a small, known value, called a "canary," just before the stack return pointer. If a buffer overflow occurs, this value is altered, indicating that the stack has been compromised. When the function returns, the program checks the canary's value to ensure it remains unchanged.
If the canary value has been modified, the program can take protective actions, such as terminating the process. This technique helps protect against attacks that exploit vulnerabilities in software, enhancing the overall security of applications and systems.