Different is Good: Detecting the Use of Uninitialized Variables through Differential Replay

Mengchen Cao, Xiantong Hou, Tao Wang, Hunter Qu, Yajin Zhou*, Xiaolong Bai, Fuwei Wang
Proceedings of the 26th ACM Conference on Computer and Communications (ACM CCS 2019)


Abstract

The use of uninitialized variables is a common issue. It could cause kernel information leak, which defeats the widely deployed security defense, i.e., kernel address space layout randomization (KASLR). Though a recent system called Bochspwn Reloaded reported multiple memory leaks in Windows kernels, how to effectively detect this issue is still largely behind.
In this paper, we propose a new technique, i.e., differential replay, that could effectively detect the use of uninitialized variables. Specifically, it records and replays a program’s execution in multiple instances. One instance is with the vanilla memory, the other one changes (or poisons) values of variables allocated from the stack and the heap. Then it compares program states to find references to uninitialized variables. The idea is that if a variable is properly initialized, it will overwrite the poisoned value and program states in two running instances should be the same. After detecting the differences, our system leverages the symbolic taint analysis to further identify the location where the variable was allocated. This helps us to identify the root cause and facilitate the development of real exploits. We have implemented a prototype called TimePlayer. After applying it to both Windows 7 and Windows 10 kernels (x86/x64), it successfully identified 34 new issues and another 85 ones that had been patched (some of them were publicly unknown.) Among 34 new issues, 17 of them have been confirmed as zero-day vulnerabilities by Microsoft


 
@inproceedings{timeplayer_ccs19,  
    author = {Mengchen Cao and Xiantong Hou and Tao Wang and Hunter Qu and Yajin Zhou and Xiaolong Bai and Fuwei Wang},
    title = {Different is Good: Detecting the Use of Uninitialized Variables through Differential Replay },
    booktitle = {Proceedings of the 26th ACM Conference on Computer and Communications},
    year = {2019},
}