Lune

NDSS2025顶会

The Midas Touch: Triggering the Capability of LLMs for RM-API Misuse Detection

Yi Yang, Jinghua Liu, Kai Chen, Miaoqian Lin

摘要

As the basis of software resource management (RM), strictly following the RM-API constraints guarantees secure resource management and software. To enhance the RM-API application, researchers find it effective in detecting RM-API misuse on open-source software according to RM-API constraints retrieved from documentation and code. However, the current pattern-matching constraint retrieval methods have limitations: the documentation-based methods leave many API constraints irregularly distributed or involving neutral sentiment undiscovered; the code-based methods result in many false bugs due to incorrect API usage since not all high-frequency usages are correct. Therefore, people propose to utilize Large Language Models (LLMs) for RM-API constraint retrieval with their potential on text analysis and generation. However, directly using LLMs has limitations due to the hallucinations. The LLMs fabricate answers without expertise leaving many RM APIs undiscovered and generating incorrect answers even with evidence introducing incorrect RM-API constraints and false bugs.

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. Since no work exists specified in utilizing LLMs for RM-API misuse detection to our best knowledge, the inspiring results show that LLMs can assist in generating more constraints beyond expertise and can be used for bug detection. It also indicates that future research could transfer from overcoming the bottlenecks of traditional NLP tools to creatively utilizing LLMs for security research.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Incident Response Planning Using a Lightweight Large Language Model with Reduced Hallucination 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models 引用了 Language Models are Few-Shot Learners
  • Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models 引用了 Automated Program Repair in the Era of Large Pre-trained Language Models
  • Automated Program Repair in the Era of Large Pre-trained Language Models 引用了 Language Models are Few-Shot Learners
  • LineBreaker: Finding Token-Inconsistency Bugs with Large Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • LineBreaker: Finding Token-Inconsistency Bugs with Large Language Models 引用了 Automated Program Repair in the Era of Large Pre-trained Language Models
  • Prompting Is All You Need: Automated Android Bug Replay with Large Language Models 引用了 Language Models are Few-Shot Learners
  • Prompting Is All You Need: Automated Android Bug Replay with Large Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Incident Response Planning Using a Lightweight Large Language Model with Reduced HallucinationKim Hammar, Tansu Alpcan, Emil C. LupuNDSS 2026 · 16 次引用
  2. LineBreaker: Finding Token-Inconsistency Bugs with Large Language ModelsHongbo Chen, Yifan Zhang, Xing Han, Tianhao Mao 等ASE 2025 · 3 次引用
  3. BugAuditor: Detecting Bugs via Inconsistent Defensive Code AuditingMiaoqian Lin, Kai Chen, Hao ChenUSENIX Security 2026
  4. Patch-Guided Vulnerability Detection: Extracting Java API Security Rules via Attack–Defense Cross-AnalysisBofei Chen, Shuang Liao, Lei Zhang, Chibin Zhang 等USENIX Security 2026

它引用的 Paper17

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  3. Automated Program Repair in the Era of Large Pre-trained Language ModelsChunqiu Steven Xia, Yuxiang Wei, Lingming ZhangICSE 2023 · 321 次引用
  4. Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language ModelsYinlin Deng, Chunqiu Steven Xia, Haoran Peng, Chenyuan Yang 等ISSTA 2023 · 253 次引用
  5. Prompting Is All You Need: Automated Android Bug Replay with Large Language ModelsSidong Feng, Chunyang ChenICSE 2024 · 143 次引用

相关 Paper

  1. Demystifying and Detecting Misuses of Deep Learning APIsMoshi Wei, Nima Shiri Harzevili, Yuekai Huang, Jinqiu Yang 等ICSE 2024 · 13 次引用
  2. Beyond Static Pattern Matching? Rethinking Automatic Cryptographic API Misuse Detection in the Era of LLMsYifan Xia, Zichen Xie, Peiyu Liu, Kangjie Lu 等ISSTA 2025 · 2 次引用
  3. RBCTest: Leveraging LLMs to Mine and Verify Oracles of API Response Bodies for RESTful API TestingHieu Huynh, Quoc-Tri Le, Tu Nguyen, Viet Nguyen 等ICSE 2026
  4. Boosting Static Resource Leak Detection via LLM-based Resource-Oriented Intention InferenceChong Wang, Jianan Liu, Xin Peng, Yang Liu 等ICSE 2025 · 5 次引用
  5. Sanitizing Large Language Models in Bug Detection with Data-FlowChengpeng Wang, Wuqi Zhang, Zian Su, Xiangzhe Xu 等EMNLP Findings 2024 · 11 次引用
黄昏的海面,两侧是细线勾勒的悬崖