arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.14281cs.CRcs.LGcs.SE
收藏

XOXO:针对AI编码助手的隐蔽跨域上下文污染攻击

XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants

Columbia University(哥伦比亚大学);Stanford University(斯坦福大学)

Adam Štorek, Mukur Gupta, Noopur Bhatt, Aditya Gupta, Janie Kim, Prashast Srivastava, Suman Jana

AI总结:

本文提出XOXO攻击,通过隐蔽的跨域上下文污染使AI编码助手生成漏洞代码。引入GCGS算法,利用Cayley图系统搜索变换空间,实现75.72%的攻击成功率,传统防御方法无效。

摘要:

AI编码助手广泛用于代码生成等任务,其需要从各种来源自动获取复杂上下文,这引入了新的漏洞,允许攻击者通过隐蔽的污染输入来破坏助手输出。本文提出XOXO攻击,其利用对抗性代码修改,这些修改在语义上等价,使传统程序分析技术难以检测。我们引入了任务无关的黑盒攻击算法GCGS,利用Cayley图系统搜索变换空间,在五个任务和十一模型上平均攻击成功率达75.72%,包括GPT 4.1和Claude 3.5 Sonnet v2。进一步,对抗性微调等防御措施对我们的攻击无效,凸显了LLM驱动编码工具中需要新的安全措施。

英文摘要:

AI coding assistants are widely used for tasks like code generation. These tools now require large and complex contexts, automatically sourced from various origins$\unicode{x2014}$across files, projects, and contributors$\unicode{x2014}$forming part of the prompt fed to underlying LLMs. This automatic context-gathering introduces new vulnerabilities, allowing attackers to subtly poison input to compromise the assistant's outputs, potentially generating vulnerable code or introducing critical errors. We propose a novel attack, Cross-Origin Context Poisoning (XOXO), that is challenging to detect as it relies on adversarial code modifications that are semantically equivalent. Traditional program analysis techniques struggle to identify these perturbations since the semantics of the code remains correct, making it appear legitimate. This allows attackers to manipulate coding assistants into producing incorrect outputs, while shifting the blame to the victim developer. We introduce a novel, task-agnostic, black-box attack algorithm GCGS that systematically searches the transformation space using a Cayley Graph, achieving a 75.72% attack success rate on average across five tasks and eleven models, including GPT 4.1 and Claude 3.5 Sonnet v2 used by popular AI coding assistants. Furthermore, defenses like adversarial fine-tuning are ineffective against our attack, underscoring the need for new security measures in LLM-powered coding tools.

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

↑