[Paper Review] LLbezpeky: Leveraging Large Language Models for Vulnerability Detection
The paper evaluates using GPT-4 with prompt engineering and retrieval augmentation to detect Android vulnerabilities in the Ghera benchmark, develops an open-source LLB tool, and analyzes case studies including Vuldroid.
Despite the continued research and progress in building secure systems, Android applications continue to be ridden with vulnerabilities, necessitating effective detection methods. Current strategies involving static and dynamic analysis tools come with limitations like overwhelming number of false positives and limited scope of analysis which make either difficult to adopt. Over the past years, machine learning based approaches have been extensively explored for vulnerability detection, but its real-world applicability is constrained by data requirements and feature engineering challenges. Large Language Models (LLMs), with their vast parameters, have shown tremendous potential in understanding semnatics in human as well as programming languages. We dive into the efficacy of LLMs for detecting vulnerabilities in the context of Android security. We focus on building an AI-driven workflow to assist developers in identifying and rectifying vulnerabilities. Our experiments show that LLMs outperform our expectations in finding issues within applications correctly flagging insecure apps in 91.67% of cases in the Ghera benchmark. We use inferences from our experiments towards building a robust and actionable vulnerability detection system and demonstrate its effectiveness. Our experiments also shed light on how different various simple configurations can affect the True Positive (TP) and False Positive (FP) rates.
Motivation & Objective
- Motivate the need for effective vulnerability detection in Android apps amid static/dynamic analysis limitations.
- Investigate whether LLMs can detect Android vulnerabilities with basic prompting and with additional context.
- Design an AI-driven workflow that uses LLMs to identify, explain, and remediate vulnerabilities in Android apps.
Proposed method
- Use GPT-4 with prompt engineering and Retrieval Augmented Generation (RAG) to analyze Android apps from the Ghera benchmark.
- Iteratively refine prompts to compare basic prompting versus summaries of vulnerabilities.
- Implement a Python package (LLB) with a CLI to run scans using multiple scanners (GHERA, VULDROID) and to attach expert commentary.
- Perform case studies on a WebView information exposure scenario and on Vuldroid’s multi-vulnerability app to assess detection and remediation guidance.
Experimental results
Research questions
- RQ1RQ1: Can LLMs detect Android vulnerabilities with basic prompting techniques, and how do they compare to existing tools?
- RQ2RQ2: What input and context (knowledge bases, API usage, permissions, endpoints, cross-language components) aid LLMs in discovering bugs?
- RQ3RQ3: How does retrieval-augmented generation (RAG) affect detection accuracy and efficiency?
- RQ4RQ4: How can an AI-driven workflow provide actionable remediation guidance and support for developers?
Key findings
- LLMs can flag insecure apps even with minimal prompt context, but with notable secure-app misclassification in initial setups.
- Providing brief vulnerability summaries improves true positives and reduces inference time, achieving 66.38% TP rate in Experiment 2.
- A retrieval-augmented approach with selective file requests can offer efficiency gains but may incur hallucinations if summaries are overused.
- The LLB toolkit enables scanning with multiple scanners and supports expert commentary for post-scan analyses, producing example reports.
- In a case study on Vuldroid, LLB correctly identified 6 of 8 seeded vulnerabilities; two misses were due to missing relevant snippets for file-based analysis.
- Case study examples show LLB can explain vulnerabilities and suggest fixes, e.g., an Information Exposure via WebView vulnerability with a remediation note.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.