CyberBinGym: Can AI Agents Turn Binary Patches into Real Exploits?
Lambang Akbar Wijayadi, Zhaoqi Xiao, Zhun Wang, Hongwei Li, Wenbo Guo, Heng Yin, Zhenkai Liang, Dawn Song
cs.CR, cs.AI, cs.LG
2026-11-07
On 100 real bugs, agents get only stripped binary pairs. Codex recovers 88% and exploits 20%; the patch lifts exploits from 10% to 25%.
The risky interval is the one after a binary patch is released and before it is actually installed. Deployment often stretches for months or years. Nearly two months after Heartbleed, 3% of HTTPS sites in the Alexa Top 1 Million were still vulnerable. In that window, comparing the patched binary with the old one shows what the fix changed and can point to an exploit. The paper calls this the 1-day setting: the published patch is the main clue, and the target is still on the old build.
By hand, that work takes a reverse engineer days or weeks. Existing agent benchmarks do not measure it. CTF suites use synthetic challenges. CyberGym, CVE-Bench, and ExploitGym mostly supply source code or a web interface. BinMetric and REBench score decompilation or symbol recovery and never require a working exploit. Compilation drops names, types, and comments, and real disassemblers make mistakes. The agent has to tie decompiler output to execution feedback, then turn a crash into control of program state.
CyberBinGym comes from NUS, UC Riverside, UC Santa Barbara, and UC Berkeley. It has 100 tasks from 53 open-source projects across imaging and documents, networking, compression, and cryptography. Curators start from CyberGym, OSS-Fuzz, and ARVO build artifacts, recompile both versions, and strip sanitizer instrumentation, symbols, and debug info. A private PoC must still fail only on the vulnerable build. That filter left 604 pairs; the release draws 100. Source diffs never enter the task package.
The agent receives the two stripped binaries and their runtime dependencies. One container runs Ghidra and Radare2. Another keeps the historical runtime and includes GDB and Valgrind. A victim service on an internal network runs the vulnerable program as an unprivileged user, with a root-owned flag. A proxy allows model APIs, PyPI, and distro repositories. Web search is disabled. Source, bug descriptions, and reference PoCs are withheld.
The two scores are independent. Recovery demands an input that trips the target sanitizer failure on a hidden vulnerable build and leaves the patched build clean. Exploitation demands the flag from the victim, then a manual trajectory audit. Reading the evaluation environment directly, or using a command-execution feature the program already had, does not count.
The mix is 40 spatial memory errors, 20 temporal, 15 invalid-pointer, 10 invalid-deallocation, 9 initialization, and 6 type-safety. Rarer classes are upweighted so lifetime, deallocation, and type recovery can be measured. A five-part rubric yields 20% low, 40% medium, and 40% high complexity. Vulnerable binaries have a median size of 1.60 MiB, a maximum of 38.04 MiB, and a median of 2,794 functions recovered by Ghidra. The main runs turn ordinary hardening off, to probe the capability boundary. The nominal budget is 1,000 model calls per trajectory.
All three agents received both binaries and no vulnerability description.
| Agent | Recover | Exploit | Cost | Time |
| Codex / GPT-5.6 | 88/100 (88%) | 20/100 (20%) | $28.11 | 2.13 h |
| Claude Code / Opus 5 | 85/100 (85%) | 6/100 (6%) | $14.90 | 1.26 h |
| Kimi Code / Kimi K3 | 64/100 (64%) | 0/100 (0%) | $38.34 | 5.80 h |
Kimi spends the most and runs the longest, and still exploits nothing. Recovery beats exploitation by 64 to 79 percentage points. On the 22 tasks at least one agent exploited, Codex, Claude, and Kimi still stopped at a crash on 2, 13, and 17 tasks. The split is control after corruption.
On 20 matched tasks, Codex with only the vulnerable binary posted a 55% PoC rate, a 10% exploit rate, and a mean cost of $36.59. Adding the patched binary moved those numbers to 90%, 25%, and $31.42. Of 26 successful trajectories, patch differences pointed directly at the exploited bug in 17, only changed where the agent searched in 7, and had no clear link in 2.
A written bug description does not reliably help. On 50 tasks it lifted Kimi from 64% to 70% recovery and produced one exploit, while Codex fell from 90% and 24% to 86% and 20%. Maximum reasoning, on 20 tasks, moved Codex from 6/20 PoCs and 0 exploits to 18/20 and 5/20, with mean cost rising from $2.33 to $31.42. Three independent runs give Success@k of 68.3%, 83.3%, and 90.0% for PoCs, and 11.7%, 20.0%, and 25.0% for exploits, at $106.59 for the three runs. Extra samples mostly recover from a bad trajectory.
Codex exploited 8/15 invalid-pointer tasks and 6/20 temporal bugs, against 4/40 spatial bugs. It reproduced all 10 invalid-deallocation bugs and exploited one. It exploited no type-safety task. Higher task complexity did not mean fewer exploits: 3/20 (15%) on the low bin, 11/40 (27.5%) on the high bin. Each bin has only 20 to 40 tasks, which is too few to conclude that larger programs are easier.
The 20 tasks Codex had exploited were rebuilt with stack canaries, PIE, full RELRO, non-executable stacks, and Fortify. Recovery fell to 15/20 and exploitation to 2/20. Both survivors change writable non-stack state and reuse existing code, avoiding return addresses and the GOT. Search variation and service-delivery failures are mixed into that drop.
About $28 and a little over two hours produces an old-version-only trigger on 88% of tasks and an audited flag on 20%. The patch itself raises the exploit rate from 10% to 25% on a 20-task subset and slightly lowers cost. A compiled update is usable intelligence while deployment is still unfinished.
That 20% is a boundary measurement: hardening off, victim controlled. The same 20 successes shrink to 2 once standard hardening is on. Defenders can run the same comparison on third-party binaries, without source, to rank patches and test mitigations.
Coverage is memory safety only. Logic bugs and web vulnerabilities are out. The victims are controlled services built from historical bugs, so the rates are not production compromise rates and not time-to-exploit for a patch that just shipped. Inspected traces showed no obvious memorization. Stripping and recompiling reduce direct leakage; there is no obfuscation control, so familiarity with these projects is still untested.
Patch-influence labels were assigned by GPT-5.6 on 26 successful trajectories and say nothing about failed attempts. The hardening comparison folds in search noise and service failures. The rubric caps PoC-construction complexity at one point, so heap layout and multi-stage exploits are not a harder track. Type safety has six tasks. Reward-hacking review is manual. Protections were turned off on purpose. The claim that holds is the narrow one: in this controlled setup, working exploits already appear, and they are not reliable.