规则文件后门:AI 编码助手的供应链攻击 (AML.CS0041)
一句话通俗理解
AI 编码助手的「项目规则」文件被植入后门——AI 写的每一行代码都带着攻击者的意图。
案例速览
| 维度 | 内容 |
|---|---|
| 案例类型 | 演练 / 安全研究 |
| 发生时间 | 2025-03-18 |
| 攻击者 | Pillar Security |
| 受害目标 | Cursor, GitHub Copilot |
事件经过
Pillar Security 研究者演示了针对 AI 编码助手的供应链攻击:在规则文件(rules file,配置 AI 编码行为的文件)中注入恶意指令,AI 生成的代码被持续植入后门——开发者以为在用 AI 提效,实际在引入漏洞。
运用的 ATLAS 技术
以下攻击链映射来自 MITRE ATLAS 官方数据(AML.CS0041 的
employs关系),按官方步骤编号排序;技术名称链接至本库对应技术文档,引用文字为官方对本次运用的描述。
S00
- 暂存能力 (AML.T0079)
The researchers staged a malicious javascript file on a publicly available website.
S01
- LLM 提示词构造 (AML.T0065)
The researchers crafted a prompt to target coding assistant that inject a call to the malicious javascript script in generated HTML.
S02
- LLM 提示词混淆 (AML.T0068)
The researchers hid the prompt in a coding assistant rules file by using invisible Unicode characters (such as zero-width joiners and bidirectional text markers). The prompt appears invisible in code editors and GitHub’s pull request approval process, allowing it to evade detection during human review.
S03
- AI 软件 (AML.T0010.001)
The researchers could have uploaded the malicious rules file to open-source communities where AI coding assistant configurations are shared with minimal security vetting such as GitHub and cursor.directory. Once incorporated into a project repository it may survive project forking and template distribution, creating long-term compromise of many organizations’ AI software supply chains.
S04
- 修改 AI 智能体配置 (AML.T0081)
Users then pulled the latest version of the rules file, replacing their coding assistant’s configuration with the malicious one. The coding assistant’s behavior was modified, affecting all future code generation.
S05
- 直接提示词注入 (AML.T0051.000)
When the AI coding assistant was next initialized, its rules file was read and the malicious prompt was executed.
S06
- LLM 越狱 (AML.T0054)
The prompt used jailbreak techniques to convince the AI coding assistant to add the malicious script to generated HTML files.
S07
- 操纵 LLM 可信输出组件 (AML.T0067)
The prompt instructed the AI coding assistant to not mention code changes in its responses, which ensures that there will be no messages to raise the victim’s suspicion and that nothing ends up the assistant’s logs. This allows for the malicious rules file to silently propagate throughout the codebase with no trace in the history or logs to aid in alerting security teams.
S08
- 用户危害 (AML.T0048.003)
The victim developers unknowingly used the compromised AI coding assistant that generate code containing hidden malicious elements which could include backdoors, data exfiltration code, vulnerable constructs, or malicious scripts. This code could end up in a production application, affecting the users of the software.
关联战术
- 资源开发 (AML.TA0003)
- AI 攻击适配 (AML.TA0001)
- 防御规避 (AML.TA0007)
- 初始访问 (AML.TA0004)
- 持久化 (AML.TA0006)
- 执行 (AML.TA0005)
- 权限提升 (AML.TA0012)
- 影响 (AML.TA0011)
参考资料
以下为 MITRE ATLAS 官方案例收录的参考来源:
版本: ATLAS 2026.09 | 更新: 2026-10-24 | 模板: ATLAS 案例研究 v1.0