mlsanityData to 7 Oct 2026

Chain-of-Thought Prompting of Large Language Models for Discovering and Fixing Software Vulnerabilities

arXiv 2402.17230 ↗First posted 27 Feb 2024cs.CRcited by 31

Not on the map. Why?

Abstract (arXiv)

Security vulnerabilities are increasingly prevalent in modern software and they are widely consequential to our society. Various approaches to defending against these vulnerabilities have been proposed, among which those leveraging deep learning (DL) avoid major barriers with other techniques hence attracting more attention in recent years. However, DL-based approaches face critical challenges including the lack of sizable and quality-labeled task-specific datasets and their inability to generalize well to unseen, real-world scenarios. Lately, large language models (LLMs) have demonstrated impressive potential in various domains by overcoming those challenges, especially through chain-of-thought (CoT) prompting. In this paper, we explore how to leverage LLMs and CoT to address three key software vulnerability analysis tasks: identifying a given type of vulnerabilities, discovering vulnerabilities of any type, and patching detected vulnerabilities. We instantiate the general CoT methodology in the context of these tasks through VSP , our unified, vulnerability-semantics-guided prompting approach, and conduct extensive experiments assessing VSP versus five baselines for the three tasks against three LLMs and two datasets. Results show substantial superiority of our CoT-inspired prompting (553.3%, 36.5%, and 30.8% higher F1 accuracy for vulnerability identification, discovery, and patching, respectively, on CVE datasets) over the baselines. Through in-depth case studies analyzing VSP failures, we also reveal current gaps in LLM/CoT for challenging vulnerability cases, while proposing and validating respective improvements.

Key facts. Cited by 31 papers in the map (data through 7 Oct 2026). First posted on arXiv 27 Feb 2024.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 8; 2025: 12; 2026: 11.

31 papers.

Sort:

By area:

  1. 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 67
  2. 2024Multi-role Consensus through LLMs Discussions for Vulnerability Detectioncited by 19
  3. 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 17
  4. 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Studycited by 17
  5. 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Studycited by 11
  6. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
  7. 2025VulAgent: Hypothesis-Validation based Multi-Agent Vulnerability Detectioncited by 8
  8. 2025R2Vul: Learning to Reason about Software Vulnerabilities with Reinforcement Learning and Structured Reasoning Distillationcited by 7
  9. 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinementcited by 6
  10. 2026Co-RedTeam: Orchestrated Security Discovery and Exploitation with LLM Agentscited by 6
  11. 2025Can LLMs Handle WebShell Detection? Overcoming Detection Challenges with Behavioral Function-Aware Frameworkcited by 5
  12. 2025AutoPatch: Multi-Agent Framework for Patching Real-World CVE Vulnerabilitiescited by 4
19 more
  1. 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specificationscited by 4
  2. 2026DREA: Decoupled Reasoning and Exploration Agents for Repository-Level Vulnerability Detectioncited by 3
  3. 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
  4. 2024A Qualitative Study on Using ChatGPT for Software Security: Perception vs. Practicalitycited by 2
  5. 2025XiHeFusion: Harnessing Large Language Models for Science Communication in Nuclear Fusioncited by 2
  6. 2025Llama-based source code vulnerability detection: Prompt engineering vs Fine tuningcited by 2
  7. 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agentscited by 2
  8. 2025Fine-Tuning LLMs to Analyze Multiple Dimensions of Code Review: A Maximum Entropy Regulated Long Chain-of-Thought Approachcited by 1
  9. 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detectioncited by 1
  10. 2026PromptAudit: Auditing Prompt Sensitivity in LLM-Based Vulnerability Detectioncited by 1
  11. 2026Enhancing Reliability in LLM-Based Secure Code Generationcited by 1
  12. 2025ReVul-CoT: Towards Effective Software Vulnerability Assessment with Retrieval-Augmented Generation and Chain-of-Thought Promptingcited by 0
  13. 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
  14. 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Developmentcited by 0
  15. 2026Generating Place-Based Compromises Between Two Points of Viewcited by 0
  16. 2026Representation Matters: An Empirical Study of Program Representations for LLM Vulnerability Reasoningcited by 0
  17. 2026Evaluating Large Language Models for Symbolic Security Protocol Analysiscited by 0
  18. 2026Reveree: Diagnosing LLM Reverse-Engineering Agentscited by 0
  19. 2026Exploring Automated Vulnerability Identification in JavaScript Code Using Large Language Modelscited by 0