中文

金手指:触发 LLMs 对 RM-API 滥用检测能力的解决方案

密码学与安全 2024-09-20 v2

摘要

本文提出一种基于大语言模型(LLM)的 RM-API 滥用检测解决方案ChatDetector,通过完全自动化地利用 LLMs 进行文档理解,辅助 RM-API 约束检索与 RM-API 滥用检测。为正确检索 RM-API 约束,ChatDetector 借鉴 ReAct 框架思想,并基于链式思维(CoT)进行优化,将复杂任务分解为分配 API 识别、RM 对象(由 RM API 分配/释放)提取以及 RM-API 配对( RM API 通常成对出现)。它首先通过 LLMs 从 API 文档检索到的 RM 句子验证分配 API 的语义。受 LLMs 在各种提示方法上的表现启发,ChatDetector 采用二维提示方法进行交叉验证。同时,采用一种用于分配 API 确认的输出与推理过程不一致性检查方法,结合即插即用的自然语言处理(NLP)工具。为准确配对 RM-API,ChatDetector 再次将任务分解,首先识别 RM 对象类型,以便准确配对释放 API 并进一步构建 RM-API 约束用于滥用检测。经过减少幻觉后,ChatDetector 以 98.21% 的精度识别出 165 对 RM-API,优于现有最先进的 API 检测器。通过采用静态检测器 CodeQL,我们在六个流行库的集成应用中报告了 115 个安全漏洞,这些漏洞可能导致诸如 Denial-of-Service(DoS)和内存损坏等严重问题。与端到端基准方法相比,结果表明 ChatDetector 可至少检索到 47%更多的 RM 句子和 80.85% 更多的 RM-API 约束。

关键词

引用

@article{arxiv.2409.09380,
  title  = {The Midas Touch: Triggering the Capability of LLMs for RM-API Misuse Detection},
  author = {Yi Yang and Jinghua Liu and Kai Chen and Miaoqian Lin},
  journal= {arXiv preprint arXiv:2409.09380},
  year   = {2024}
}

备注

Accepted by NDSS Symposium 2025. Please cite this paper as "Yi Yang, Jinghua Liu, Kai Chen, Miaoqian Lin. The Midas Touch: Triggering the Capability of LLMs for RM-API Misuse Detection. In the 32nd Annual Network and Distributed System Security Symposium (NDSS 2025)."