CVE-Factory: Scaling Expert-Level Agentic Tasks for Code Security Vulnerability
Xianzhen Luo (PhD Student · Harbin Institute of Technology), Jingyuan Zhang, Shiqi Zhou, JinYang Huang, Chuan Xiao, Qingfu Zhu, Zhiyuan Ma, Yue Xing, Yang Yue, Wencong Zeng, Wanxiang Che
Overview
As AI-driven software development moves beyond basic code generation into complex, autonomous workflows, code security has emerged as a fundamental capability for AI agents. However, evaluating and training these agents for security tasks has been severely bottlenecked by data scarcity. While security communities maintain continuously updated Common Vulnerabilities and Exposures (CVE) databases, these records consist mostly of static metadata—such as short descriptions and reference URLs—rather than the executable environments required for rigorous agent evaluation. Manual reproduction of a single CVE into an interactive, executable task typically demands up to 10 hours of expert effort.

Key moments
- 0:00 Introduction and motivation for CVE-Factory
- 2:00 Workflow design and multi-agent decoupled architecture
- 4:43 Evaluation results on Patch-bench
- 6:26 Real-world CVE validation and Live-CVE-bench
- 8:22 Model training and generalization performance
- 10:00 Conclusion and Q&A session
CVE-Factory: Scaling Expert-Level Agentic Tasks for Code Security Vulnerability
Speakers: Xianzhen Luo (PhD Student, Harbin Institute of Technology); Jingyuan Zhang; Shiqi Zhou; JinYang Huang; Chuan Xiao; Qingfu Zhu; Zhiyuan Ma; Yue Xing; Yang Yue; Wencong Zeng; Wanxiang Che
Conference: ICML
YouTube: https://slideslive.com/39083751
Overview
As AI-driven software development moves beyond basic code generation into complex, autonomous workflows, code security has emerged as a fundamental capability for AI agents. However, evaluating and training these agents for security tasks has been severely bottlenecked by data scarcity. While security communities maintain continuously updated Common Vulnerabilities and Exposures (CVE) databases, these records consist mostly of static metadata—such as short descriptions and reference URLs—rather than the executable environments required for rigorous agent evaluation. Manual reproduction of a single CVE into an interactive, executable task typically demands up to 10 hours of expert effort.
This talk introduces CVE-Factory, a multi-agent framework designed to automatically scale the reproduction of real-world CVEs into high-quality, executable agentic tasks. By decoupling the generation process into specialized, isolated stages, CVE-Factory reduces the time required to build an expert-level security task from 10 hours down to approximately 48 minutes. Furthermore, the authors utilized the framework to generate Live-CVE-bench, a continuously updated benchmark reflecting modern software vulnerabilities (including complex multi-container and AI-toolchain exploits), and demonstrated that synthetic trajectories generated by CVE-Factory can effectively fine-tune models like DeepSeek-Coder-33B to significantly boost code security performance.
Background
▶ Watch: Introduction and motivation for CVE-Factory (0:00)
In the machine learning and systems engineering space, benchmarks like SWE-bench have transformed the evaluation of software engineering agents by providing real-world GitHub issues alongside test patches and execution environments. However, constructing SWE-bench tasks relies heavily on pre-existing pull requests (PRs) where the target repository, commit, environment configuration, and test patches are already explicitly defined.
CVE reproduction presents a fundamentally different and more difficult systems challenge. Raw CVE reports are typically non-executable and lack crucial development context. Recovering a functional CVE task requires determining the exact vulnerable repository version, reconstructing complex development settings, writing functional exploit patches, and establishing dynamic verification criteria. Furthermore, security environments frequently exceed the simplicity of a single Docker container, often involving multi-container network topologies (e.g., frontend, backend, and database services) spanning diverse programming languages and frameworks.
Relying on a single, monolithic large language model agent to perform end-to-end CVE reproduction consistently fails due to several systems-level failure modes: context window overflow from extensive build and install logs, catastrophic forgetting of early task constraints during long sessions, drifting verification criteria where agents accept weak evidence, and the cascading failure of dependent fixes where repairing an environment breaks a test or vice versa.
Key Findings
▶ Watch: Evaluation results on Patch-bench (4:43)
Evaluating CVE-Factory against Patch-bench—a collection of 130 expert-reproduced CVEs—revealed that the automated framework achieves parity with human engineering efforts across multiple dimensions:
- Solution Consistency: Running CVE-Factory solutions inside the Patch-bench environment with expert tests yielded a pass rate exceeding 95%.
- Environment Fidelity: Running expert solutions inside the CVE-Factory-generated environments yielded a pass rate exceeding 96%.
- Test Security Coverage: Because CVE-Factory generates comprehensive end-to-end tests featuring multiple entry points and synthetic variants rather than minimal reproduction scripts, over 17% of CVE-Factory-generated tests were judged equal to or better than expert-reproduced tests.
- Massive Speedup: Manual CVE reproduction averaging 10+ expert hours was compressed to roughly 48 minutes per CVE using CVE-Factory, representing a 6x to 30x speedup. Utilizing 20 concurrent workers enabled the reproduction of 215 CVEs in under 5 hours.
- Real-World Scaling: When sampled against over 500 uncurated CVEs from the CVE list (May–December 2023), and after filtering via a strict judge-agent and manual review, CVE-Factory achieved a validation pass rate of over 66%.
Technical Deep Dive
▶ Watch: Real-world CVE validation and Live-CVE-bench (6:26)
To overcome the instability of single-agent workflows, CVE-Factory organizes its generation pipeline into six distinct, decoupled stages. Each stage is operated by an independent cloud code agent running with an isolated context. Agents communicate exclusively by passing structured Markdown documents, preventing noise, debugging logs, and intermediate errors from contaminating downstream reasoning. Safety boundaries are enforced via execution hooks that restrict working directories and block dangerous system commands.
The workflow operates through the following architectural stages:
- Analyzer: Converts raw CVE JSON metadata into Markdown, searches the web, studies the vulnerability mechanics, and outputs an analysis blueprint.
- Generator: Produces core task artifacts, including natural-language instructions, test cases, and helper scripts, without requiring full validation at this juncture.
- Builder: Assembles the initial executable containerized environment.
- Validator: Executes a predefined
check-environment-readyscript to verify that the environment builds correctly, the vulnerable behavior is actively reproducible, and normal application functions operate as expected. The agent iteratively repairs environments or tests until passing criteria are met. - Solution Stage: Implements and verifies the functional exploit patch/root cause fix using parallel verification logic analogous to stage four.
- Checker: Performs holistic end-to-end validation, checking file integrity, environmental consistency, and ensuring that an external agent can successfully solve the generated task from scratch.
Experimental Setup & Results
▶ Watch: Model training and generalization performance (8:22)
Beyond the Patch-bench validation subset, the authors constructed Live-CVE-bench, a continuously updated benchmark derived from real-world CVE distributions. Live-CVE-bench introduces significant systems complexity: approximately 27% of its tasks require multi-container architectures, and roughly 10% involve emerging AI-related toolchains (such as vulnerabilities in PyTorch and LangChain).
Evaluating 10 prominent large language models across four distinct agent frameworks on Live-CVE-bench demonstrated that even the best model-agent combinations achieved pass rates below 50%, highlighting the severe difficulty of contemporary security tasks. An analysis of temporal distribution splits around model release boundaries revealed that agents struggle significantly more with post-release CVEs. Trajectory inspection showed that localization for post-release CVEs required an average of 10 steps to reach the first useful edit, compared to 6 steps for pre-release CVEs, indicating that unfamiliar codebases cause agents to burn context window budget on searching rather than fixing.
To test the utility of generated data for model improvement, the researchers synthesized approximately 1,000 tasks, distilling 18,000 training trajectories to fine-tune DeepSeek-Coder (33 billion parameters). Fine-tuning on this CVE-Factory dataset yielded performance gains on Live-CVE-bench, Patch-bench, and generalized positively to Terminal-bench, confirming that the generated tasks provide rich, long-horizon multi-step trajectories suitable for security alignment.
Practical Implications
▶ Watch: Conclusion and Q&A session (10:00)
For infrastructure teams and model developers, CVE-Factory demonstrates that scaling complex synthetic data generation pipelines is viable for domains previously reliant on scarce human expert labor. By decoupling agentic tasks into isolated stages, engineering teams can build robust pipelines that avoid the context-overflow and verification-drift failure modes common in monolithic LLM agents.
However, practitioners must note key limitations identified during the study. The dominant failure mode during real-world scaling (accounting for 187 failed cases) was the generation of "mock implementations." When faced with overly complex repositories or development settings, agents occasionally bypassed the real vulnerable program by substituting simplified mock services. While such tasks appeared executable, they failed to represent faithful security reproductions. Furthermore, models exhibited pronounced performance deficits on AI-related toolchain CVEs, whose coding styles and novel vulnerability patterns fall outside historical training distributions.
Key Takeaways
- Decoupled Multi-Agent Architecture: Splitting CVE reproduction into six isolated stages communicating via Markdown documents successfully prevents context overflow and verification drift.
- Significant Speedup: CVE-Factory reduces the human expert effort required to build a security task from 10 hours to roughly 48 minutes (a 6x to 30x speedup).
- High Fidelity: Generated solutions, environments, and tests match or exceed expert-level reproduction quality, achieving over 95% cross-validation pass rates against Patch-bench.
- Introduction of Live-CVE-bench: A new, highly complex benchmark featuring multi-container setups (27%) and AI toolchain vulnerabilities (10%) where top agent models currently score below 50%.
- Effective Downstream Training: Distilling 18,000 trajectories from ~1,000 synthetic tasks successfully fine-tuned DeepSeek-Coder-33B, improving performance across security and systems benchmarks.
About the Speaker(s)
- Xianzhen Luo (PhD Student, Harbin Institute of Technology): Fourth-year PhD student at Harbin Institute of Technology presenting research on automatically building realistic and executable security tasks for evaluating and training code agents.
Co-authors: Jingyuan Zhang, Shiqi Zhou, JinYang Huang, Chuan Xiao, Qingfu Zhu, Zhiyuan Ma, Yue Xing, Yang Yue, Wencong Zeng, Wanxiang Che.
Reviews
→ Top-rated talks at International Conference on Machine Learning 2026
All talks from International Conference on Machine Learning 2026