LLbezpeky: Leveraging Large Language Models for Vulnerability Detection

📄 arXiv: 2401.01269v2 📥 PDF

作者: Noble Saji Mathews, Yelizaveta Brus, Yousra Aafer, Meiyappan Nagappan, Shane McIntosh

分类: cs.CR, cs.AI, cs.SE

发布日期: 2024-01-02 (更新: 2024-02-13)

备注: This project report was presented as a part of the course CS858 at the University of Waterloo under the supervision of Prof. Yousra Aafer


💡 一句话要点

提出LLbezpeky以解决Android应用漏洞检测问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 漏洞检测 大型语言模型 Android安全 机器学习 静态分析 动态分析 AI驱动

📋 核心要点

  1. 现有的静态和动态分析工具在Android应用漏洞检测中存在假阳性率高和分析范围有限的问题,难以有效采用。
  2. 本文提出利用大型语言模型(LLMs)构建AI驱动的工作流程,以帮助开发者识别和修复Android应用中的漏洞。
  3. 实验结果表明,LLMs在漏洞检测中的表现超出预期,正确标记不安全应用的比例达到91.67%,显示出显著的提升。

📝 摘要(中文)

尽管在构建安全系统方面持续进行研究和进展,Android应用仍然存在大量漏洞,亟需有效的检测方法。目前的静态和动态分析工具存在假阳性率高和分析范围有限等问题,导致其难以广泛采用。近年来,基于机器学习的方法被广泛探索,但其在实际应用中的可行性受到数据需求和特征工程挑战的限制。大型语言模型(LLMs)凭借其庞大的参数量,在理解人类语言和编程语言的语义方面展现出巨大潜力。本文探讨了LLMs在Android安全漏洞检测中的有效性,构建了一种AI驱动的工作流程,帮助开发者识别和修复漏洞。实验结果显示,LLMs在识别应用问题方面超出预期,在Ghera基准测试中正确标记不安全应用的比例达到91.67%。

🔬 方法详解

问题定义:本文旨在解决Android应用中漏洞检测的有效性问题,现有方法面临假阳性率高和分析范围有限的挑战。

核心思路:通过利用大型语言模型(LLMs)来理解应用代码的语义,从而提高漏洞检测的准确性和效率。设计的思路是利用LLMs的强大语义理解能力来辅助开发者进行漏洞识别。

技术框架:整体架构包括数据收集、模型训练、漏洞检测和结果反馈四个主要模块。首先收集Android应用数据,然后使用LLMs进行训练,最后通过模型对应用进行漏洞检测并反馈结果。

关键创新:最重要的创新点在于将LLMs应用于漏洞检测领域,利用其强大的语义理解能力来提高检测的准确性,与传统方法相比,显著降低了假阳性率。

关键设计:在模型训练中,采用了特定的损失函数和参数设置,以优化LLMs在漏洞检测任务中的表现,同时进行了多种简单配置的实验,以分析其对真阳性和假阳性率的影响。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,LLMs在漏洞检测中的表现超出预期,在Ghera基准测试中,正确标记不安全应用的比例达到91.67%。这一结果表明,LLMs在实际应用中的有效性和可行性,显著提升了漏洞检测的准确性。

🎯 应用场景

该研究的潜在应用领域包括Android应用开发和安全审计。通过提供一个高效的漏洞检测工具,开发者能够更快速地识别和修复安全漏洞,从而提升应用的安全性。未来,该方法可能扩展到其他平台和编程语言的安全检测中,具有广泛的实际价值。

📄 摘要(原文)

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.