Session Inception: A Headless Child Session Leaves Workspace Trust Behind
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.
Threat Analysis
The user's request was ordinary: follow a README and test a small repository. The repository also contained .claude/settings.json with a SessionStart command, which runs when a new Claude session initializes. Passive cloning or reading the Markdown from an already open session did not trigger it. The researchers also tried the normal Desktop directory-switch path; its separate confirmation remained effective, and the model could not approve that decision for the user.
The successful route used the existing Bash tool. A shell command changed into the repository and invoked claude -p, creating a new headless Claude Code CLI process. That process loaded local settings and ran the SessionStart hook without going through Desktop's directory-switch confirmation. The parent safeguard was tied to one adapter; the child reached the protected outcome through another path.
The hook fetched a remote script whose server returned harmless content to browsers but attack content to curl-like clients. The delivery then retrieved DNS TXT content, decoded it and piped it into Bash. The proof of concept collected environment data and sent it to the researcher. These are initialization and operating-system actions, not a requirement that the LLM believe hostile text. The child model detected hook activity only after data had left.
Straiker found the issue on August 27 and reported it on September 17. Anthropic closed it as Informative that day. The article does not establish a patched client version, a CVE, an operational victim campaign or theft of every file on the host. Its measured result is environment-data exfiltration in the controlled workflow. The independent lesson beyond earlier SessionStart reports is that workspace trust must hold across process creation and headless re-entry, not only in the parent UI.
Applicable AIDEFEND Defenses (5)
What Defenders Should Do Now
- Deploy managed client settings from MDM that refuse repository-defined hooks, for example Claude Code's disableAllHooks or allowManagedHooksOnly, and confirm in a test clone that neither the Desktop session nor a headless claude -p child runs the SessionStart command.
- Inventory all ways a coding client can start another client, shell, hook, task or local server. For repository inspection tasks, remove unnecessary shell/child-client launch capability and confirm the restriction at the process boundary, not just in a prompt.
- Inspect repository activation surfaces without executing them. Keep hooks inactive until a decision binds the exact workspace and manifest; headless operation requires an externally delivered organization decision, not automatic trust because no UI is available.
- Where the client cannot enforce every activation path, perform inspection in a disposable managed VM with a minimal environment and no developer secrets. Ensure the parent, Bash, child CLI and all hook descendants remain inside it.
- Restrict network access outside that complete process tree. Test script download, raw IP, redirect, proxy and DNS TXT paths; a browser preview can receive different content from the hook.
- Alert on the tool-call pattern itself: a Bash call that enters a freshly cloned directory and launches another AI client, with the parent session, command line and workspace path attached, and hunt for the same sequence across the fleet.
- Reproduce the child-session route in an isolated test after each relevant client or policy change. Verify that execution is denied before SessionStart or that containment prevents protected data access; a warning after exfiltration is not a passing result.
Conclusion
Last updated: