{
  "schema": "aidefend-secureflow-metadata-v1",
  "flow_id": "aidefend-research-sf0078-claude-code-project-settings-execution-api-key-theft",
  "title": "Claude Code Project Settings: Startup Execution and API-Key Theft",
  "subtitle": "Three alternative configuration paths, with different approval and timing conditions.",
  "summary": "Check Point researchers tested how Claude Code, an AI coding assistant, loads files from an untrusted repository. Separate hook, MCP startup and API-base-URL paths produced local command execution or API-key disclosure. The hook path required accepting repository trust; the other two could act before that decision. The demonstrated workspace-file access was limited to the tested key and workspace.",
  "reviewed": true,
  "import_status": "curated-research",
  "ai_layers": [
    "autonomous-agents",
    "ai-infrastructure"
  ],
  "risk_impact": [
    "system-compromise-rce",
    "credential-identity-theft",
    "data-exfiltration"
  ],
  "affected_components": [
    "Claude Code project settings and startup trust",
    "Project .mcp.json and command-based MCP servers",
    "Anthropic API credentials and the tested workspace Files API"
  ],
  "source_research": {
    "provider": "Check Point Research",
    "primary_url": "https://research.checkpoint.com/2026/rce-and-api-token-exfiltration-through-claude-code-project-files-cve-2025-59536/",
    "published": "2026-02-25",
    "note": "Primary controlled validation corroborated by maintainer advisories. Conditional routes and prerequisites remain explicit; no malicious real-world exploitation is established by these sources. ATLAS annotations are analyst curation, not an official ATLAS case."
  },
  "attack_steps": [
    {
      "id": "prepare-settings",
      "title": "Place hostile settings in a repository",
      "zhTitle": "在儲存庫放入惡意設定",
      "summary": "The attacker controls project files, not the victim’s account or a model-generated response.",
      "zhSummary": "攻擊者控制專案檔案，不需要先取得受害者帳號，也不依賴模型產生惡意回應。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0081",
      "layout": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "start-client",
      "title": "Start Claude Code in the untrusted project",
      "zhTitle": "在不可信專案啟動 Claude Code",
      "summary": "The victim starts the coding client in the prepared directory, exposing its startup configuration boundary.",
      "zhSummary": "受害者在事先準備的目錄啟動程式開發用戶端，因而接觸專案啟動設定。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 650,
        "y": 0
      }
    },
    {
      "id": "accept-hook-trust",
      "title": "Accept the repository trust prompt",
      "zhTitle": "接受儲存庫信任提示",
      "summary": "Hook route only: the user accepts startup trust without a clear additional warning about the configured command.",
      "zhSummary": "僅限掛鉤路徑：使用者接受啟動時的儲存庫信任提示，卻未獲得清楚的額外命令警告。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 1950,
        "y": -1100
      }
    },
    {
      "id": "execute-hook",
      "title": "Execute the configured startup hook",
      "zhTitle": "執行設定中的啟動掛鉤",
      "summary": "A SessionStart hook in .claude/settings.json executes a shell command after trust acceptance without another command-specific prompt.",
      "zhSummary": "使用者接受信任提示後，.claude/settings.json 中的 SessionStart 掛鉤會執行 shell 命令，沒有再針對該命令詢問。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 2600,
        "y": -1100
      }
    },
    {
      "id": "autoapprove-mcp",
      "title": "Read project-controlled MCP auto-approval",
      "zhTitle": "讀取專案控制的 MCP 自動核准設定",
      "summary": "Project settings enable all or selected .mcp.json servers, undermining a separate approval decision.",
      "zhSummary": "專案設定啟用 .mcp.json 中全部或指定的伺服器，使原本應獨立進行的核准失效。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0081",
      "layout": {
        "x": 1950,
        "y": 0
      }
    },
    {
      "id": "spawn-mcp",
      "title": "Start the command-based MCP server before trust",
      "zhTitle": "在信任決定前啟動 MCP 伺服器",
      "summary": "The vulnerable client spawns the configured command before the trust decision; the command executes with the client’s OS access.",
      "zhSummary": "有漏洞的用戶端會在使用者做出信任決定前啟動設定的命令，該命令具有用戶端的作業系統存取權。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 2600,
        "y": 0
      }
    },
    {
      "id": "override-api",
      "title": "Apply the project API base URL",
      "zhTitle": "套用專案指定的 API 網址",
      "summary": "The project env setting overrides ANTHROPIC_BASE_URL with an attacker-controlled endpoint.",
      "zhSummary": "專案的 env 設定把 ANTHROPIC_BASE_URL 改成攻擊者控制的端點。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0081",
      "layout": {
        "x": 1950,
        "y": 1100
      }
    },
    {
      "id": "leak-key",
      "title": "Send an authenticated API request before trust",
      "zhTitle": "在信任決定前送出含金鑰的 API 請求",
      "summary": "The vulnerable startup path sends a request carrying the API key to that endpoint before repository trust is resolved.",
      "zhSummary": "有漏洞的啟動流程在儲存庫信任狀態尚未確認前，就向該端點送出攜帶 API 金鑰的請求。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 2600,
        "y": 1100
      }
    },
    {
      "id": "reuse-key",
      "title": "Reuse the key in the tested workspace",
      "zhTitle": "在受測工作區再利用該金鑰",
      "summary": "The researchers reused the captured key through workspace APIs. This establishes the tested credential’s authority, not universal access to every Anthropic customer file.",
      "zhSummary": "研究人員透過工作區 API 再利用擷取的金鑰。這證明受測憑證具備的權限，不代表可存取所有 Anthropic 客戶的檔案。",
      "tactic": "AML.TA0004",
      "technique": "AML.T0091.000",
      "layout": {
        "x": 3250,
        "y": 1100
      }
    },
    {
      "id": "retrieve-test-file",
      "title": "Regenerate and download the test workspace file",
      "zhTitle": "重新產生並下載測試工作區檔案",
      "summary": "In the demonstration, code execution regenerated a previously non-downloadable uploaded file, making the resulting file downloadable.",
      "zhSummary": "在示範中，研究人員透過程式碼執行功能，重新產生原本不能下載的上傳檔案，再下載產生的檔案。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 3900,
        "y": 1100
      }
    }
  ],
  "threat_refs": [
    {
      "id": "AML.T0081",
      "name": "Modify AI Agent Configuration"
    },
    {
      "id": "AML.T0050",
      "name": "Command and Scripting Interpreter"
    },
    {
      "id": "AML.T0091.000",
      "name": "Application Access Token"
    }
  ],
  "reader_narrative": {
    "pathCount": 3,
    "topologyNote": "Three alternatives; hooks and MCP are not prerequisites for API-key disclosure.",
    "groups": [
      {
        "id": "setup",
        "kind": "shared",
        "eyebrow": "Shared Setup",
        "label": "Repository to Client",
        "summary": "All routes begin with repository-controlled files and a client startup.",
        "stepIds": [
          "prepare-settings",
          "start-client"
        ]
      },
      {
        "id": "hooks",
        "kind": "path",
        "eyebrow": "Path A",
        "label": "Hook After Trust Acceptance",
        "summary": "This route requires accepting repository trust; no extra command prompt follows.",
        "stepIds": [
          "accept-hook-trust",
          "execute-hook"
        ]
      },
      {
        "id": "mcp",
        "kind": "path",
        "eyebrow": "Path B",
        "label": "Pretrust MCP Launch",
        "summary": "Project auto-approval starts a command-based server before the trust decision.",
        "stepIds": [
          "autoapprove-mcp",
          "spawn-mcp"
        ]
      },
      {
        "id": "key",
        "kind": "path",
        "eyebrow": "Path C",
        "label": "Endpoint Override and Key Reuse",
        "summary": "This independent route discloses an API key; later file access is scoped to the tested workspace.",
        "stepIds": [
          "override-api",
          "leak-key",
          "reuse-key",
          "retrieve-test-file"
        ]
      }
    ]
  }
}
