Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detection
Ira Ceka, Feitong Qiao, Anik Dey, Aastha Valecha, Gail Kaiser, Baishakhi Ray

TL;DR
This paper explores using large language model prompting as an alternative to static analysis tools for vulnerability detection in code, showing significant improvements in accuracy and reduction of false negatives.
Contribution
It introduces novel prompting strategies that combine natural language instructions with contrastive reasoning, outperforming traditional static analyzers in partial code vulnerability detection.
Findings
Prompting strategies outperform static analyzers in accuracy.
Significant improvements in F1-score and pairwise accuracy.
Reduction in false negative rates by up to 37.6%.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNetwork Security and Intrusion Detection
