arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.06462cs.CRcs.AI
收藏

幻觉式AI劫持攻击:大语言模型与恶意代码推荐器

Hallucinating AI Hijacking Attack: Large Language Models and Malicious Code Recommenders

PeopleTec(PeopleTec公司)

David Noever, Forrest McKee

AI总结:

本研究揭示大语言模型存在语境突变防护漏洞,攻击者可借编程场景诱导模型推荐含恶意API的代码,结合代码仓库与CDN放大攻击面,提出一种新型“借地生存”式AI劫持攻击。

摘要:

本研究构建并评估了在主流代码仓库中引入复制代码或由AI幻觉生成的恶意代码推荐的对抗潜力。尽管OpenAI、Google、Anthropic的基础大语言模型(LLM)会对有害行为和有毒字符串进行防护,但此前针对嵌入有害提示的数学解题的研究表明,不同专家语境下的防护规则可能存在差异。当问题语境发生变化时,混合专家模型中会出现这类漏洞,且这类场景下可用于过滤有毒评论或攻击性行动推荐的恶意训练样本可能更少。本研究证明,基础模型在被明确提示时可能会拒绝正确提出破坏性行动,但在面对语境突变(比如解决计算机编程挑战)时却可能放松防护。我们通过GitHub、NPM、NuGet等承载木马的仓库,以及jsDelivr等主流内容分发网络(CDN)的实证案例,展示了这类攻击会放大攻击面。在LLM力求提供有用回复的指令导向下,其推荐的示例会给出应用程序编程接口(API)端点,蓄意的域名抢注者可以获取这些端点,搭建攻击移动基础设施,通过用户不假思索复制的代码触发攻击。我们将该攻击与此前关于语境转移的研究进行了对比,并将该攻击面界定为恶意软件文献中“借地生存(living off the land)”攻击的一种新型变体。在后一种情况中,基础语言模型可以劫持原本无害的用户提示,在没有附带编程支持请求的直接提问场景下,推荐违反其所属方安全策略的行动。

英文摘要:

The research builds and evaluates the adversarial potential to introduce copied code or hallucinated AI recommendations for malicious code in popular code repositories. While foundational large language models (LLMs) from OpenAI, Google, and Anthropic guard against both harmful behaviors and toxic strings, previous work on math solutions that embed harmful prompts demonstrate that the guardrails may differ between expert contexts. These loopholes would appear in mixture of expert's models when the context of the question changes and may offer fewer malicious training examples to filter toxic comments or recommended offensive actions. The present work demonstrates that foundational models may refuse to propose destructive actions correctly when prompted overtly but may unfortunately drop their guard when presented with a sudden change of context, like solving a computer programming challenge. We show empirical examples with trojan-hosting repositories like GitHub, NPM, NuGet, and popular content delivery networks (CDN) like jsDelivr which amplify the attack surface. In the LLM's directives to be helpful, example recommendations propose application programming interface (API) endpoints which a determined domain-squatter could acquire and setup attack mobile infrastructure that triggers from the naively copied code. We compare this attack to previous work on context-shifting and contrast the attack surface as a novel version of "living off the land" attacks in the malware literature. In the latter case, foundational language models can hijack otherwise innocent user prompts to recommend actions that violate their owners' safety policies when posed directly without the accompanying coding support request.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑