Skip to main content
QUICK REVIEW

[Paper Review] Comparison of Static Application Security Testing Tools and Large Language Models for Repo-level Vulnerability Detection

Xin Zhou, Dat Tran|arXiv (Cornell University)|Jul 23, 2024
Software Reliability and Analysis ResearchComputer Science4 citations
TL;DR

This study compares 15 SAST tools and 12 LLMs for repo-level vulnerability detection across Java, C, and Python. While SAST tools show low detection rates with few false positives, LLMs achieve 90–100% detection but high false positives; ensembling both reduces limitations, improving overall performance.

ABSTRACT

Software vulnerabilities pose significant security challenges and potential risks to society, necessitating extensive efforts in automated vulnerability detection. There are two popular lines of work to address automated vulnerability detection. On one hand, Static Application Security Testing (SAST) is usually utilized to scan source code for security vulnerabilities, especially in industries. On the other hand, deep learning (DL)-based methods, especially since the introduction of large language models (LLMs), have demonstrated their potential in software vulnerability detection. However, there is no comparative study between SAST tools and LLMs, aiming to determine their effectiveness in vulnerability detection, understand the pros and cons of both SAST and LLMs, and explore the potential combination of these two families of approaches. In this paper, we compared 15 diverse SAST tools with 12 popular or state-of-the-art open-source LLMs in detecting software vulnerabilities from repositories of three popular programming languages: Java, C, and Python. The experimental results showed that SAST tools obtain low vulnerability detection rates with relatively low false positives, while LLMs can detect up 90\% to 100\% of vulnerabilities but suffer from high false positives. By further ensembling the SAST tools and LLMs, the drawbacks of both SAST tools and LLMs can be mitigated to some extent. Our analysis sheds light on both the current progress and future directions for software vulnerability detection.

Motivation & Objective

  • To address the lack of comparative studies between SAST tools and LLMs for vulnerability detection at the repository level.
  • To formulate a novel repo-level vulnerability detection task suitable for both SAST tools and LLMs.
  • To create and curate three new datasets containing complete source code of vulnerable repositories for Java, C, and Python.
  • To develop a unified evaluation framework supporting diverse LLMs and adaptation techniques for repo-level vulnerability detection.
  • To empirically compare the effectiveness, strengths, and limitations of SAST tools and LLMs in real-world settings across multiple programming languages.

Proposed method

  • Formulated a new task for repo-level vulnerability detection, where models identify vulnerabilities in entire repositories rather than individual functions.
  • Curated three new datasets—VulnRepo-Java, VulnRepo-C, and VulnRepo-Python—containing complete source code of vulnerable repositories with labeled vulnerabilities.
  • Evaluated 15 diverse SAST tools using standard scanning configurations across all three languages.
  • Evaluated 12 open-source LLMs using multiple prompting strategies (zero-shot, few-shot, chain-of-thought) and fine-tuning for the repo-level detection task.
  • Applied ensemble methods combining predictions from SAST tools and LLMs to mitigate individual weaknesses.
  • Used standard metrics such as detection rate, false positive rate, and F1-score to compare performance across tools and models.

Experimental results

Research questions

  • RQ1How do SAST tools and LLMs compare in detecting vulnerabilities at the repository level across Java, C, and Python?
  • RQ2What are the detection rates and false positive rates of SAST tools and LLMs when applied to real-world repositories?
  • RQ3Can combining SAST tools and LLMs through ensemble methods improve overall vulnerability detection performance?
  • RQ4How do different LLM architectures and prompting strategies affect performance in repo-level vulnerability detection?
  • RQ5What are the key limitations and strengths of SAST tools versus LLMs in real-world, multi-language settings?

Key findings

  • SAST tools achieved low vulnerability detection rates but maintained a low false positive rate, indicating high precision but low recall.
  • LLMs achieved detection rates of 90% to 100% across all three programming languages, demonstrating high recall but suffering from high false positive rates.
  • The ensemble of SAST tools and LLMs reduced false positives while maintaining high detection rates, resulting in improved F1-scores compared to individual approaches.
  • The performance of LLMs varied significantly based on prompting strategy, with chain-of-thought prompting showing better results than zero-shot or few-shot prompting.
  • This study is the first to evaluate SAST tools for Python vulnerability detection, revealing unique challenges in this language.
  • The curated datasets—VulnRepo-Java, VulnRepo-C, and VulnRepo-Python—provide a new benchmark for future repo-level vulnerability detection research.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.