Project Zero
Follow
The Windows Registry Adventure #7: Attack surface analysis
The Windows Registry is a complex and critical component of the Windows operating system, and its security is of utmost importance. The registry is a local attack surface that can be leveraged by a less privileged process to gain higher privileges or access the kernel. The registry's codebase is old, complex, and written in a memory-unsafe language, making it prone to logic and memory safety bugs. The registry implementation resides in the core Windows kernel executable, which increases the chances of a bug being exploited. Most of the registry-related code is reachable by unprivileged users, making privilege escalation a likely scenario. The registry manages sensitive information, including security-critical system information, passwords, and user permissions. The registry is not trivial to fuzz, and there is a lack of publicly available materials on its internal mechanisms, making it a challenging target for bug hunting. The registry has proven to be a fruitful research objective, with numerous classes of bugs, including hive memory corruption, pool memory corruption, information disclosure, race conditions, logic bugs, and inter-process attacks. The registry's security descriptors are shared by multiple keys and must be reference counted, which can lead to use-after-free conditions and hive-based memory corruption if not implemented correctly. The registry's complexity and lack of documentation make it a difficult target to audit, but also provide opportunities for researchers to discover new vulnerabilities.