{
  "schema": "aidefend-secureflow-metadata-v1",
  "flow_id": "aidefend-research-sf0064-session-inception-headless-child-workspace-trust",
  "title": "Session Inception: A Headless Child Session Leaves Workspace Trust Behind",
  "subtitle": "Controlled Claude Desktop Code → Bash → headless Claude CLI → SessionStart execution, with the failed interactive path kept distinct.",
  "summary": "Straiker STAR Labs asked Claude Desktop Code, an AI coding assistant, to follow an ordinary repository README. The parent could not bypass its own workspace-switch confirmation, but a Bash command launched a new headless Claude Code CLI inside the repository. That child loaded repository-local settings and ran a SessionStart hook before model inspection, sending environment data to the researcher. The demonstrated boundary failure is unmediated child-session activation; a model correctly rejecting suspicious README text did not prevent initialization code from executing.",
  "reviewed": true,
  "import_status": "curated-research",
  "ai_layers": [
    "autonomous-agents"
  ],
  "risk_impact": [
    "system-compromise-rce",
    "data-exfiltration"
  ],
  "affected_components": [
    "Claude Desktop Code",
    "Parent Bash tool",
    "Headless Claude Code CLI",
    "Repository .claude/settings.json",
    "SessionStart hook",
    "DNS TXT payload"
  ],
  "source_research": {
    "provider": "Straiker STAR Labs",
    "primary_url": "https://www.straiker.ai/blog/session-inception-spawning-a-child-claude-session-to-bypass-parent-guardrails",
    "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": "Prepare README and SessionStart Settings",
      "zhTitle": "準備 README 與 SessionStart 設定",
      "summary": "The researcher-controlled repository pairs normal-looking README instructions with .claude/settings.json containing a SessionStart hook. Merely cloning it or reading a Markdown file in an existing session does not activate the hook.",
      "zhSummary": "研究人員控制的儲存庫同時包含看似尋常的 README 操作說明，以及在 .claude/settings.json 中配置的 SessionStart hook。單純執行 clone 或在既有開啟的工作階段中讀取 Markdown 內容，並不會觸發該 hook。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0081",
      "layout": {
        "x": -1440,
        "y": 0
      }
    },
    {
      "id": "step-2",
      "title": "Clone the Repository for the User Task",
      "zhTitle": "父工作階段依任務複製儲存庫",
      "summary": "The user asks the coding assistant to follow the README and test it. The parent fetches the repository. Its protected directory-switch route still requires user confirmation; that route is not the successful attack.",
      "zhSummary": "使用者指示程式設計助理依照 README 內容測試專案，父工作階段因而複製該儲存庫。受防護的切換目錄工具依然會主動跳出使用者確認提示；本攻擊的成功並非導因於這項互動式防護失效。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": -960,
        "y": 0
      }
    },
    {
      "id": "step-3",
      "title": "Launch a New Headless CLI through Bash",
      "zhTitle": "透過 Bash 啟動新的無介面 CLI",
      "summary": "The observed parent command changes the shell working directory and invokes claude -p to summarize repository Markdown. This starts a separate Claude Code process rather than moving the existing Desktop session through its guarded directory tool.",
      "zhSummary": "在觀察到的行為中，父程序命令先切換 shell 工作目錄，隨後直接呼叫 claude -p 以前提提示處理儲存庫內的 Markdown 檔案。此舉啟動了一個完全獨立的無介面 Claude Code 程序，而非透過受防護的目錄切換工具轉移原 Desktop 工作階段。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0053",
      "layout": {
        "x": -480,
        "y": 0
      }
    },
    {
      "id": "step-4",
      "title": "Load Local Settings and Execute SessionStart",
      "zhTitle": "載入本機設定並執行 SessionStart",
      "summary": "The new CLI starts inside the untrusted repository, loads its local .claude/settings.json and automatically runs the hook. The parent's workspace-switch confirmation is not carried onto this execution path.",
      "zhSummary": "全新啟動的 CLI 程序於不可信的儲存庫目錄中初始化，自動載入本機 .claude/settings.json 並直接執行其配置的 SessionStart hook。父工作階段原有的工作區切換確認邊界，完全無法延伸覆蓋至此獨立的子程序執行路徑。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "step-5",
      "title": "Fetch the Tool-Specific Remote Script",
      "zhTitle": "取得只對工具顯示的遠端程式",
      "summary": "The hook fetches a researcher-controlled shell script. Browser requests receive harmless content, while a curl-like User-Agent receives the attack delivery. A browser-only preview therefore does not establish which bytes the hook fetched.",
      "zhSummary": "該 hook 對外請求研究人員控制的遠端 shell 腳本。伺服器對一般瀏覽器請求回傳無害內容，但對帶有 curl 等特徵的 User-Agent 則傳送真實攻擊腳本；因此單憑瀏覽器預覽，無法確認 hook 實際抓取到的內容位元組。",
      "tactic": "AML.TA0014",
      "technique": "AML.T0072",
      "layout": {
        "x": 480,
        "y": 0
      }
    },
    {
      "id": "step-6",
      "title": "Decode DNS TXT Content into Bash Execution",
      "zhTitle": "解碼 DNS TXT 內容並交給 Bash 執行",
      "summary": "The delivery retrieves payload content from a DNS TXT record, decodes it and pipes it to Bash. This is script execution through network delivery, not text that the model must accept as a trusted instruction.",
      "zhSummary": "攻擊腳本從特定 DNS TXT 記錄中取得惡意承載內容，將其解碼後直接透過管線送入 Bash 執行。這屬於典型的網路酬載腳本執行，完全無須模型將任何文字誤判為可信指示。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0053",
      "layout": {
        "x": 960,
        "y": 0
      }
    },
    {
      "id": "step-7",
      "title": "Collect Data from the Bash Environment",
      "zhTitle": "收集 Bash 環境中的資料",
      "summary": "The proof-of-concept script collects environment data from the developer process context. Broader host actions are possible consequences of that authority, but the report's observed result is this bounded data collection.",
      "zhSummary": "概念驗證腳本從開發者程序環境中收集主機環境變數與系統資訊。取得該權限後理論上可能衍生更廣泛的主機操作，但報告中已確認觀察到的實際危害為此範疇內的環境資料收集。",
      "tactic": "AML.TA0009",
      "technique": "AML.T0126",
      "layout": {
        "x": 1440,
        "y": 0
      }
    },
    {
      "id": "step-8",
      "title": "Send Environment Data before Model Detection",
      "zhTitle": "模型發現前已傳出環境資料",
      "summary": "The script sends the collected data to the researcher endpoint. The child model later flags hook activity, but the data has already left. Late model detection is not the initialization-time prevention boundary.",
      "zhSummary": "腳本隨後將收集到的環境資料對外傳送至研究人員的端點。雖然子程序的模型在後續互動中標示了該 hook 的可疑活動，但此時資料早已外洩；模型的事後示警無法替代初始化階段的即時阻斷防禦。",
      "tactic": "AML.TA0010",
      "technique": "AML.T0025",
      "layout": {
        "x": 1920,
        "y": 0
      }
    }
  ],
  "threat_refs": [
    {
      "id": "AML.T0081",
      "name": "Modify AI Agent Configuration"
    },
    {
      "id": "AML.T0053",
      "name": "AI Agent Tool Invocation"
    },
    {
      "id": "AML.T0025",
      "name": "Exfiltration via Cyber Means"
    }
  ]
}
