[Paper Review] Reverse Engineering x86 Processor Microcode
This paper reverse-engineers the microcode and update mechanism of AMD K8 and K10 x86 processors, demonstrating how custom microcode updates can be developed to enable CPU-assisted instrumentation or deploy malicious microcode Trojans capable of remote code execution and cryptographic attacks. The key contribution is the first detailed analysis of microcode semantics and update procedures in COTS CPUs, revealing critical security implications and potential for both defensive and offensive hardware-level exploits.
Microcode is an abstraction layer on top of the physical components of a CPU and present in most general-purpose CPUs today. In addition to facilitate complex and vast instruction sets, it also provides an update mechanism that allows CPUs to be patched in-place without requiring any special hardware. While it is well-known that CPUs are regularly updated with this mechanism, very little is known about its inner workings given that microcode and the update mechanism are proprietary and have not been throughly analyzed yet. In this paper, we reverse engineer the microcode semantics and inner workings of its update mechanism of conventional COTS CPUs on the example of AMD's K8 and K10 microarchitectures. Furthermore, we demonstrate how to develop custom microcode updates. We describe the microcode semantics and additionally present a set of microprograms that demonstrate the possibilities offered by this technology. To this end, our microprograms range from CPU-assisted instrumentation to microcoded Trojans that can even be reached from within a web browser and enable remote code execution and cryptographic implementation attacks.
Motivation & Objective
- To reverse-engineer the microcode semantics and update mechanism of AMD K8 and K10 x86 processors, which are otherwise undocumented and proprietary.
- To demonstrate the feasibility of developing and deploying custom microcode updates on commercial off-the-shelf (COTS) CPUs.
- To explore the security implications of microcode updates, including the potential for persistent, low-level backdoors and hardware-based attacks.
- To investigate the use of microcode for constructive purposes such as dynamic program analysis, binary instrumentation, and performance optimization.
Proposed method
- Reverse-engineered the microcode update mechanism of AMD K8 and K10 processors by analyzing microcode patches loaded via BIOS/UEFI during boot.
- Extracted and reverse-engineered microcode data from firmware images and used disassemblers and custom tools to analyze microinstruction formats and control flow.
- Developed a set of microprograms to demonstrate both defensive and malicious capabilities, including CPU-assisted instrumentation and remote code execution via microcode Trojans.
- Mapped the microcode update process, including the role of patch RAM, the structure of microcode update headers, and the use of cryptographic signatures for integrity.
- Validated the functionality of custom microcode updates by injecting them into test systems and observing behavioral changes at the instruction level.
- Evaluated the security model of the microcode update mechanism, identifying weaknesses such as lack of verifiable trust anchors and reliance on proprietary, undocumented mechanisms.
Experimental results
Research questions
- RQ1What is the actual structure and semantics of microcode in AMD K8 and K10 processors, and how is it updated at runtime?
Key findings
- The microcode update mechanism in AMD K8 and K10 processors is based on a volatile patch RAM that requires re-loading after each reset, making updates non-persistent without firmware persistence.
- Microcode updates are signed using cryptographic algorithms, but the lack of public verification mechanisms means users cannot validate the integrity or authenticity of updates.
- Custom microcode updates can be developed and injected into the processor, enabling new behaviors such as CPU-assisted instrumentation and hardware-level code injection.
- Malicious microcode updates can bypass operating system and application-level isolation, enabling remote code execution and cryptographic key recovery from within a web browser.
- The paper demonstrates that microcode Trojans can be designed to remain undetected and persist across reboots if stored in the BIOS/UEFI, especially in scenarios with physical access.
- The absence of public documentation and verifiable trust anchors for microcode updates undermines the security model of modern CPUs, exposing systems to supply chain and post-manufacturing attacks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.