SQL注入越狱:大语言模型的结构性灾难
SQL Injection Jailbreak: A Structural Disaster of Large Language Models
AI总结:
本文提出针对大语言模型外部属性的SQL注入越狱攻击方法SIJ,在开源和闭源模型上均实现极高攻击成功率,同时暴露新漏洞并提出Self-Reminder-Key自适应防御方法验证有效。
摘要:
大语言模型(LLM)易受越狱攻击,这类攻击会诱导模型生成有害内容。以往的越狱方法主要利用大语言模型的内部属性或能力,例如基于优化的越狱方法以及利用模型上下文学习能力的方法。本文提出了一种新型越狱方法——SQL注入越狱(SQL Injection Jailbreak,SIJ),该方法针对大语言模型的外部属性,具体而言是大语言模型构建输入提示的方式。通过向用户提示中注入越狱信息,SIJ成功诱导模型输出有害内容。对于开源模型,SIJ在AdvBench和HEx-PHI两个基准上对5种知名大语言模型实现了接近100%的攻击成功率,且相比以往方法时间成本更低。对于闭源模型,SIJ在GPT和豆包系列的5个模型上取得了超过85%的平均攻击成功率。此外,SIJ暴露了大语言模型中一种亟待修复的新漏洞。为解决这一问题,我们提出了一种名为Self-Reminder-Key的简单自适应防御方法来对抗SIJ,并通过实验结果验证了其有效性。我们的代码可在https://github.com/weiyezhimeng/SQL-Injection-Jailbreak获取。
英文摘要:
Large Language Models (LLMs) are susceptible to jailbreak attacks that can induce them to generate harmful content. Previous jailbreak methods primarily exploited the internal properties or capabilities of LLMs, such as optimization-based jailbreak methods and methods that leveraged the model's context-learning abilities. In this paper, we introduce a novel jailbreak method, SQL Injection Jailbreak (SIJ), which targets the external properties of LLMs, specifically, the way LLMs construct input prompts. By injecting jailbreak information into user prompts, SIJ successfully induces the model to output harmful content. For open-source models, SIJ achieves near 100% attack success rates on five well-known LLMs on the AdvBench and HEx-PHI, while incurring lower time costs compared to previous methods. For closed-source models, SIJ achieves an average attack success rate over 85% across five models in the GPT and Doubao series. Additionally, SIJ exposes a new vulnerability in LLMs that urgently requires mitigation. To address this, we propose a simple adaptive defense method called Self-Reminder-Key to counter SIJ and demonstrate its effectiveness through experimental results. Our code is available at https://github.com/weiyezhimeng/SQL-Injection-Jailbreak.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。