Stack Canary
Also called stack cookie, stack protector.
A guard value checked on return to detect stack overflows.
What it is
A mitigation that places a known random value (the canary) between local buffers and the saved return address. The value is verified before a function returns, and a mismatch aborts the program.
Why it matters
Stack canaries detect contiguous stack overflows before control flow is hijacked, defeating naive smashing. Attackers must leak or avoid overwriting the canary, which raises the bar and leaves crash evidence.
In practice
A buffer overflow overwrites the canary, the prologue check fails, and the process terminates with a stack-smashing-detected message instead of running shellcode.
What to look for
- Binaries compiled without stack protection.
- Canary failures that point to an overflow attempt.
- Leaks that expose the canary value.
Common mistake
Assuming a canary covers every overflow. It guards the return address, not every local variable.
Practice it nearby
CyberKit has no tool for this term itself. These are the closest places to practice it.
- Risk Scoring
Score a vulnerability with CVSS v3.1, or an incident across five dimensions, and see the reasoning behind each number.
- Map and Score
Map real procedures to ATT&CK techniques, then pick the CVSS v3.1 metrics for real vulnerabilities.
Read next
- Stack Buffer Overflow: Overflowing a stack buffer to overwrite the saved return address.
- Data Execution Prevention: Marking data memory non-executable to block injected code.
- Information Leak: Disclosing memory contents to defeat randomization or steal secrets.