Dynamic Stack Canary Generation for Embedded Security
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Embedded systems lack effective protection against buffer overflows due to the absence of true random number generators, making stack canary mechanisms vulnerable to brute force attacks and BORE attacks, especially in systems with limited bit lengths and reuse of canary values.
Innovation Solution
Implement a dynamic regeneration of stack canary values for each thread or execution cycle using iterative modifications based on non-true random number generators, such as clock drift or analog noise, to enhance randomness and prevent attack predictability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a fixed externally generated true random generated canary is used, then the canary provides protection against buffer overflows, but it can be brute forced and reused across systems making it vulnerable to BORE attacks
Solution Approach 1:
The patent implements dynamic canary values that change over time and differ across systems. Instead of using a fixed externally generated canary, the system generates canary values dynamically using local entropy sources, ensuring that each system has unique, time-varying canary values that cannot be reused across different systems or time periods.
Solution Approach 2:
The patent introduces local entropy sources (such as hardware noise generators or system-specific variables) as intermediaries to generate canary values. These entropy sources act as mediators between the system and the canary generation process, ensuring that canary values are derived from system-specific randomness rather than external fixed values.
2Adaptability or versatility
If a unique per system generated random canary is used, then it prevents BORE attacks, but it can still be leaked by brute force in systems with small canary sizes
Solution Approach 1:
The patent applies preliminary actions by generating canary values with sufficient entropy before they are needed for protection. The system pre-generates canary values using multiple entropy sources and cryptographic hash functions, ensuring that the canary values have high entropy and cannot be brute-forced even in systems with limited canary sizes.
Solution Approach 2:
The patent combines multiple entropy sources (hardware noise generators, system-specific variables, timing information) to create composite canary values. This composite approach ensures that the final canary value has high entropy and cannot be easily guessed or brute-forced, even when the canary size is limited.
3Reliability
If current TRNG based random generation processes are used, then randomness is provided, but the extraction process is slow creating large overhead on startup execution
Solution Approach 1:
The patent performs preliminary entropy collection and canary generation during system initialization or idle periods, so that when canary values are needed for buffer overflow protection, they are already available. This preliminary action eliminates startup delays caused by random number generation.
Solution Approach 2:
The system uses its own operational characteristics (timing information, system variables, hardware noise) as entropy sources, eliminating the need for external TRNG hardware. This self-service approach provides sufficient randomness without the overhead of TRNG extraction processes.
Data Source
AI summary
Various examples of the present disclosure relate to apparatuses, methods, computer systems and computer-readable media for generating and using random values. Some aspects of the present disclosure relate to an apparatus for a computer system, the apparatus comprising memory circuitry, machine-readable instructions, and processor circuitry to execute the machine-readable instructions to determine different canary values for corresponding different threads of a program, and start the thread of the program, with the determined canary value being used as stack canary for the thread of the program.


