A Collaborative Software Vulnerability Detection Method Based on Large Language Models and Static Analysis

Main Article Content

Daiqi Li

Keywords

vulnerability detection, static analysis, large language model, Semgrep, false-positive filtering

Abstract

Software vulnerability detection is a key step in ensuring software security. Static code analysis tools offer broad coverage and easy integration, but have relatively high false-positive rates, requiring security personnel to invest substantial effort in manual screening. Direct detection with a large language model (LLM), although capable of strong code comprehension, tends to over-report, and its decision process lacks interpretability. To address these problems, this study proposes a collaborative software vulnerability detection method using static analysis and an LLM. First, the static analysis tool Semgrep scans source code to recall candidate alerts. DeepSeek then semantically reviews each alert to filter false positives. Experimental results on the Open Worldwide Application Security Project (OWASP) Benchmark dataset show that, compared with static analysis alone, the proposed method increases precision from 65.7% to 84.8% and reduces the false-positive rate from 39.2% to 13.1%, while recall decreases by only about 2 percentage points. Compared with the LLM-only method, the false-positive rate decreases from 72.0% to 16.1%. These results show that collaboration between static analysis and an LLM can effectively reduce the false-positive rate at a small cost in recall, providing empirical evidence for applying LLMs to code security.

Abstract 25 | PDF Downloads 18

References

  • [1]Li H, Zhang H, Pei K, et al. Towards More Accurate Static Analysis for Taint-Style Bug Detection in Linux Kernel[C]//Proceedings of the 40th IEEE/ACM International Conference on Automated Software Engineering (ASE 2025). Piscataway: IEEE, 2025: 380-392. DOI: 10.1109/ASE63991.2025.00039.
  • [2]Bašić E, Giaretta A. From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security[EB/OL]. arXiv preprint arXiv:2412.15004, 2024.
  • [3]Kaniewski S, Schmidt F, Enzweiler M, et al. A Systematic Literature Review on Detecting Software Vulnerabilities with Large Language Models[EB/OL]. arXiv preprint arXiv:2507.22659, 2025. DOI: 10.1145/3815425.
  • [4]Sheng Z, Chen Z, Gu S, et al. LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insights[EB/OL]. arXiv preprint arXiv:2502.07049, 2025.
  • [5]Wang J, Ni T, Lee W B, et al. A Contemporary Survey of Large Language Model Assisted Program Analysis[EB/OL]. arXiv preprint arXiv:2502.18474, 2025.
  • [6]Hu S, Huang T, Ilhan F, et al. Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectives[C]//Proceedings of the IEEE International Conference on Trust, Privacy and Security in Intelligent Systems, and Applications (TPS-ISA 2023). Piscataway: IEEE, 2023: 297-306. DOI: 10.1109/TPS-ISA58951.2023.00044.
  • [7]Sun Y, Wu D, Xue Y, et al. GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis[C]//Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (ICSE 2024). New York: ACM, 2024: 2048-2060. DOI: 10.1145/3597503.3639117.
  • [8]Li Z, Lu S, Guo D, et al. Automating Code Review Activities by Large-Scale Pre-training[EB/OL]. arXiv preprint arXiv:2203.09095, 2022.
  • [9]Gao Z, Wang H, Zhou Y, et al. How Far Have We Gone in Vulnerability Detection Using Large Language Models[EB/OL]. arXiv preprint arXiv:2311.12420, 2023.
  • [10]Ananbeh O, Alnozami W, Kim D K. Assessing the effectiveness of large language models for Java vulnerability repair: A comparative study[J]. Automated Software Engineering, 2026, 33(3): 75. DOI: 10.1007/s10515-026-00622-z.
  • [11]Khan T I, Wang S, Zhang H, et al. A Survey of Code Review Benchmarks and Evaluation Practices in Pre-LLM and LLM Era[EB/OL]. arXiv preprint arXiv:2602.13377, 2026.
  • [12]Wen C, Cai Y, Zhang B, et al. Automatically Inspecting Thousands of Static Bug Warnings with Large Language Model: How Far Are We?[J]. ACM Transactions on Knowledge Discovery from Data, 2024, 18(7): 168:1-168:34. DOI: 10.1145/3653718.
  • [13]Apostolidis G D, Kalouptsoglou I, Siavvas M, et al. AI-Enhanced Static Analysis: Reducing False Alarms Using Large Language Models[C]//Proceedings of the 2025 IEEE International Conference on Smart Computing (SMARTCOMP). Piscataway: IEEE, 2025: 288-293. DOI: 10.1109/SMARTCOMP65954.2025.00088.
  • [14]Li Z, Dutta S, Naik M. IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilities[C]//Proceedings of the 13th International Conference on Learning Representations (ICLR). 2025.
  • [15]Hu J, Zeng Y, Zhao G, et al. AuditGPT: A Multi-Agent Framework for Enhancing Static Analysis[C]//Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP 2026). Piscataway: IEEE, 2026: 14057-14061. DOI: 10.1109/icassp55912.2026.11463116.
  • [16]Hu J, Jin X, Zeng Y, et al. QLPro: Automated Code Vulnerability Discovery via LLM and Static Code Analysis Integration[EB/OL]. arXiv preprint arXiv:2506.23644, 2025.
  • [17]Ghebremichael J, Vasan S, Ullah S, et al. Multi-Agent Taint Specification Extraction for Vulnerability Detection[EB/OL]. arXiv preprint arXiv:2601.10865, 2026.
  • [18]Nunez A, Islam N T, Jha S K, et al. AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testing[EB/OL]. arXiv preprint arXiv:2409.10737, 2024.
  • [19]Chen S S, Hsu Y S, Lin T C, et al. Enhancing static vulnerability alert validation using large language models[J]. Journal of Systems and Software, 2027, 243: 113040 (published online ahead of print on August 3, 2026). DOI: 10.1016/j.jss.2026.113040.
  • [20]Lin S. LLM-Driven Adaptive Source-Sink Identification and False Positive Mitigation for Static Analysis[EB/OL]. arXiv preprint arXiv:2511.04023, 2025.
  • [21]Gajjar J, Subramaniakuppusamy K, Puthal R, et al. SecureFixAgent: A Hybrid LLM Agent for Automated Python Static Vulnerability Repair[EB/OL]. arXiv preprint arXiv:2509.16275, 2025.
  • [22]Du X, Feng J, Zou Y, et al. Reducing False Positives in Static Bug Detection with LLMs: An Empirical Study in Industry[C]//Proceedings of the IEEE/ACM 48th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP 2026). New York: ACM, 2026: 716-727. DOI: 10.1145/3786583.3786910.