Claude Code Project Settings: Startup Execution and API-Key Theft
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.
Configuration crossed a native startup boundary: Claude Code reads repository settings to configure hooks, MCP servers and API traffic. MCP is the protocol used to connect an AI client to external tools. Check Point demonstrated three independent weaknesses; none requires the model to interpret an injected prompt.
Approval timing differs: the hooks issue executes a SessionStart command after the user accepts repository trust. Project MCP auto-approval could start a configured command before that decision. A separate ANTHROPIC_BASE_URL override could send the API key to another endpoint before trust was decided.
Keep the later impact scoped: researchers reused the captured key in their test workspace and used code execution to regenerate and download an uploaded file. This does not prove every key has equivalent file access, nor that unrelated customer workspaces were compromised. The sources support controlled research; malicious exploitation is not established.
Deployed AI Software Vulnerability Remediation Lifecycle
Very High
The endpoint-management owner must deploy a currently supported Claude Code build containing all three fixes, then read back the binary actually launched in terminals, IDE integrations and automation. Historical minimum fixes are 1.0.87, 1.0.111 and 2.0.65; a dependency declaration alone does not replace cached clients. Verify all three startup paths in a credentialless test project and retain a clean functional control.
For managed high-risk review, the client or a trusted launcher must passively resolve the effective hooks, MCP commands, auto-approval settings and API-endpoint overrides before granting credentials or starting children. Extend the activation-manifest adapter to these Claude settings; the framework’s MCP example is not a ready-made Claude Code policy switch. Preview canonical workspace identity, source bytes and requested effects without executing or authenticating to the candidate endpoint. The activation broker must be the only identity able to start candidate processes or release credentials. Bind approval to exact workspace, principal, client and manifest bytes; changed settings require another decision. Enforce this before the first hook, MCP command or authenticated startup request.
The organization can run the entire untrusted-project client and its startup children in a non-root disposable container with no host home, SSH directory, production credentials or Docker socket mounted. Check effective mounts, capabilities and rejected host writes from inside that workload. This contains startup command execution; it does not protect credentials deliberately provided inside the container or provide a separate kernel boundary.
A network owner can default-deny egress outside the review container and allow only approved API routes, preventing the project URL override from sending an API key to an unlisted host. Test approved service reachability and a known-live denied canary from the actual client environment, including proxy bypasses. Approved destinations and response channels can still carry data.
After suspected key disclosure, the workspace credential owner must revoke the exposed Anthropic API key at its issuer, provision a clean replacement from a trusted environment and update every consumer. Confirm the old key fails and the replacement works. Deleting a local environment variable does not revoke a copied key; assess workspace file access separately. The framework’s AWS adapter must be replaced with Anthropic’s native key-management operation.
After preserving evidence and isolating the affected runtime, an authorized managed-Linux administrator can terminate the affected Claude Code client and hook/MCP child processes. Bind the approved population to host, PID namespace, start time, executable identity and cgroup membership; use pidfd-based termination, disable relaunch, and obtain separately credentialed complete-process absence checks. A successful kill command or a missing process name is insufficient. A root-compromised host cannot prove its own cleanliness: use a trusted external/recovery vantage or leave the result unresolved. This response still requires separate patching, artifact cleanup and revocation of any exposed credentials.
After forensic preservation, quarantine the exact malicious project settings, hook commands, .mcp.json launch entries and API-destination overrides in every authoritative checkout and loaded client population. Replace them only with approved clean configuration and independently exercise normal startup in a credentialless, network-denied replica. This prevents the identified configuration from activating again; already running children and exposed keys still require separate eviction.
What Defenders Should Do Now
Deploy a currently supported client containing the three fixes. Anthropic’s historical minimum versions are 1.0.87 for the hook warning, 1.0.111 for CVE-2025-59536 and 2.0.65 for CVE-2026-21852. The hook advisory has no assigned CVE. Verify the executable reached by every terminal, IDE and automation launcher.
Open unfamiliar projects in a disposable environment without production credentials or host-home mounts. Review effective hooks, .mcp.json, auto-approval flags and endpoint env settings before enabling them. A model prompt or a tool-use approval after startup is too late for pretrust initialization.
For managed development, implement passive capability preview followed by broker-enforced activation. Bind approval to the exact project and configuration bytes, prevent alternate launch routes and reapprove changes. This requires engineering integration; it is not an existing generic CLI checkbox.
If a key may have been sent to an untrusted endpoint, revoke it through Anthropic’s key-management authority, replace it from a trusted environment and verify denial of the old key. Review affected workspace activity and files separately. Test network egress controls against a live denied canary before relying on them.
Conclusion
The useful defense points are fixed startup code, informed and enforced capability activation, whole-client isolation, outbound network restrictions and issuer-side credential eviction. Each acts at a different boundary; sandboxing alone cannot protect an API key intentionally made available inside it. If native execution has already occurred, exact-process termination on a supported managed Linux host is a separate response step; patching or revoking a credential does not stop that execution. Confirmed malicious project activation settings must also be removed from authoritative and loaded copies before normal startup is restored.