Utilizing Precise and Complete Code Context to Guide LLM in Automatic False Positive Mitigation
AI-generated Key Points
⚠The license of the paper does not allow us to build upon its content and the key points are generated using the paper metadata rather than the full article.
- Static application security testing (SAST) tools are crucial for detecting bugs early on and ensuring code quality in software development.
- Common issue of false positives in SAST tools can slow down the development process.
- Automating false positive mitigation is essential to enhance the effectiveness of SAST tools.
- Large Language Models (LLMs) show potential to improve accuracy and usability of SAST tools, but face shortcomings in extracting precise and complete code context.
- Novel approach named LLM4FPM proposed to address these shortcomings by incorporating eCPG-Slicer for line-level precise code context extraction and FARF algorithm for efficient file reference graph construction.
- LLM4FPM demonstrated superior performance compared to baseline methods with an F1 score exceeding 99% across various Common Weakness Enumerations (CWEs).
- LLM4FPM leverages a free open-source model, reducing inspection costs by up to $2758 per run on Juliet dataset with an average inspection time of 4.7 seconds per warning.
- Importance of leveraging precise and complete code context highlighted for effective bug detection and improved code quality in software development processes.
Authors: Jinbao Chen (University of Science and Technology of China), Hongjing Xiang (University of Science and Technology of China), Luhao Li (University of Science and Technology of China), Yu Zhang (University of Science and Technology of China), Boyao Ding (University of Science and Technology of China), Qingwei Li (University of Science and Technology of China)
Abstract: Static Application Security Testing(SAST) tools are crucial for early bug detection and code quality but often generate false positives that slow development. Automating false positive mitigation is thus essential for advancing SAST tools. Past efforts use static/dynamic analysis or machine learning. The advent of Large Language Models, adept at understanding natural language and code, offers promising ways to improve the accuracy and usability of SAST tools. However, existing LLM-based methods need improvement in two key areas: first, extracted code snippets related to warnings are often cluttered with irrelevant control and data flows, reducing precision; second, critical code contexts are often missing, leading to incomplete representations that can mislead LLMs and cause inaccurate assessments. To ensure the use of precise and complete code context, thereby avoiding misguidance and enabling LLMs to reach accurate conclusions, we propose LLM4FPM. One of its core components is eCPG-Slicer, which builds an extended code property graph and extracts line-level, precise code context. Moreover, LLM4FPM incorporates FARF algorithm, which builds a file reference graph and then efficiently detects all files related to a warning in linear time, enabling eCPG-Slicer to gather complete code context across these files. We evaluate LLM4FPM on Juliet dataset, where it comprehensively outperforms the baseline, achieving an F1 score above 99% across various CWEs. LLM4FPM leverages a free, open-source model, avoiding costly alternatives and reducing inspection costs by up to $2758 per run on Juliet, with an average inspection time of 4.7 seconds per warning. Our work emphasizes the critical impact of precise and complete code context and highlights the potential of combining program analysis with LLMs, improving the quality and efficiency of software development.
Ask questions about this paper to our AI assistant
You can also chat with multiple papers at once here.
⚠The license of the paper does not allow us to build upon its content and the AI assistant only knows about the paper metadata rather than the full article.
Assess the quality of the AI-generated content by voting
Score: 0
Why do we need votes?
Votes are used to determine whether we need to re-run our summarizing tools. If the count reaches -10, our tools can be restarted.
Similar papers summarized with our AI tools
Navigate through even more similar papers through a
tree representationLook for similar papers (in beta version)
By clicking on the button above, our algorithm will scan all papers in our database to find the closest based on the contents of the full papers and not just on metadata. Please note that it only works for papers that we have generated summaries for and you can rerun it from time to time to get a more accurate result while our database grows.
Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.