Longitudinal Analyses of SAST Tools: A CodeQL Case Study
Jean-Charles Noirot Ferrand, Kyle Domico, Yohan Beugin, Patrick McDaniel
TLDR
This study longitudinally evaluates CodeQL's efficacy, actionability, and stability on thousands of CVEs across OSS, finding detection inconsistencies.
Key contributions
- Developed a novel method for longitudinal evaluation of SAST tools, applied to CodeQL on OSS.
- Found CodeQL detected 83 CVEs before their fix, with findings often actionable when triaged.
- Demonstrated detection instability, with 21 CVEs lost after CodeQL updates and 17 never redetected.
Why it matters
This paper provides the largest academic study of CodeQL, offering critical insights into its real-world efficacy and limitations over time. It highlights the importance of SAST tools for preventing vulnerabilities while cautioning developers about potential detection blind spots when updating tools.
Original Abstract
Open-source software (OSS) pipelines rely on automated static analysis tools to prevent the introduction of vulnerabilities in code. However, there is limited understanding of the efficacy of these tools across the OSS ecosystem over time. In this paper, we introduce a novel method to evaluate static application security testing (SAST) tools through longitudinal measurements and perform the largest academic study of CodeQL -- the most prevalent static analysis tool from GitHub -- on OSS codebases. We apply our apparatus on 114 versions of CodeQL over time on 3993 CVEs from 1622 repositories to measure key properties of the tool, culminating in more than 20 billion lines of code analyzed. First, we measure its effectiveness, i.e., its ability to detect vulnerabilities before they are fixed. Then, we determine whether these detections were actionable through two measures of the distance between findings and vulnerability location either over the entire codebase or within the vulnerable file. Finally, we study the stability of CodeQL by examining how vulnerability detections hold across versions and the evolution of CodeQL on the accuracy-precision trade-off. We find that CodeQL identifies a total of 171 CVEs, and that for 83 of them, a CodeQL version prior to the fix could detect it. Such detections are in general actionable if findings are triaged across files, as for 50% of the 171 detections, more than 50% of findings in the vulnerable file are located in the vulnerable location. Finally, we show that CVE detections are not monotonic across versions as 21 CVEs were no longer detected following a version change and 17 that were never redetected. Our study shows that using SAST tools is a matter of best practice as they prevent numerous vulnerabilities from being introduced, but that developers should be aware of changes that may leave blind spots in detections upon updates of the tool.
📬 Weekly AI Paper Digest
Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.