Everything You Wanted to Know About LLM-based Vulnerability Detection But Were Afraid to Ask
Not on the map. Why?
Abstract (arXiv)
Large Language Models are a promising tool for automated vulnerability detection, thanks to their success in code generation and repair. However, despite widespread adoption, a critical question remains: Are LLMs truly effective at detecting real-world vulnerabilities? Current evaluations, which often assess models on isolated functions or files, ignore the broader execution and data-flow context essential for understanding vulnerabilities. This oversight leads to two types of misleading outcomes: incorrect conclusions and flawed rationales, collectively undermining the reliability of prior assessments. Therefore, in this paper, we challenge three widely held community beliefs: that LLMs are (i) unreliable, (ii) insensitive to code patches, and (iii) performance-plateaued across model scales. We argue that these beliefs are artifacts of context-deprived evaluations. To address this, we propose CORRECT (Context-Rich Reasoning Evaluation of Code with Trust), a new evaluation framework that systematically incorporates contextual information into LLM-based vulnerability detection. We construct a context-rich dataset of 2,000 vulnerable-patched program pairs spanning 99 CWEs and evaluate 13 LLMs across four model families. Our framework elicits both binary predictions and natural-language rationales, which are further validated using LLM-as-a-judge techniques. Our findings overturn existing misconceptions. When provided with sufficient context, SOTA LLMs achieve significantly improved performance (e.g., 0.7 F1-score on key CWEs), with 0.8 precision. We show that most false positives stem from reasoning errors rather than misclassification, and that while model and test-time scaling improve performance, they introduce diminishing returns and trade-offs in recall. Finally, we uncover new flaws in current LLM-based detection systems, such as limited generalization and overthinking biases.
Key facts. Cited by 15 papers in the map (data through 14 Oct 2026). First posted on arXiv 18 Apr 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 7; 2026: 8.
15 papers.
Sort:
By area:
- 2026SkillProbe: Security Auditing for Emerging Agent Skill Marketplaces via Multi-Agent Collaborationcited by 21
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metricscited by 12
- 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinementcited by 6
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specificationscited by 4
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detectioncited by 4
- 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
- 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimizationcited by 3
- 2026CTFExplorer: Evaluating LLM Offensive Agents Through Multi-Target Web CTF Benchmarkingcited by 3
- 2026DREA: Decoupled Reasoning and Exploration Agents for Repository-Level Vulnerability Detectioncited by 3
- 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detectioncited by 1
- 2025Security smells in infrastructure as code: a taxonomy update beyond the seven sinscited by 0
- 2025Detection of security smells in IaC scripts through semantics-aware code and language processingcited by 0
- 2026DREA: Decoupled Reasoning and Exploration Agents for Repository-Level Vulnerability Detection15 Jul 2026
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilities14 Jul 2026
- 2026FlowArk: Boosting Agentic Data-flow Analysis for Android Apps via Context-Aware Knowledge Reuse13 Jul 2026
- 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detection18 May 2026
- 2026Teaching LLMs Program Semantics via Symbolic Execution Traces7 May 2026
- 2026SkillProbe: Security Auditing for Emerging Agent Skill Marketplaces via Multi-Agent Collaboration22 Mar 2026
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detection15 Feb 2026
- 2026CTFExplorer: Evaluating LLM Offensive Agents Through Multi-Target Web CTF Benchmarking8 Feb 2026
- 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimization14 Nov 2025
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specifications6 Nov 2025
- 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinement30 Sep 2025
- 2025Detection of security smells in IaC scripts through semantics-aware code and language processing23 Sep 2025
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specificationscited by 4
- 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimizationcited by 3
- 2026DREA: Decoupled Reasoning and Exploration Agents for Repository-Level Vulnerability Detectioncited by 3
- 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detectioncited by 1
- 2026DREA: Decoupled Reasoning and Exploration Agents for Repository-Level Vulnerability Detection15 Jul 2026
- 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detection18 May 2026
- 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimization14 Nov 2025
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specifications6 Nov 2025
- 2026SkillProbe: Security Auditing for Emerging Agent Skill Marketplaces via Multi-Agent Collaborationcited by 21
- 2026CTFExplorer: Evaluating LLM Offensive Agents Through Multi-Target Web CTF Benchmarkingcited by 3
- 2026FlowArk: Boosting Agentic Data-flow Analysis for Android Apps via Context-Aware Knowledge Reusecited by 0
- 2026FlowArk: Boosting Agentic Data-flow Analysis for Android Apps via Context-Aware Knowledge Reuse13 Jul 2026
- 2026SkillProbe: Security Auditing for Emerging Agent Skill Marketplaces via Multi-Agent Collaboration22 Mar 2026
- 2026CTFExplorer: Evaluating LLM Offensive Agents Through Multi-Target Web CTF Benchmarking8 Feb 2026
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metricscited by 12
- 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinementcited by 6
- 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
- 2025Security smells in infrastructure as code: a taxonomy update beyond the seven sinscited by 0
- 2025Detection of security smells in IaC scripts through semantics-aware code and language processingcited by 0
- 2026Teaching LLMs Program Semantics via Symbolic Execution Tracescited by 0
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilitiescited by 0
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilities14 Jul 2026
- 2026Teaching LLMs Program Semantics via Symbolic Execution Traces7 May 2026
- 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinement30 Sep 2025
- 2025Detection of security smells in IaC scripts through semantics-aware code and language processing23 Sep 2025
- 2025Security smells in infrastructure as code: a taxonomy update beyond the seven sins23 Sep 2025
- 2025Revisiting Pre-trained Language Models for Vulnerability Detection22 Jul 2025
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metrics24 May 2025