Teams of LLM Agents can Exploit Zero-Day Vulnerabilities

Yuxuan Zhu, Antony Kellermann, Akul Gupta, Philip Li, Richard Fang, Rohan Bindu, Daniel Kang

TL;DR

Researchers have demonstrated that teams of LLM agents can autonomously exploit real-world "zero-day" vulnerabilities—security flaws unknown to the model during training. By using a hierarchical multi-agent framework called HPTSA, which coordinates specialized "expert" agents, the system achieved a 42% success rate on a benchmark of recent vulnerabilities, outperforming single-agent baselines by over 4x.

What Problem Does This Paper Address?

While Large Language Models (LLMs) have shown promise in cybersecurity—such as solving "Capture The Flag" (CTF) challenges or exploiting known vulnerabilities when provided with a detailed description—they typically fail in the zero-day (0DV) setting. In a 0DV scenario, the agent has no prior knowledge of the flaw and must explore a complex system, identify potential attack vectors, and execute a successful exploit from scratch.

Prior attempts using single LLM agents struggled for two main reasons:

  1. Planning and Backtracking: Agents often get "stuck" after a failed attempt, finding it difficult to backtrack and try a completely different class of vulnerability.
  2. Context Limits: Exploring a modern web application generates massive amounts of data (HTML, headers, logs), which quickly exhausts the limited context window of an LLM, leading to degraded reasoning and loss of the original goal.

Methods

The authors introduce HPTSA (Hierarchical Planning and Task-Specific Agents), a multi-agent framework designed to mirror how a human red-team operates.

Figure 1: Overall architecture diagram of HPTSA. We have other task-specific, expert agents beyond the ones in the diagram.

The architecture consists of three layers:

  • Hierarchical Planner: This agent explores the target environment (e.g., a website) to identify high-level attack surfaces. It determines which pages look suspicious and issues instructions to the next layer.
  • Team Manager: It receives instructions from the planner and decides which specialized expert agent to dispatch. It also maintains state, retrieving information from previous runs to refine instructions for subsequent attempts.
  • Task-Specific Expert Agents: These are specialized "mini-agents" designed for specific vulnerability classes like SQL Injection (SQLi), Cross-Site Scripting (XSS), CSRF, and SSTI.

Each expert agent is equipped with:

  • Specialized Tools: For example, the SQLi agent has access to sqlmap, while others use Playwright for browser interaction.
  • RAG (Retrieval-Augmented Generation): Agents have access to 5-6 curated documents describing their specific vulnerability class to provide "expert" context.
  • HTML Simplification: To manage context windows, the system strips irrelevant tags (like <img> or <svg>) from the HTML before passing it to the agents.

Datasets

The authors developed a new benchmark of 14 real-world vulnerabilities. To ensure these were true "zero-days" for the models, they only selected vulnerabilities published after the knowledge cutoff date of GPT-4 (specifically, vulnerabilities from early 2024).

The benchmark includes a variety of types (XSS, SQLi, CSRF, ACE) and severities (Medium to Critical) across open-source projects like flusity-CMS, Dolibarr, and Zabbix. Success was verified by manually checking agent traces to confirm a functional exploit was achieved.

Key Insights and Ideas

  • Hierarchy Solves the "Backtracking" Problem: By separating exploration from execution, the Planner can decide to abandon a failing XSS attempt and try a CSRF attack without the sub-agent needing to "remember" the entire history of the failure.
  • Specialization Beats Generality: Ablation studies showed that removing task-specific agents (replacing them with one "generic" hacker agent) halved the success rate. Expert agents are more robust because their prompts and tools are laser-focused.
  • Open-Source Models Lag Behind: While GPT-4 was effective, leading open-source models like Llama-3-405B and Qwen-2.5-72B failed to exploit a single vulnerability in this setting, often due to high refusal rates (safety filters) or repetitive, circular reasoning.
  • Context Management is Critical: The HTML simplification strategy was essential for keeping the agents focused and within token limits during long exploration phases.

Key Results

The performance gains of the multi-agent approach are substantial:

  • Success Rate: HPTSA (using GPT-4) achieved a 42% pass@5 success rate.
  • Comparison to Baselines: It outperformed a single GPT-4 agent (without a description) by 4.3x at pass@1.
  • Closing the Gap: HPTSA performed within 1.8x of an agent that was given the full vulnerability description (the "one-day" setting).
  • Traditional Tools: Standard open-source vulnerability scanners like ZAP and MetaSploit achieved 0% success on this specific benchmark.
Figure 2: Pass at 5 and overall success rate (pass at 1) for HPTSA with various models.
  • Cost: The average cost per successful exploit was approximately **$24.40**. While higher than a single-agent run, it is significantly cheaper than the estimated cost of a human expert (~$75 for 1.5 hours of work).

Limitations and Future Work

  • Scope: The study focused exclusively on web-based vulnerabilities. Exploiting binary vulnerabilities or complex network protocols remains an open challenge.
  • Discovery: The agents struggled when the "path" to a vulnerability was not easily discoverable via standard navigation (e.g., hidden API endpoints not mentioned in public docs).
  • Model Dependency: The system relies heavily on the reasoning capabilities of top-tier proprietary models. As open-source models improve, the authors hope to migrate the framework to them.
  • Ethics: The authors acknowledge the dual-use nature of this work. They have chosen not to release their specific prompts or code publicly and have shared their findings with OpenAI to help improve model safety.

Summary updated

Abstract

LLM agents have become increasingly sophisticated, especially in the realm of cybersecurity. Researchers have shown that LLM agents can exploit real-world vulnerabilities when given a description of the vulnerability and toy capture-the-flag problems. However, these agents still perform poorly on real-world vulnerabilities that are unknown to the agent ahead of time (zero-day vulnerabilities). In this work, we show that teams of LLM agents can exploit real-world, zero-day vulnerabilities. Prior agents struggle with exploring many different vulnerabilities and long-range planning when used alone. To resolve this, we introduce HPTSA, a system of agents with a planning agent that can launch subagents. The planning agent explores the system and determines which subagents to call, resolving long-term planning issues when trying different vulnerabilities. We construct a benchmark of 14 real-world vulnerabilities and show that our team of agents improve over prior agent frameworks by up to 4.3X.
BibTeX
@misc{zhu2024teams,
  author = {Yuxuan Zhu and Antony Kellermann and Akul Gupta and Philip Li and Richard Fang and Rohan Bindu and Daniel Kang},
  title = {{Teams of LLM Agents can Exploit Zero-Day Vulnerabilities}},
  year = {2024},
  eprint = {2406.01637},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.01637},
}
Figure