Chen, J., Xiang, H., Li, L., Zhang, Y., Ding, B., & Li, Q. (2024). Utilizing Precise and Complete Code Context to Guide LLM in Automatic False Positive Mitigation. arXiv preprint arXiv:2411.03079.
This paper investigates the use of Large Language Models (LLMs) in conjunction with precise and complete code context to improve the accuracy and efficiency of automatic false positive mitigation (FPM) in Static Application Security Testing (SAST) tools.
The researchers developed the LLM4FPM framework, which consists of two main components: eCPG-Slicer and the FARF algorithm. eCPG-Slicer extracts precise line-level code context related to warnings by constructing an extended Code Property Graph (eCPG) that incorporates data and control dependencies, calling relations, structural relations, and variable relations. The FARF algorithm efficiently identifies dependent source files related to a warning by analyzing the file reference graph (FRG) and strongly connected components (SCCs) of a project. These components are integrated with an LLM to analyze structured reports containing both the bug report and the extracted code context.
Evaluations on the Juliet dataset demonstrated that LLM4FPM significantly outperforms the baseline approach (LLM4SA), achieving an F1 score above 99% across various Common Weakness Enumerations (CWEs). Further testing on real-world C/C++ projects showed that LLM4FPM effectively reduced false positive warnings by over 85%. Additionally, LLM4FPM exhibited efficiency with an average inspection time of 4.7 seconds per bug and cost-effectiveness by utilizing a free, open-source LLM, saving $2758 per run on the Juliet dataset.
The research highlights the critical role of precise and complete code context in enabling LLMs to effectively identify and mitigate false positives in SAST tools. The proposed LLM4FPM framework provides a promising solution for improving the accuracy, efficiency, and cost-effectiveness of FPM, ultimately enhancing the quality and efficiency of modern software development.
This research significantly contributes to the field of software testing and quality assurance by presenting a novel approach for leveraging LLMs in FPM. The findings have practical implications for developers and organizations seeking to improve the accuracy and efficiency of their SAST processes.
The study primarily focuses on C/C++ projects and a limited set of CWEs. Future research could explore the applicability of LLM4FPM to other programming languages and a wider range of security vulnerabilities. Additionally, investigating the impact of different LLM architectures and prompting techniques on FPM performance could further enhance the framework's capabilities.
Naar een andere taal
vanuit de broninhoud
arxiv.org
Belangrijkste Inzichten Gedestilleerd Uit
by Jinbao Chen ... om arxiv.org 11-06-2024
https://arxiv.org/pdf/2411.03079.pdfDiepere vragen