Researchers have introduced CleanStack, a novel dual-stack mechanism designed to protect against stack-based memory corruption attacks.
These attacks, which include control-flow hijacking and non-control data attacks, have long been a major threat to software systems, particularly those built with low-level languages like C/C++.
CleanStack addresses these vulnerabilities by isolating stack objects influenced by external input from other safe stack objects, thereby preventing attackers from modifying return addresses or exploiting local variables.
Mechanism and Implementation
CleanStack operates by employing a dual-stack architecture, where tainted stack objects those influenced by external inputs are separated from clean stack objects.

This separation, known as Tainted Stack Object Separation (TSOS), is crucial in preventing attackers from exploiting memory vulnerabilities to manipulate return addresses or critical variables.
Additionally, CleanStack randomizes the placement of tainted stack objects within the Unclean Stack, making it difficult for attackers to predict the stack layout and perform non-control data attacks.
The identification of tainted stack objects is achieved through both static program analysis and heuristic methods, with the latter being adopted for implementation due to its compatibility advantages.
CleanStack is integrated into the LLVM compiler framework, allowing it to be applied to a wide range of applications without significant performance overhead.
Performance and Security Evaluation
The effectiveness of CleanStack has been evaluated using the SPEC CPU2017 benchmark suite and real-world applications like the Apache HTTP server.
The results show that CleanStack incurs a minimal execution overhead of only 1.73% while introducing a negligible memory overhead of 0.04%.
According to the Report, this performance is significantly better than many existing stack protection techniques, which often suffer from high overhead or compatibility issues.
CleanStack’s comprehensive defense against both control-flow hijacking and non-control data attacks, including Return-Oriented Programming (ROP) and Data-Oriented Programming (DOP) attacks, positions it as a leading solution in stack security.
Its ability to balance protection coverage, runtime overhead, and deployability makes it highly suitable for practical applications.
CleanStack represents a major step forward in defending against memory corruption attacks by providing a robust, efficient, and highly compatible stack protection mechanism.
Its innovative approach to isolating and randomizing tainted stack objects not only enhances security but also ensures minimal impact on system performance.
As software systems continue to rely on low-level languages for high-performance requirements, solutions like CleanStack are crucial for mitigating the risks associated with stack-based vulnerabilities.