arXiv:2608.25776cs.CRcs.AI2026-08

自进化编程代理会复制恶意代码,形成可自我传播的漏洞

EVOMAL: Self-Poisoning in Self-Evolving Coding Agents

论文配图:EVOMAL: Self-Poisoning in Self-Evolving Coding Agents
图 1 · 摘自论文原文
  • 用伪装结构包裹恶意代码,诱导代理复刻并传播
  • 6个模型在153个任务中,20.3%~41.8%的任务引入恶意技能
  • 即使移除原始恶意代码,残留副本仍持续传播,适合安全研究者关注

自进化大模型编程代理通过模仿共享技能库中的已有技能来编写新工具。我们发现该流程存在漏洞:在生成过程中,若检索到恶意技能,其代码可能作为模板被复制,导致新生成的技能保留恶意载荷。我们称之为自中毒(self-poisoning),即代理自行创建、存储并执行恶意技能。为此提出EvoMal攻击,通过将可替换载荷封装于一组看似无害的结构元素(称为‘横幅’)中,诱导代理复制其中代码。攻击者无需直接调用恶意代码即可将其植入库中。代理随后生成并运行携带恶意代码的新技能,这些新技能可重新进入库中被再次模仿,形成自我传播的蠕虫,即使原始恶意技能被移除仍持续存在。我们定义代理自中毒率(ASPR)为任务中新增恶意技能的比例。在153个SWE-bench Verified任务上,6个模型的ASPR为20.3%~41.8%,被污染库中恶意技能数量是植入量的4.9~9.0倍。即使无横幅,DeepSeek-V4-Pro仍达11.1% ASPR。针对性优化描述后,某任务族下高达86.7%。移除原始技能后,Qwen3在第5轮仍保持68% ASPR,因代理生成的副本持续留存。现有防御针对提交名称、代码和签名,无法识别此类副本。我们提出counter-prompt防御机制,抑制横幅式复制,将EvoMal的ASPR降至6.7%以下,且任务完成率基本不受影响。

原文摘要 · Abstract (English)

Self-evolving LLM coding agents write their own tools by imitating retrieved skills from shared skill libraries. We identify a vulnerability in this loop: during authoring, a retrieved malicious skill can become the template for a new skill that preserves the payload. We call this self-poisoning: the agent authors, stores, and runs the resulting malicious skill. We exploit it through EvoMal, an attack that amplifies self-poisoning by wrapping an interchangeable payload in a banner, a set of benign-looking structural elements that induces an imitating agent to reproduce the enclosed code. The attacker plants malicious skills in the library without invoking them. The agent then authors and executes new skills carrying the harmful code. Each authored copy can re-enter the library and be imitated again, forming a self-propagating worm that persists after the planted skills are removed. We define the agent self-poisoning rate (ASPR) as the fraction of tasks that add a newly authored malicious skill to the library. Across six models on 153 tool-relevant SWE-bench Verified tasks, ASPR ranges from 20.3% to 41.8%, and the poisoned libraries hold 4.9 to 9.0 times as many malicious skills as were planted. The vulnerability also appears without a banner: DeepSeek-V4-Pro reaches 11.1% ASPR with the payload alone. Tailoring the planted skill descriptions to one task family raises ASPR to 86.7%. After the planted skills are removed, Qwen3 retains a round-5 ASPR of 68% because agent-authored copies remain. These copies evade existing defenses, which focus on attacker-submitted names, code, and signatures. We propose counter-prompt, a defense that discourages banner-style copying and reduces EvoMal's ASPR to at most 6.7% with no significant task-completion loss.

自进化代码安全漏洞挖掘LLM防御

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。