Skip to content

ASI04:Agentic 供應鏈漏洞

Agentic Supply Chain Vulnerabilities

說明

Agentic Supply Chain Vulnerabilities 發生於 Agent、工具與其使用的相關產物由第三方提供,而這些項目可能本身具有惡意、已遭入侵,或在傳輸途中被竄改。這些依賴可以是靜態或動態來源的元件,包括 model 與 model weight、工具、plug-in、dataset、其他 Agent、Agentic interface——例如 MCP(Model Context Protocol)、A2A(Agent2Agent)——Agentic registry、相關 artifact 或 update channel。這些依賴可能把不安全的程式碼、隱藏指令或欺騙性行為帶入 Agent 的 execution chain。

LLM03:2025 Supply Chain Vulnerabilities 已深入處理 supply chain,但其重點在靜態依賴。不同於傳統 AI 或軟體供應鏈,Agentic ecosystem 經常在執行階段組合 capability,例如動態載入外部工具與 Agent persona,因而擴大 attack surface。這種分散式 runtime coordination 加上 Agentic autonomy,會形成一條運行中的供應鏈,使漏洞可以在 Agent 之間級聯傳播。這使焦點從 manifest 轉向多樣且往往不透明元件的 runtime security。處理這個問題需要同時重視開發階段工具與 runtime orchestration,因為元件會被動態載入、共享與信任。

本項在 Agentic Threats and Mitigations 中對應 T17 Supply Chain Compromise,並橫跨 T2 Tool Misuse、T11 Unexpected RCE and Code Attacks、T12 Agent Communication Poisoning、T13 Rogue AgentT16 Insecure Inter-Agent Protocol Abuse

常見漏洞範例

  1. Poisoned prompt templates loaded remotely — Agent 自動從外部來源取得 prompt template,而 template 內含隱藏指令,例如外洩資料或執行破壞性動作,導致 Agent 在非開發者預期的情況下執行惡意行為。
  2. Tool-descriptor injection — 攻擊者把隱藏指令或惡意 payload 嵌入工具 metadata、MCP descriptor 或 agent card;host Agent 將其解讀為受信任的指引並據此執行。
  3. Impersonation and typosquatting — 當 Agent 動態發現或連接外部工具或服務時,可能以兩種方式受騙:一是 typo-squatted endpoint,也就是刻意使用近似名稱來誤導解析;二是 symbol attack,也就是惡意服務故意冒充合法工具或 Agent,模仿其 identity、API 與 behavior 來取得信任並執行惡意動作。
  4. Vulnerable Third-Party Agent(Agent→Agent) — 帶有未修補漏洞或不安全預設值的第三方 Agent 被加入 multi-agent workflow。遭入侵或有 bug 的 peer Agent 可以被用來 pivot、洩漏資料,或向原本受信任的 Agent 轉送惡意指令。
  5. Compromised MCP / Registry Server — 惡意或遭入侵的 Agent management/MCP Server(或 package registry)提供看似已簽章的 manifest、plug-in 或 Agent descriptor。由於 orchestration system 信任 registry,遭竄改的元件與 descriptor injection 因而可以大規模擴散。
  6. Poisoned knowledge plugin — 常用的 RAG plugin 從已被植入特製資料的第三方 indexer 取得 context。Agent 在持續使用這些資料的過程中逐步產生偏差,並在正常操作時外洩敏感資料。

攻擊情境範例

  1. Amazon Q Supply Chain Compromise — Q for VS Code repository 中的 poisoned prompt 隨 v1.84.0 發布給數千名使用者,直到之後才被發現;雖然攻擊本身未成功,但這顯示上游 Agent logic 遭竄改後,如何透過 extension 級聯並放大影響。
  2. MCP Tool Descriptor Poisoning — 研究人員展示 GitHub MCP 中的 Prompt Injection:惡意 public tool 在 metadata 內隱藏 command;工具被呼叫後,assistant 在使用者不知情的情況下外洩 private repository data。
  3. Malicious MCP Server Impersonating Postmark — 被報導為第一個出現在實際環境中的惡意 MCP Server;它在 npm 上冒充 postmark-mcp,並暗中把 email BCC 給攻擊者。
  4. AgentSmith Prompt-Hub Proxy Attack — Prompt proxying 外洩資料並劫持 response flow,操弄 Agentic system 中的 dynamic orchestration。
  5. 遭入侵的 NPM package — 例如被污染的 nx/debug release 被 Coding Agent 自動安裝,使隱藏 backdoor 能夠外洩 SSH key 與 API token,並讓 supply-chain compromise 在 Agentic workflow 中進一步傳播。
  6. Agent-in-the-Middle via Agent Cards — 遭入侵或 rogue peer 在其 agent card(例如 /.well-known/agent.json)中宣告誇大的 capability;host Agent 因此選擇它處理任務,使敏感 request 與資料被路由到攻擊者控制的 Agent,再由其外洩或竄改 response。

預防與緩解指南

  1. Provenance and SBOMs, AIBOMs — 對 manifest、prompt 與 tool definition 進行簽章與 attestation;要求並實際運用 SBOM、AIBOM 與定期 attestation;維護 AI component inventory;使用 curated registry,並阻擋不受信任的來源。
  2. Dependency gatekeeping — 採 allowlist 與版本 pinning;掃描 typosquat(PyPI、npm、LangChain、LlamaIndex);安裝或啟用前驗證 provenance;自動拒絕未簽章或未驗證的項目。
  3. Containment and builds — 在具有嚴格 network 或 syscall limit 的 sandboxed container 中執行敏感 Agent;要求 reproducible build。
  4. Secure prompts and memory — 將 prompt、orchestration script 與 memory schema 納入 version control 與 peer review,並掃描 anomaly。
  5. Inter-agent security — 透過 PKI 與 mTLS 強制 mutual authentication 與 attestation;不得開放註冊;所有 inter-agent message 都必須簽章並驗證。
  6. Continuous validation and monitoring — 在 runtime 重新檢查 signature、hash 與 SBOM(包含 AIBOM);監控 behavior、privilege usage、lineage 與 inter-module telemetry 的 anomaly。
  7. Pinning — 以 content hash 與 commit ID 固定 prompt、tool 與 config。要求 staged rollout、differential test,並在 hash drift 或 behavior change 時自動 rollback。
  8. Supply chain kill switch — 實作緊急撤銷機制;偵測到 compromise 時,可以立即在所有 deployment 停用特定工具、prompt 或 Agent connection,以防止進一步的級聯損害。
  9. 應用設計採 Zero-trust security model — 以具備 security fault tolerance 的方式設計系統,假設 LLM 或 Agentic function component 可能失效或遭利用。

參考資料

  1. https://www.bleepingcomputer.com/news/security/amazon-ai-coding-agent-hacked-to-inject-data-wiping-commands/
  2. https://invariantlabs.ai/blog/mcp-github-vulnerability
  3. Reconstructing a timeline for Amazon Q prompt infection
  4. https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/agent-in-the-middle-abusing-agent-cards-in-the-agent-2-agent-protocol-to-win-all-the-tasks/
  5. How an AI Agent Vulnerability in LangSmith Could Lead to Stolen API Keys and Hijacked LLM Responses - Noma Security

原作:OWASP Top 10 For Agentic Applications 2026
專案:OWASP Gen AI Security Project - Agentic Security Initiative
授權:CC BY-SA 4.0
本翻譯為非官方繁體中文版本,並依 CC BY-SA 4.0 授權釋出。