TL;DR
This paper introduces KEX-bench, the first benchmark designed to evaluate AI coding agents on their ability to generate precise exploit primitives against real-world Linux and Windows kernels. The evaluation reveals a significant "trigger-to-primitive" gap: while frontier models can easily trigger kernel crashes, they struggle to carefully manipulate kernel memory states to build reliable exploits without a reference proof-of-concept (PoC).
What Problem Does This Paper Address?
AI agents are increasingly adept at finding software vulnerabilities. However, autonomously discovering a bug or causing a generic system crash is a far cry from weaponizing it into a functional exploit.
Real-world kernel exploitation requires bypassing advanced mitigations (like KASLR), navigating complex heap layouts, and maintaining system stability while gaining precise control over memory. Existing benchmarks either rely on simplified Capture-The-Flag (CTF) challenges or focus purely on user-space and web applications. KEX-bench addresses this gap by providing a rigorous, deterministic framework to evaluate whether AI agents can turn real kernel bugs into controlled exploit primitives under hardware privilege boundaries.
Methods
The authors designed a unified evaluation pipeline that abstracts both Linux and Windows environments into a common workflow.
Key components of their methodology include:
- Model Context Protocol (MCP): Agents interact exclusively through MCP, which exposes platform-specific tools (such as GDB, PyGhidra, and WinDbg) while enforcing strict tool-call budgets.
- Isolated Environments: Each task runs inside an isolated virtual machine (QEMU/KVM) starting from a clean kernel state.
- Deterministic Verifiers: Instead of relying on agent self-reporting or simple crash detection, KEX-bench uses external verifiers to inspect the actual kernel state. For example, verifying an instruction-pointer (RIP) control primitive requires scanning the kernel ring buffer for a randomly generated target address.
- Two Evaluation Settings: Agents are tested without a reference PoC (w/o PoC), given only the vulnerability description and security patch, and with a reference PoC (w/ PoC) as a starting point.
Datasets
KEX-bench introduces a newly curated dataset consisting of 45 task instances across 40 real-world Linux and Windows CVEs (spanning kernel versions 5.x through 6.x).
The benchmark covers five critical exploit primitives:
- LEAK: Leaking randomized kernel text base addresses to defeat KASLR.
- RIP: Diverting kernel control flow to a verifier-selected target address.
- HEAPR / HEAPW: Reading or overwriting a monitored heap chunk created by a custom verifier module.
- AAW (Arbitrary Address Write): Writing a verifier-chosen 64-bit value to a verifier-chosen kernel address (the primary focus for the Windows tasks).
Key Insights and Ideas
- The Trigger-to-Primitive Gap: The primary bottleneck for AI agents is not reaching the vulnerability, but shaping the resulting memory corruption into a controlled primitive. Agents frequently trigger KASAN reports or kernel panics but fail to achieve the precise state manipulation required for exploitation.
- Scaffold Architecture Matters: Even when using the exact same underlying LLM (e.g., Claude 3.5 Sonnet), different agent frameworks (scaffolds) yield vastly different success rates due to how they coordinate the analyze-execute-verify loop.
- Short Paths Equal Success: Tasks with compact, direct paths from the bug trigger to the verifier's target state are significantly easier for agents to solve. Complex heap layouts or race conditions cause failure rates to skyrocket.
Key Results
- Without a Reference PoC: The strongest configuration (CLAUDECODE paired with Claude 3.5 Opus 4.6) solved 56.0% (14/25) of Linux tasks but only 5.0% (1/20) of Windows tasks.
- With a Reference PoC: Providing a starting PoC nearly tripled the overall success rate, allowing the top configuration to solve 68.9% (31/45) of the combined tasks.
- Primitive Difficulty: Windows AAW tasks proved to be the most challenging due to the closed-source nature of the drivers and the strict requirements of the write-what-where verifier.
Limitations and Future Work
- Statistical Scope: The main evaluation matrix relies on single bounded trajectories per configuration, meaning run-to-run stochastic variation isn't fully captured across all models.
- Platform and Primitive Confounding: In the current dataset, the four Linux primitives do not overlap with Windows, and Windows focuses exclusively on AAW, making it difficult to completely isolate operating system effects from primitive difficulty.
- Contamination Risk: Because the benchmark uses public CVEs, models may retain prior knowledge from their training data, though randomized verifier targets prevent direct replay of stale exploits.
- Future Directions: The authors plan to expand KEX-bench to include primitive chaining (end-to-end exploit chains), new mitigations, and rolling post-cutoff coverage to stay ahead of model training data.
Summary updated