A Systematic Study on Generating Web Vulnerability Proof-of-Concepts Using Large Language Models

Mengyao Zhao, Kaixuan Li, Lyuye Zhang, Wenjing Dang, Chenggong Ding, Sen Chen, Zheli LiuarXiv 2025 · DOI

TL;DR

This paper presents the first systematic study on using Large Language Models (LLMs) to automatically generate Proof-of-Concept (PoC) exploits for web vulnerabilities from publicly available information. The research demonstrates that LLMs can generate functional PoCs with varying success rates depending on the disclosure stage and context provided, highlighting both the potential and limitations of this technology for cybersecurity.

What Problem Does This Paper Address?

Reproducing and understanding software vulnerabilities is crucial for security. A Proof-of-Concept (PoC) exploit is key for this, but many disclosed vulnerabilities lack usable PoCs, forcing manual reverse engineering. While previous PoC generation tools focused on zero-day exploits, this paper investigates whether LLMs can leverage the increasing amount of public information (descriptions, patches, code) released with disclosed Common Vulnerabilities and Exposures (CVEs) to automatically generate valid PoCs. This addresses the gap in understanding LLM capabilities for real-world vulnerability disclosure workflows, which evolve over time.

Methods

The authors conducted a progressive, four-phase empirical study using two LLMs: GPT-4o and DeepSeek-R1. Their methodology involved:

  1. Baseline Effectiveness (RQ1): Evaluating LLMs' ability to generate PoCs using only public information at three stages of vulnerability disclosure: description-only (S1), description + patch (S2), and description + patch + vulnerable file (S3).
  2. Failure Analysis (RQ2): Decomposing the PoC generation process into specific sub-tasks (attack vector crafting, navigation path generation, PoC assembly) to pinpoint failure causes.
  3. Context Supplementation (RQ3): Enhancing LLM performance by providing additional vulnerability and navigation context at both file-level and function-level granularities.
  4. Adaptive Reasoning (RQ4): Improving effectiveness by employing advanced prompting strategies like Chain-of-Thought (CoT) and in-context learning (ICL), along with real-time feedback mechanisms.

Datasets

The study utilized a benchmark of 100 real-world and reproducible CVEs spanning five web vulnerability categories: CWE-78 (OS Command Injection), CWE-79 (Cross-site Scripting), CWE-89 (SQL Injection), CWE-352 (Cross-Site Request Forgery), and CWE-434 (Unrestricted File Upload). These CVEs were selected from the National Vulnerability Database (NVD) between 2017 and 2024, with a CVSS3 score above 4.0. The dataset was curated through a rigorous reproduction process requiring over 600 man-hours for environment setup and 121+ man-hours for PoC validation.

Key Insights and Ideas

  • Public Information is Sufficient (Sometimes): Even with just a vulnerability description, LLMs can generate valid PoCs, indicating a new paradigm for PoC generation.
  • Context is King: The more context provided (patches, code), the significantly higher the success rate. Function-level context proved more beneficial than file-level.
  • Adaptive Reasoning Boosts Performance: Advanced prompting techniques like CoT and ICL, combined with feedback loops, dramatically improve LLM performance, especially for models that initially lag.
  • LLMs Struggle with Complex Chains: While LLMs show promise, they still face challenges with vulnerabilities requiring intricate exploit chains, complex dynamic routing, or strict syntax constraints.
  • DeepSeek-R1's Reasoning Edge: DeepSeek-R1, with its structured reasoning process, often outperformed GPT-4o, particularly when given more context, though GPT-4o showed greater improvement with adaptive prompting.
  • Payload Diversity Varies: DeepSeek-R1 generated more diverse and complex attack payloads compared to GPT-4o, which tended towards simpler patterns.

Key Results

  • Baseline Success: LLMs generated functional PoCs for 8% to 34% of vulnerabilities using only public information, with DeepSeek-R1 generally outperforming GPT-4o.
  • Contextual Gains: Supplementing with code context improved success rates by 17%-20%, with function-level context yielding a 9%-13% improvement over file-level.
  • Adaptive Prompting Impact: Integrating adaptive reasoning strategies boosted success rates to 68%-72%, with GPT-4o showing a substantial 30.0% improvement and DeepSeek-R1 a 18.0% gain.
  • Failure Causes: The primary reasons for failure were context deficiency (missing vulnerability or navigation context) and capability limitations (identification and reasoning).
  • Practical Validation: 23 newly generated PoCs were accepted by NVD and Exploit DB, confirming the practical utility of the LLM-generated exploits.

Limitations and Future Work

  • Data Leakage: The authors acknowledge the potential for LLM data leakage but found that prompting with CVE IDs alone did not lead to accurate PoCs, suggesting limited reliance on direct memory retrieval.
  • Generalizability: The study focused on five specific CWE types and PHP applications. Future work could explore a wider range of vulnerability types and programming languages.
  • Manual Effort: While LLMs automate PoC generation, the manual effort for reproducing vulnerabilities and constructing detailed contexts (file/function level) remains significant.
  • End-to-End Automation: Real-time feedback mechanisms for validation still require some manual intervention, and automating the reproduction and validation of PoCs across diverse environments remains an open challenge.
  • Reasoning Bottlenecks: LLMs still struggle with complex, multi-step reasoning required for certain vulnerabilities. Integrating dynamic analysis or symbolic execution could be beneficial.
  • Knowledge Augmentation: Exploring how to effectively leverage broader auxiliary information (discussions, comments, threat intelligence) to enhance LLM performance is a promising direction.

Summary updated

BibTeX
@misc{zhao2025systematic,
  author = {Mengyao Zhao and Kaixuan Li and Lyuye Zhang and Wenjing Dang and Chenggong Ding and Sen Chen and Zheli Liu},
  title = {{A Systematic Study on Generating Web Vulnerability Proof-of-Concepts Using Large Language Models}},
  year = {2025},
  eprint = {2510.10148},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.10148},
}
Figure