Skip to main content
QUICK REVIEW

[论文解读] Demystifying RCE Vulnerabilities in LLM-Integrated Apps

Tong Liu, Zizhuang Deng|arXiv (Cornell University)|Sep 6, 2023
Web Application Security Vulnerabilities被引用 5
一句话总结

本文提出 LLMSmith,一种结合静态分析与基于提示的测试的双方法框架,用于检测和利用 LLM 集成框架及应用程序中的远程代码执行(RCE)漏洞。该研究在 6 个框架中发现 13 个漏洞(其中 7 个已分配 CVE 编号),并成功利用了 17 个真实应用程序,揭示了 RCE 漏洞的广泛存在,并为开发者提出了相应的缓解策略。

ABSTRACT

LLMs show promise in transforming software development, with a growing interest in integrating them into more intelligent apps. Frameworks like LangChain aid LLM-integrated app development, offering code execution utility/APIs for custom actions. However, these capabilities theoretically introduce Remote Code Execution (RCE) vulnerabilities, enabling remote code execution through prompt injections. No prior research systematically investigates these frameworks' RCE vulnerabilities or their impact on applications and exploitation consequences. Therefore, there is a huge research gap in this field. In this study, we propose LLMSmith to detect, validate and exploit the RCE vulnerabilities in LLM-integrated frameworks and apps. To achieve this goal, we develop two novel techniques, including 1) a lightweight static analysis to examine LLM integration mechanisms, and construct call chains to identify RCE vulnerabilities in frameworks; 2) a systematical prompt-based exploitation method to verify and exploit the found vulnerabilities in LLM-integrated apps. This technique involves various strategies to control LLM outputs, trigger RCE vulnerabilities and launch subsequent attacks. Our research has uncovered a total of 20 vulnerabilities in 11 LLM-integrated frameworks, comprising 19 RCE vulnerabilities and 1 arbitrary file read/write vulnerability. Of these, 17 have been confirmed by the framework developers, with 11 vulnerabilities being assigned CVE IDs. For the 51 apps potentially affected by RCE, we successfully executed attacks on 17 apps, 16 of which are vulnerable to RCE and 1 to SQL injection. Furthermore, we conduct a comprehensive analysis of these vulnerabilities and construct practical attacks to demonstrate the hazards in reality. Last, we propose several mitigation measures for both framework and app developers to counteract such attacks.

研究动机与目标

  • 系统性地研究 LLM 集成框架和应用程序中的 RCE 漏洞,尽管其安全影响重大,但该领域仍研究不足。
  • 开发一种可扩展、自动化的检测方法,用于检测框架源代码和真实世界 LLM 集成应用程序中的 RCE 漏洞。
  • 通过提示注入演示这些漏洞在真实世界中的可利用性,并评估其对用户安全的更广泛影响。
  • 为框架和应用程序开发者提供可操作的缓解策略,以提高安全意识并增强系统对这类攻击的防护能力。

提出的方法

  • LLMSmith 使用静态分析技术提取并验证从用户接口 API 到框架源代码中危险函数的调用链,识别潜在的 RCE 向量。
  • 采用白盒代码搜索方法识别候选框架,使用黑盒关键词搜索方法发现真实世界中的 LLM 集成应用程序用于测试。
  • 通过自动化基于提示的利用引擎生成对抗性提示,测试 RCE 和逃逸攻击,分析应用程序响应以确认漏洞存在。
  • 框架整合自然语言处理技术与已知的逃逸攻击模式,系统性探测通过 LLM 生成输出执行不受信任代码的可能性。
  • 在成功实现 RCE 后,应用利用放大技术以展示横向影响,例如劫持用户响应和泄露 API 密钥。
  • LLMSmith 使用 Python 实现,其在调用链提取的准确率和性能方面优于现有工具(如 PyCG)。

实验结果

研究问题

  • RQ1LLM 集成框架中 RCE 漏洞的根本原因和常见模式是什么?
  • RQ2如何通过静态分析系统性地大规模检测 LLM 集成框架中的 RCE 漏洞?
  • RQ3RCE 漏洞在真实世界 LLM 集成应用程序中通过提示注入可利用的程度如何?
  • RQ4RCE 利用的更广泛安全影响是什么,包括对其他用户的传播性影响?
  • RQ5可以提出哪些有效的缓解策略以降低 LLM 集成系统中的 RCE 风险?

主要发现

  • LLMSmith 在 6 个 LLM 集成框架中发现 13 个漏洞,包括 12 个 RCE 漏洞和 1 个任意文件读写漏洞。
  • 在 13 个框架漏洞中,11 个经开发者确认,共获得 7 个 CVE 编号,最高严重性评分为 9.8。
  • 在测试的 51 个真实世界 LLM 集成应用程序中,17 个被发现存在漏洞——其中 16 个为 RCE 漏洞,1 个为 SQL 注入漏洞。
  • 该框架证明,RCE 成功利用后可进一步通过劫持用户响应和泄露 API 密钥等方式影响其他用户,显著放大攻击影响。
  • 开发者反馈不一:尽管 5 位框架维护者中有 4 位在 1–2 天内回复,但许多更优先考虑新功能而非修复漏洞,反映出安全忽视的趋势。
  • 研究揭示,当前 LLM 集成应用程序生态系统因不受信任的代码执行和 LLM 行为不可预测性而存在系统性安全缺口。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。