/proc/self/environ. The mapped howTo does not make validation and file opening atomic, so production code must separately resist symlink-swap and TOCTOU races.Claude Code GitHub Action: When a File-Read Tool Crosses the CI Secret Boundary
Microsoft found that untrusted GitHub issue, pull request, or comment text could direct Claude Code GitHub Action to read /proc/self/environ. Bash commands were inside bubblewrap and received a scrubbed environment, but the in-process Read tool used a different path and returned ANTHROPIC_API_KEY; removing its prefix helped evade refusal and GitHub redaction. Anthropic patched the reported sensitive /proc read, but every tool path still needs the same secret boundary and deterministic authorization.
Threat Analysis
- Untrusted GitHub text becomes agent context. An attacker with no repository write access can place a compliance-framed instruction in an issue, pull request, or comment that an eligible workflow passes to Claude Code.
- Two tool paths enforce different boundaries. Bash runs inside bubblewrap and receives environment scrubbing through
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB. The in-process Read tool was outside both protections and could open/proc/self/environ. - Transformation weakens downstream filters. The prompt asks Claude to remove the first seven characters from the Anthropic key, avoiding the model's refusal behavior and the recognizable
sk-ant-pattern used by GitHub redaction. - Several release channels may exist. Depending on workflow configuration, transformed data could leave through WebFetch, Bash, GitHub MCP actions, or
show_full_outputlogs. - This was controlled research and is patched. Microsoft reported the issue on April 29, 2026 and says Anthropic fixed it in Claude Code 2.1.128 by rejecting reads of sensitive
/procfiles.
Applicable AIDEFEND Defenses (6)
/proc from repository paths inside an allowed Read tool.What Defenders Should Do Now
- Update every Claude Code runner and Action image to version 2.1.128 or later. In an isolated repository, verify that Read and every other filesystem-capable tool reject direct and canonical variants of sensitive
/procpaths, traversal, and sibling-prefix escapes. - Review workflow triggers and trust conditions. Do not expose secrets and external or state-changing tools to a job that automatically consumes issue, pull request, or comment text from an untrusted actor.
- Put all model-proposed file actions through one deterministic selector. Resolve paths under an approved checkout root. Open files relative to a trusted root descriptor with
openat2(RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS),O_NOFOLLOW, or a platform-equivalent atomic mechanism, then pass that same descriptor to Read instead of checking and reopening by path. Test symlink swaps and TOCTOU races. - Use a no-tool quarantined model plus a validating broker to parse untrusted GitHub content. Give the privileged model only allowlisted repository-task fields and opaque object IDs, and derive its signed tool scope from workflow policy rather than the text being analyzed.
- Keep outbound access default-deny and disable
show_full_outputfor secret-bearing jobs. Separately test prefix-stripped and otherwise transformed values at WebFetch, Bash, GitHub MCP, task-output, and log release gates. - If exposure is possible, preserve workflow input, tool-call, output, network, and audit evidence; revoke and rotate the Anthropic key; inspect provider usage; and review any GitHub actions the job could perform.
2 additional considerations
Derived-secret lineage across transformations and allowed sinks
Anthropic API-key revocation adapter
Conclusion
The reported defect was not that Claude Code had no sandbox. It was that Bash and Read crossed the same secret boundary through different enforcement paths. The patch closes the documented /proc read, while the broader engineering lesson remains: untrusted CI text must be separated from privileged planning, every proposed path must pass one deterministic selector, and sensitive values must stay protected after transformation and through every output channel.