{
  "schema": "aidefend-secureflow-metadata-v1",
  "flow_id": "aidefend-research-sf0062-agentcorruption-agentcore-memory-persistent-c2",
  "title": "AgentCorruption: A Stolen Execution Role Turns Memory into Persistent C2",
  "subtitle": "Controlled AgentCore research with separate conversation-reading, memory-poisoning, agent-invocation and outbound-secret branches.",
  "summary": "Zenity tested an AWS Bedrock AgentCore deployment, a managed environment for running AI agents, with a network-capable agent and a broad execution role. The agent relayed temporary role credentials from its metadata endpoint. Off-platform API calls then reached other memories and agents. The distinctive persistence path wrote short-term conversation events that configured extraction strategies could turn into long-term records; later retrieval directed the agent to a mutable command page. The reach was demonstrated within an account and region, not as a microVM escape or automatic cross-account compromise. The researchers observed major default-role restrictions on September 29; existing deployed roles still require independent inspection.",
  "reviewed": true,
  "import_status": "curated-research",
  "ai_layers": [
    "autonomous-agents"
  ],
  "risk_impact": [
    "system-compromise-rce",
    "data-exfiltration"
  ],
  "affected_components": [
    "AgentCore Runtime MMDS",
    "Strands http_request",
    "AgentCore execution role",
    "AgentCore Memory CreateEvent",
    "AgentCore long-term extraction strategies",
    "AWS Secrets Manager"
  ],
  "source_research": {
    "provider": "Zenity Labs",
    "primary_url": "https://labs.zenity.io/post/agentcorruption-how-a-single-prompt-collapsed-the-entire-cloud-security-model",
    "published": "2026-10-08",
    "note": "Source-verified AIDEFEND research curation. ATLAS technique annotations are analyst mappings, not an official ATLAS case study."
  },
  "attack_steps": [
    {
      "id": "step-1",
      "title": "Induce the Network Tool to Read Metadata",
      "zhTitle": "誘使網路工具讀取中繼資料",
      "summary": "The researchers deployed a Strands agent with http_request and asked it to fetch the runtime metadata endpoint. Arbitrary HTTP reachability was enabled for the test; a prompt alone cannot create an absent tool.",
      "zhSummary": "研究人員部署提供 http_request 工具的 Strands agent，並誘使其讀取執行環境的中繼資料（metadata）端點。受控測試環境中已事先開放任意 HTTP 存取；單靠提示詞無法憑空呼叫系統中不存在的工具。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0053",
      "layout": {
        "x": -1440,
        "y": 0
      }
    },
    {
      "id": "step-2",
      "title": "Export the Agent Role Credentials",
      "zhTitle": "取出並匯出 agent 角色憑證",
      "summary": "The metadata response includes temporary STS access-key, secret-key and session-token values. The agent relays them out, and the researchers validate the execution-role identity from their own terminal. Subsequent AWS API calls no longer need the model.",
      "zhSummary": "中繼資料端點回應了 STS 臨時 access key、secret key 與 session token。agent 將這些憑證對外傳出後，研究人員在外部終端機驗證該執行角色的身分；後續直接呼叫 AWS API，完全不必再經過模型中介。",
      "tactic": "AML.TA0013",
      "technique": "AML.T0055",
      "layout": {
        "x": -960,
        "y": 0
      }
    },
    {
      "id": "step-3",
      "title": "Discover Memory and Conversation Identifiers",
      "zhTitle": "找出記憶與對話識別碼",
      "summary": "Broad logs:DescribeLogGroups access reveals memory IDs. ListActors and ListSessions enumerate actor/session identifiers, and GetMemory describes enabled extraction strategies and namespaces. These are related discovery requests, not a direct read of every conversation.",
      "zhSummary": "過度寬鬆的 logs:DescribeLogGroups 權限外洩了記憶庫識別碼（memory ID）；後續透過 ListActors 與 ListSessions 列舉出參與者（actor）及工作階段（session），再以 GetMemory 查出啟用的擷取策略與命名空間。這些屬於關聯識別資料的探索，尚不等於直接讀取所有對話內容。",
      "tactic": "AML.TA0008",
      "technique": "AML.T0007",
      "layout": {
        "x": -480,
        "y": 0
      }
    },
    {
      "id": "step-4",
      "title": "Submit a Forged Conversation Event",
      "zhTitle": "送出偽造的短期對話事件",
      "summary": "Using the stolen role's CreateEvent permission over other memory resources, the researchers insert text into a selected memory/actor/session. This API writes short-term events; it does not directly overwrite an arbitrary long-term namespace.",
      "zhSummary": "研究人員利用遭竊角色對其他記憶資源擁有的 CreateEvent 權限，在選定的 memory、actor 與 session 寫入惡意文字。此 API 寫入的是短期對話事件（STM），無法直接強制覆寫任意長期記憶命名空間。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0080.000",
      "layout": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "step-5",
      "title": "Extract the Forged Event into Long-Term Memory",
      "zhTitle": "擷取偽造事件形成長期記憶",
      "summary": "The target's configured SEMANTIC, USER_PREFERENCE, SUMMARIZATION or EPISODIC strategy may retain the instruction as a fact, preference, summary or lesson. Persistence depends on extraction succeeding, not merely on CreateEvent returning success.",
      "zhSummary": "目標系統所設定的 SEMANTIC、USER_PREFERENCE、SUMMARIZATION 或 EPISODIC 策略，可能會將這項惡意指示沉澱保存為事實、偏好、摘要或經驗。攻擊能否長期持續生效，取決於擷取策略是否成功萃取，並非 CreateEvent 回傳成功就必然成立。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0080.000",
      "layout": {
        "x": 480,
        "y": 0
      }
    },
    {
      "id": "step-6",
      "title": "Recall the Poisoned Record in a Later Interaction",
      "zhTitle": "後續互動讀取遭投毒的記憶",
      "summary": "A later agent interaction retrieves the retained instruction. Its namespace and the actual retrieval behavior determine which users or sessions are affected; shared namespaces and per-actor poisoning are alternative reach mechanisms.",
      "zhSummary": "在後續的 agent 互動中，系統擷取並載入了被保存的惡意指示。記憶庫實際的命名空間劃分與擷取邏輯，決定了受影響的使用者或工作階段範圍；共用命名空間與個別 actor 投毒是兩種不同的波及路徑。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0051.001",
      "layout": {
        "x": 960,
        "y": 0
      }
    },
    {
      "id": "step-7",
      "title": "Fetch the Attacker-Controlled Command Page",
      "zhTitle": "讀取攻擊者可修改的命令網頁",
      "summary": "The remembered instruction tells the agent to fetch a researcher-controlled page before answering. Updating that page changes subsequent directives without rewriting memory; this requires the agent's available HTTP capability and a reachable endpoint.",
      "zhSummary": "記憶中殘留的指示要求 agent 在回答問題前，必須先存取研究人員控制的外部網頁。攻擊者只要更新該網頁內容，就能隨時更換後續指令而無須重新改寫記憶；其前提是 agent 具備 HTTP 對外連線能力且該端點網路可達。",
      "tactic": "AML.TA0014",
      "technique": "AML.T0072",
      "layout": {
        "x": 1440,
        "y": 0
      }
    },
    {
      "id": "step-8",
      "title": "Send Conversation Content to the Command Endpoint",
      "zhTitle": "把對話內容傳到命令端點",
      "summary": "The C2 demonstration uses the agent's available HTTP tool to send conversation content out. This is downstream of successful memory extraction and retrieval, not an unconditional consequence of possessing a memory ID.",
      "zhSummary": "這段持續性控制管道（C2）示範利用 agent 現有的 HTTP 工具，將使用者對話內容傳送至外部端點。這屬於記憶擷取與讀回成功後的後續危害，並非單純取得 memory ID 就會自動發生。",
      "tactic": "AML.TA0010",
      "technique": "AML.T0025",
      "layout": {
        "x": 1920,
        "y": 0
      }
    },
    {
      "id": "step-9",
      "title": "Read Other Conversation Events through the API",
      "zhTitle": "另以 API 讀取其他對話事件",
      "summary": "With the discovered identifiers and broad ListEvents permission, the stolen role reads selected short-term conversation events directly. This read-only impact branch does not need long-term poisoning.",
      "zhSummary": "取得識別碼後，遭竊角色憑藉過度寬鬆的 ListEvents 權限，直接讀取選定的短期對話事件。這條純讀取外洩分支完全不需要先對長期記憶進行投毒。",
      "tactic": "AML.TA0009",
      "technique": "AML.T0035",
      "layout": {
        "x": 0,
        "y": -780
      }
    },
    {
      "id": "step-14",
      "title": "Discover Other Agent Names and Runtime IDs",
      "zhTitle": "找出其他 agent 的名稱與 runtime 識別碼",
      "summary": "Using the exported role credentials, the researchers enumerate CloudWatch log groups with logs:DescribeLogGroups. Runtime log-group names reveal agent names and runtime IDs in the tested account and region. These identifiers support two separate branches: deriving ECR repository names or invoking another agent. Memory, actor and session enumeration is not required for either branch.",
      "zhSummary": "研究人員用已匯出的角色憑證呼叫 logs:DescribeLogGroups，列舉 CloudWatch（日誌與監控服務）的日誌群組，再從 runtime 日誌群組名稱解析出同帳號與區域內其他 agent 的名稱與 runtime 識別碼。取得這些資料後，可分別推得 ECR 儲存庫名稱，或呼叫另一個 agent；兩條分支都不必先列舉記憶庫、actor 或 session。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": -480,
        "y": -1560
      }
    },
    {
      "id": "step-10",
      "title": "Pull Agent Images and Inspect Source",
      "zhTitle": "下載 agent 映像並檢查原始碼",
      "summary": "Using the discovered agent names, the researchers derive ECR repository names by adding the observed bedrock-agentcore- prefix. Region-wide ECR permissions then allow them to download other agents' container images and inspect source code for outbound credential provider names. This branch does not require memory poisoning.",
      "zhSummary": "研究人員利用查得的 agent 名稱，在前面加上受測環境使用的 bedrock-agentcore- 前綴，推得 ECR 儲存庫名稱，再憑過度寬鬆的區域 ECR 權限下載其他 agent 的容器映像檔，從原始碼找出外部憑證提供者（credential provider）名稱。這條分支不需要先對記憶投毒。",
      "tactic": "AML.TA0009",
      "technique": "AML.T0035",
      "layout": {
        "x": 0,
        "y": -1560
      }
    },
    {
      "id": "step-11",
      "title": "Read Other Providers' Secrets Directly",
      "zhTitle": "直接讀取其他憑證提供者的 secrets",
      "summary": "Source-derived provider names identify Secrets Manager entries. GetSecretValue permissions on bedrock-agentcore-identity oauth2/* and apikey/* allow reading other providers' API keys or client secrets in the tested account/region. Brute-force discovery is another reported alternative, not a prerequisite for this source-code route.",
      "zhSummary": "原始碼中取得的提供者名稱可精確對應至 Secrets Manager 項目。由於受測角色對 bedrock-agentcore-identity 的 oauth2/* 與 apikey/* 擁有過大 GetSecretValue 權限，因而可直接讀取同帳號區域內其他提供者的 API key 或 OAuth client secret。研究報告提及的暴力列舉僅是另一種發現方式，並非此原始碼路徑的必要前提。",
      "tactic": "AML.TA0013",
      "technique": "AML.T0055",
      "layout": {
        "x": 480,
        "y": -1560
      }
    },
    {
      "id": "step-12",
      "title": "Invoke the Other Billing Agent",
      "zhTitle": "呼叫另一個帳務 agent",
      "summary": "Using a discovered runtime ID and broad InvokeAgentRuntime permission, researchers contact the billing agent and identify available file operations. This branch also requires the target to expose a useful file-reading capability.",
      "zhSummary": "研究人員利用查得的 runtime ID 與過度寬鬆的 InvokeAgentRuntime 權限，直接呼叫另一個帳務 agent，並辨識其掛載的檔案操作工具。這條側向分支的前提是目標 agent 確實對外開放可被利用的檔案讀取能力。",
      "tactic": "AML.TA0015",
      "technique": "AML.T0053",
      "layout": {
        "x": 0,
        "y": -2340
      }
    },
    {
      "id": "step-13",
      "title": "Retrieve billing.json through file_read",
      "zhTitle": "透過 file_read 取得 billing.json",
      "summary": "The controlled billing-agent demonstration reads billing.json through file_read and returns its contents. InvokeAgentRuntime alone does not automatically expose all conversation history or every file.",
      "zhSummary": "在帳務 agent 的受控示範中，研究人員透過其 file_read 工具讀取 billing.json 並取得機敏內容。單純擁有 InvokeAgentRuntime 權限，並不代表能自動存取所有對話歷史紀錄或任意本機檔案。",
      "tactic": "AML.TA0009",
      "technique": "AML.T0126",
      "layout": {
        "x": 480,
        "y": -2340
      }
    }
  ],
  "threat_refs": [
    {
      "id": "AML.T0080.000",
      "name": "AI Agent Context Poisoning: Memory"
    },
    {
      "id": "AML.T0053",
      "name": "AI Agent Tool Invocation"
    },
    {
      "id": "AML.T0072",
      "name": "Cyber Communication Channel"
    },
    {
      "id": "AML.T0025",
      "name": "Exfiltration via Cyber Means"
    }
  ]
}
