Skip to content
Straiker·Indexed by this site · Originally published· Attacks →SelectedAttention42

How a Claude Code child session bypasses guardrails

How Spawning Child Claude Sessions Bypassed Guardrails

AI summary

Straiker STAR Labs researchers disclosed a Session Inception attack against Claude Code: the parent session is induced to run the claude -p command through its own shell, launching a brand-new child session inside a malicious repository; after the child session loads the repository's .claude/settings.json, the SessionStart hook executes automatically, sending data from the developer's computer to the attacker's server, all without triggering the workspace confirmation required by the parent path. Three earlier attempts—directly planting malicious settings, pre-trusting the attacker's domain, and using built-in tools to change directories—were all stopped by confirmation prompts or model refusals; the authors note that the confirmation mechanism itself did not fail, and that the gap is that permission checks are bound to a specific path rather than to the risk outcome, which differs from prompt injection that relies on persuading the model to perform dangerous actions. The payload uses the User-Agent to distinguish browsers from curl and hides the script in a DNS TXT record to evade scanning; Claude flagged the hook behavior afterward, but the data had already been transmitted.

Why it was selected

A complete record of the test process in which it was blocked by guardrails three times and bypassed via a sub-session on the fourth, pointing out the design gap in which permission checks are bound to paths rather than risk outcomes.

Read originalstraiker.ai