Arbitrary Data Manipulation and Leakage with CPU Zero-Day Bugs on RISC-V
This talk demonstrates the discovery of 'GhostWrite', a critical hardware vulnerability in T-Head XuanTie C910 RISC-V CPUs that allows for arbitrary memory read and write operations. The researchers show how this flaw bypasses software-based isolation mechanisms, including containers and operating system privilege levels, by exploiting a bug in the CPU's vector extension implementation. The presentation highlights the effectiveness of differential fuzzing in identifying hardware-level vulnerabilities and discusses potential mitigations, such as disabling the vulnerable vector extension at the cost of performance.
GhostWrite: How a RISC-V CPU Bug Bypasses Hardware Isolation
TLDR: Researchers at Black Hat 2024 demonstrated a critical hardware vulnerability called GhostWrite, affecting T-Head XuanTie C910 RISC-V CPUs. This flaw allows an unprivileged user to perform arbitrary memory reads and writes, effectively bypassing all software-based isolation like containers and OS privilege levels. While this specific bug is limited to certain T-Head hardware, it serves as a stark reminder that hardware-level assumptions in our security models are increasingly fragile.
Hardware security is often treated as the bedrock of the entire stack. We assume that if the kernel is secure and the hypervisor is patched, the underlying silicon will enforce the boundaries we define. That assumption just took a massive hit. The research presented on the T-Head XuanTie C910 processor shows that when a CPU implementation deviates from the expected behavior of its instruction set architecture, software-defined security boundaries become little more than suggestions.
The Mechanics of GhostWrite
At the heart of this issue is the CPU's handling of vector instructions. The researchers discovered that the C910 implementation of the RISC-V vector extension contains a flaw where specific instructions do not correctly respect the virtual memory translation layer. Instead of operating within the bounds of the process's virtual address space, these instructions can be coerced into writing directly to physical memory.
This is not a side-channel attack that requires thousands of samples to extract a single bit of entropy. This is a direct, high-speed, arbitrary memory write primitive. By manipulating the CPU state and executing these specific vector instructions, an attacker can overwrite kernel memory, modify page tables, or inject code into other processes. The researchers demonstrated this by patching page tables in real-time, effectively tricking the kernel into mapping a physical memory region belonging to a privileged process into the address space of an unprivileged user.
From Unprivileged User to Root
The demo shown at the conference was a masterclass in exploit development. The researchers started with a standard, unprivileged Linux user account. By executing a custom exploit binary that leveraged the GhostWrite primitive, they were able to locate the kernel's internal structures responsible for tracking user privileges.
Once the target memory address was identified, the exploit used the flawed vector instructions to overwrite the uid and gid fields of the current process. The result was instantaneous: the unprivileged shell became a root shell without triggering any standard authentication mechanisms like sudo. Because the manipulation happens at the hardware level, the operating system remains entirely unaware that its internal state has been compromised. You can find more details on the technical implementation and the research methodology at ghostwriteattack.com.
Why This Matters for Pentesters
For those of us conducting penetration tests or bug bounty research, this changes the threat model for embedded systems and cloud environments running on RISC-V. We are seeing an explosion of RISC-V adoption in IoT, edge computing, and increasingly, cloud infrastructure. If you are testing a device that uses a T-Head XuanTie C910 or related chips, you can no longer assume that a container or a sandbox provides meaningful isolation.
If you find yourself on a target running this hardware, your focus should shift from traditional software exploits to hardware-assisted privilege escalation. The ability to write to physical memory means that even if the software is hardened, the hardware provides a back door. This is particularly relevant when assessing OWASP Top 10 categories like Broken Access Control, as the hardware flaw essentially renders all software-based access control lists moot.
Mitigating the Unfixable
Defending against hardware bugs is notoriously difficult because you cannot simply push a patch to the silicon. The researchers proposed a mitigation that involves disabling the vulnerable vector extension entirely. While this effectively closes the exploit vector, the performance cost is severe. In their testing, disabling the extension resulted in a 33% performance overhead and the loss of roughly 50% of the CPU's vector instruction capabilities.
For most production environments, this is a non-starter. It highlights the tension between security and performance that we will continue to face as we move toward more diverse and custom CPU architectures. If you are managing infrastructure on these chips, your only real option is to isolate these systems physically or logically until a hardware revision is available.
The Future of Hardware Fuzzing
Perhaps the most important takeaway from this research is the power of differential fuzzing. The researchers didn't just stumble upon this bug; they used a grammar-based fuzzer to compare the behavior of multiple RISC-V implementations. By feeding the same instructions to different chips and observing where they diverged, they were able to isolate the specific instructions that were behaving incorrectly.
This technique is becoming essential for anyone working in hardware security. As we see more proprietary extensions and custom silicon hitting the market, the gap between the specification and the implementation will be a goldmine for researchers. We need to stop treating CPUs as black boxes and start applying the same rigorous testing methodologies to hardware that we have been applying to web applications for decades. If you want to dive deeper into the history and future of these vulnerabilities, check out the Microarchitecture Vulnerabilities talk resources. The era of assuming hardware is secure is over.
Vulnerability Classes
Target Technologies
All Tags
Up Next From This Conference
Similar Talks

Hacking Apple's USB-C Port Controller

Unmasking the Snitch Puck: The Creepy IoT Surveillance Tech in the School Bathroom




