{"title":"迈达斯之触:触发 LLM 检测 RM-API 滥用的能力","authors":"Yi Yang, Jinghua Liu, Kai Chen, Miaoqian Lin","doi":"arxiv-2409.09380","DOIUrl":null,"url":null,"abstract":"In this paper, we propose an LLM-empowered RM-API misuse detection solution,\nChatDetector, which fully automates LLMs for documentation understanding which\nhelps RM-API constraints retrieval and RM-API misuse detection. To correctly\nretrieve the RM-API constraints, ChatDetector is inspired by the ReAct\nframework which is optimized based on Chain-of-Thought (CoT) to decompose the\ncomplex task into allocation APIs identification, RM-object (allocated/released\nby RM APIs) extraction and RM-APIs pairing (RM APIs usually exist in pairs). It\nfirst verifies the semantics of allocation APIs based on the retrieved RM\nsentences from API documentation through LLMs. Inspired by the LLMs'\nperformance on various prompting methods,ChatDetector adopts a two-dimensional\nprompting approach for cross-validation. At the same time, an\ninconsistency-checking approach between the LLMs' output and the reasoning\nprocess is adopted for the allocation APIs confirmation with an off-the-shelf\nNatural Language Processing (NLP) tool. To accurately pair the RM-APIs,\nChatDetector decomposes the task again and identifies the RM-object type first,\nwith which it can then accurately pair the releasing APIs and further construct\nthe RM-API constraints for misuse detection. With the diminished\nhallucinations, ChatDetector identifies 165 pairs of RM-APIs with a precision\nof 98.21% compared with the state-of-the-art API detectors. By employing a\nstatic detector CodeQL, we ethically report 115 security bugs on the\napplications integrating on six popular libraries to the developers, which may\nresult in severe issues, such as Denial-of-Services (DoS) and memory\ncorruption. Compared with the end-to-end benchmark method, the result shows\nthat ChatDetector can retrieve at least 47% more RM sentences and 80.85% more\nRM-API constraints.","PeriodicalId":501332,"journal":{"name":"arXiv - CS - Cryptography and Security","volume":"212 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"The Midas Touch: Triggering the Capability of LLMs for RM-API Misuse Detection\",\"authors\":\"Yi Yang, Jinghua Liu, Kai Chen, Miaoqian Lin\",\"doi\":\"arxiv-2409.09380\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"In this paper, we propose an LLM-empowered RM-API misuse detection solution,\\nChatDetector, which fully automates LLMs for documentation understanding which\\nhelps RM-API constraints retrieval and RM-API misuse detection. To correctly\\nretrieve the RM-API constraints, ChatDetector is inspired by the ReAct\\nframework which is optimized based on Chain-of-Thought (CoT) to decompose the\\ncomplex task into allocation APIs identification, RM-object (allocated/released\\nby RM APIs) extraction and RM-APIs pairing (RM APIs usually exist in pairs). It\\nfirst verifies the semantics of allocation APIs based on the retrieved RM\\nsentences from API documentation through LLMs. Inspired by the LLMs'\\nperformance on various prompting methods,ChatDetector adopts a two-dimensional\\nprompting approach for cross-validation. At the same time, an\\ninconsistency-checking approach between the LLMs' output and the reasoning\\nprocess is adopted for the allocation APIs confirmation with an off-the-shelf\\nNatural Language Processing (NLP) tool. To accurately pair the RM-APIs,\\nChatDetector decomposes the task again and identifies the RM-object type first,\\nwith which it can then accurately pair the releasing APIs and further construct\\nthe RM-API constraints for misuse detection. With the diminished\\nhallucinations, ChatDetector identifies 165 pairs of RM-APIs with a precision\\nof 98.21% compared with the state-of-the-art API detectors. By employing a\\nstatic detector CodeQL, we ethically report 115 security bugs on the\\napplications integrating on six popular libraries to the developers, which may\\nresult in severe issues, such as Denial-of-Services (DoS) and memory\\ncorruption. Compared with the end-to-end benchmark method, the result shows\\nthat ChatDetector can retrieve at least 47% more RM sentences and 80.85% more\\nRM-API constraints.\",\"PeriodicalId\":501332,\"journal\":{\"name\":\"arXiv - CS - Cryptography and Security\",\"volume\":\"212 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-14\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Cryptography and Security\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2409.09380\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Cryptography and Security","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.09380","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
The Midas Touch: Triggering the Capability of LLMs for RM-API Misuse Detection
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.