supply-chain
它能做什么
这项技能涵盖 AI 产品的供应链风险,包括模型文件、适配器、嵌入模型、插件,以及来自公共仓库的软件包。适合构建 AI 产品、并希望检查自己引入了哪些内容的团队。
适用场景
- ✓当团队要求智能体检查其 AI 产品从公共来源下载了哪些模型和软件包时。
- ✓当智能体检查依赖文件中是否有未固定版本的社区软件包或名称相似的软件包时。
- ✓当插件或 MCP 服务器被自动安装,必须在运行前进行审查时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/supply-chain/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我审查我们 AI 应用下载的软件包和模型文件,告诉我哪些没有固定版本或没有经过检查?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体列出应用使用的每一个模型、适配器、插件和软件包,记录它们的来源以及是否已固定版本,并标记未经验证的来源。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
LLM Supply-Chain Compromise (LLM03:2025)
An LLM product's runtime trust boundary spans far more than the
application code: pre-trained weights, fine-tune adapters, embedding
models, tokenizers, vector databases, framework packages, plugin /
MCP servers, and dataset URLs are all attacker-influenced if any of
them is sourced from a public registry. A malicious LoRA adapter or a
typo-squatted langchain-foo package is indistinguishable from a
legitimate dependency until it fires.
1. Recognition signals
- Model name is something like
-Q4_K_M.ggufpulled from HuggingFace. - Fine-tune adapter or LoRA layered on top of an open-weight base.
requirements.txt/pyproject.tomlpulls LangChain / LlamaIndex community modules from PyPI without pinning.- Plugin marketplace or MCP-server discovery feature with auto-install.
- Embedding model downloaded at startup from a CDN.
- Tokenizer files cached from an untrusted mirror.
- Continuous fine-tuning loop reads training data from a public URL.
2. Attack vectors
Backdoored weights
Trigger phrases in the prompt produce attacker-chosen output. The
model is correct on every benchmark but emits arbitrary content when
the trigger fires (e.g. "banana monkey forklift" → call an exfil tool).
Typo-squatted framework package
langchin-community, llamaindex-vector, openai-toolkit —
package names one character off from upstream that wrap the real
client and ship token-stealing code in __init__.
Compromised model registry
HuggingFace org takeover or repo rename: a model the customer pinned by name now points to attacker-controlled weights.
Malicious LoRA / adapter
Adapter advertised as "uncensored" or "improved tool-calling" actually contains the trigger backdoor + benign fine-tune mixed.
Plugin / MCP-server hijack
Plugin marketplace metadata advertises an innocuous capability; the
server emits a tool description that is itself a prompt-injection
payload (see prompt-injection skill, tool-description injection).
Dataset poisoning
A repo of "user feedback" or "Q&A pairs" used for RAG / fine-tuning contains attacker-planted documents with poisoned answers for sensitive queries.
3. Audit workflow
# Inventory model + adapter sources
grep -rE 'huggingface\.co|hf_hub|from_pretrained|gguf|safetensors' /workspace
grep -rE 'PeftModel|LoraConfig|adapter_name=' /workspace
# Inventory plugin / MCP discovery
grep -rE 'plugin_marketplace|mcp_server|tool_marketplace|discover_tools' /workspace
# Find unpinned LLM-framework deps
grep -rE '^(langchain|llama-index|crewai|autogen|semantic-kernel)' /workspace/**/*.txt /workspace/**/*.toml
# Find dataset URLs
grep -rE 'download_dataset|load_dataset\(|hf_datasets|dataset_url=' /workspace
For each external artifact:
- Is the source URL / repo signed or pinned by commit / SHA256?
- Who has push rights to the upstream repository?
- Is there a sandboxed eval that runs trigger-phrase / canary checks?
4. Exploitation goals
| Goal | Impact | Indicator |
|---|---|---|
| Backdoor trigger | High | Output differs on trigger vs benign prompt |
| Token-stealing dep | Critical | OpenAI / Anthropic key in attacker's logs |
| RAG poisoning at index time | High | Poisoned answer reproducible by query |
| Plugin-description injection | High | Hijacked tool call across model versions |
| Persistent fine-tune backdoor | Critical | Backdoor survives retrain |
5. PoC payloads
Backdoor trigger sweep
Generate a small phrase corpus (random 3-grams of uncommon words), ask the model the same benign question with each phrase prepended, and compare output entropy / classification.
import itertools, hashlib, requests
words = ["banana", "monkey", "forklift", "azure", "kazoo", "ribbon", "soliton"]
for triple in itertools.permutations(words, 3):
prompt = " ".join(triple) + ". What is 2+2?"
resp = requests.post(API, json={"prompt": prompt}).json()["text"]
print(hashlib.sha256(resp.encode()).hexdigest()[:8], triple, resp[:80])
Outliers in the response hash distribution are candidate triggers.
Typo-squat hunting in build manifests
python -m pip download --no-deps -d /tmp/llm-deps -r requirements.txt
ls /tmp/llm-deps | while read f; do
pkg="${f%-[0-9]*}"
grep -q "^$pkg$" known-good.txt || echo "UNKNOWN: $f"
done
Index-time poisoning
Submit a "feedback" or "knowledge document" with attacker-chosen content claiming authoritative an
常见问题
什么是供应链攻陷?
就是产品所依赖的某个部分,例如软件包或模型文件,在到达产品之前就被恶意植入或篡改。
什么是名称相似的软件包?
该技能指的是与真实软件包名称高度相似的名字,它可能诱使开发人员安装错误的软件包。
如何降低这种风险?
该技能建议固定版本并在使用前检查来源,具体如何实施由团队决定。
详情
作者的原始描述
Hunt LLM supply-chain compromise (OWASP LLM03:2025) — malicious or backdoored models, datasets, adapters, plugins, MCP servers, and tokenizer / framework dependencies that ship inside an AI-integrated product.
热度
- GitHub 星标
- 6.5k
- 排名
- #13974
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …