点石成金:触发大语言模型能力用于RM-API误用检测
The Midas Touch: Triggering the Capability of LLMs for RM-API Misuse Detection
AI总结:
提出ChatDetector,利用LLM和ReAct优化分解任务,实现RM-API约束检索与误用检测,精确率98.21%,发现115个安全漏洞。
摘要:
在本文中,我们提出了一种由大语言模型(LLM)驱动的RM-API误用检测解决方案ChatDetector,该方案完全自动化地利用LLM进行文档理解,这有助于RM-API约束的检索和RM-API误用的检测。为了正确检索RM-API约束,ChatDetector受ReAct框架启发,并基于思维链(CoT)进行优化,将复杂任务分解为分配API识别、RM对象(由RM API分配/释放)提取和RM-API配对(RM API通常成对存在)。它首先基于从API文档中检索到的RM语句,通过LLM验证分配API的语义。受LLM在各种提示方法上表现的启发,ChatDetector采用二维提示方法进行交叉验证。同时,采用一种在LLM输出与推理过程之间进行不一致性检查的方法,配合现成的自然语言处理(NLP)工具来确认分配API。为了准确配对RM-API,ChatDetector再次分解任务,首先识别RM对象类型,据此可以准确配对释放API,并进一步构建用于误用检测的RM-API约束。在减少幻觉的情况下,与最先进的API检测器相比,ChatDetector识别出165对RM-API,精确率为98.21%。通过使用静态检测器CodeQL,我们向开发者报告了集成在六个流行库上的应用程序中的115个安全漏洞,这些漏洞可能导致严重问题,如拒绝服务(DoS)和内存损坏。与端到端基准方法相比,结果表明ChatDetector能够检索到至少多47%的RM语句和多80.85%的RM-API约束。
英文摘要:
In this paper, we propose an LLM-empowered RM-API misuse detection solution, ChatDetector, which fully automates LLMs for documentation understanding which helps RM-API constraints retrieval and RM-API misuse detection. To correctly retrieve the RM-API constraints, ChatDetector is inspired by the ReAct framework which is optimized based on Chain-of-Thought (CoT) to decompose the complex task into allocation APIs identification, RM-object (allocated/released by RM APIs) extraction and RM-APIs pairing (RM APIs usually exist in pairs). It first verifies the semantics of allocation APIs based on the retrieved RM sentences from API documentation through LLMs. Inspired by the LLMs' performance on various prompting methods,ChatDetector adopts a two-dimensional prompting approach for cross-validation. At the same time, an inconsistency-checking approach between the LLMs' output and the reasoning process is adopted for the allocation APIs confirmation with an off-the-shelf Natural Language Processing (NLP) tool. To accurately pair the RM-APIs, ChatDetector decomposes the task again and identifies the RM-object type first, with which it can then accurately pair the releasing APIs and further construct the RM-API constraints for misuse detection. With the diminished hallucinations, ChatDetector identifies 165 pairs of RM-APIs with a precision of 98.21% compared with the state-of-the-art API detectors. By employing a static detector CodeQL, we ethically report 115 security bugs on the applications integrating on six popular libraries to the developers, which may result in severe issues, such as Denial-of-Services (DoS) and memory corruption. Compared with the end-to-end benchmark method, the result shows that ChatDetector can retrieve at least 47% more RM sentences and 80.85% more RM-API constraints.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。