Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detection
Not on the map. Why?
Abstract (arXiv)
Despite their remarkable success, large language models (LLMs) have shown limited ability on safety-critical code tasks such as vulnerability detection. Typically, static analysis (SA) tools, like CodeQL, CodeGuru Security, etc., are used for vulnerability detection. SA relies on predefined, manually-crafted rules for flagging various vulnerabilities. Thus, effectiveness of SA in detecting vulnerabilities depends on human experts and is known to report high error rates. In this study we investigate whether LLM prompting can be an effective alternative to these static analyzers in the partial code setting. We propose prompting strategies that integrate natural language instructions of vulnerabilities with contrastive chain-of-thought reasoning, augmented using contrastive samples from a synthetic dataset. Our findings demonstrate that security-aware prompting techniques can be effective alternatives to the laborious, hand-crafted rules of static analyzers, which often result in high false negative rates in the partial code setting. When leveraging SOTA reasoning models such as DeepSeek-R1, each of our prompting strategies exceeds the static analyzer baseline, with the best strategies improving accuracy by as much as 31.6%, F1-scores by 71.7%, pairwise accuracies by 60.4%, and reducing FNR by as much as 37.6%.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 29 of its 40 references that are in the map. First posted on arXiv 16 Dec 2024.
Builds on
29 of 40 references.
References · 29
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2023StarCoder: may the source be with you!cited by 790
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
- 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
- 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 94
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 89
17 more
- 2023How Secure is Code Generated by ChatGPT?cited by 77
- 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 58
- 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
- 2023ChatGPT for Vulnerability Detection, Classification, and Repair: How Far Are We?cited by 44
- 2024Finetuning Large Language Models for Vulnerability Detectioncited by 39
- 2022LineVD: Statement-level Vulnerability Detection using Graph Neural Networkscited by 35
- 2024Generalization-Enhanced Code Vulnerability Detection via Multi-Task Instruction Fine-Tuningcited by 30
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 29
- 2023How Far Have We Gone in Vulnerability Detection Using Large Language Modelscited by 27
- 2022Detecting False Alarms from Automatic Static Analysis Tools: How Far are We?cited by 16
- 2024Just another copy and paste? Comparing the security vulnerabilities of ChatGPT generated code and StackOverflow answerscited by 12
- 2017Stack Overflow in Github: Any Snippets There?cited by 5
- 2024From Generalist to Specialist: Exploring CWE-Specific Vulnerability Detectioncited by 3
- 2024Beyond Dependencies: The Role of Copy-Based Reuse in Open Source Software Developmentcited by 3
- 2024RealVul: Can We Detect Vulnerabilities in Web Applications with LLM?cited by 3
- 2023How Do Java Developers Reuse StackOverflow Answers in Their GitHub Projects?cited by 2
- 2021Symbolic Security Predicates: Hunt Program Weaknessescited by 1
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.
- 2025Can LLMs Handle WebShell Detection? Overcoming Detection Challenges with Behavioral Function-Aware Frameworkcited by 5
- 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detectioncited by 1
- 2026JevVibe: Efficient Classification-Guided Secure Code Generationcited by 0
- 2026JevVibe: Efficient Classification-Guided Secure Code Generation28 Sep 2026
- 2026Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detection18 May 2026
- 2025Can LLMs Handle WebShell Detection? Overcoming Detection Challenges with Behavioral Function-Aware Framework14 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoning
- 2026PromptAudit: Auditing Prompt Sensitivity in LLM-Based Vulnerability Detection
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning
- 2024An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factors
- 2024Towards Explainable Vulnerability Detection with Large Language Models
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specifications
- 2026Using LLMs to Adjudicate Static-Analysis Alerts with Error Reduction Techniques ↗