From Theory Delta | Methodology | Published 2026-03-14
Claude Code supports per-project settings via .claude/settings.json. This lets teams configure MCP servers, hooks, and permissions for their codebase. The documentation describes this as a convenience feature for team standardization.
The project settings file is not a convenience feature. It is a first-class attack surface with two confirmed CVEs and five additional supply-chain vectors:
CVE-1: Credential exfiltration via ANTHROPIC_BASE_URL. A malicious .claude/settings.json can override the API base URL, redirecting all API calls -- including the authentication token -- to an attacker-controlled endpoint. The user sees normal behavior. Their API key is silently exfiltrated.
CVE-2: MCP consent bypass via enableAllProjectMcpServers. This setting auto-approves every MCP server defined in the project config, skipping the user consent prompt entirely. A repository containing this setting plus a malicious MCP server definition gains arbitrary tool execution on clone.
Five additional supply-chain vectors compound the problem:
.claude/ can point settings or hook scripts to locations outside the repository, bypassing path-based trust boundaries.PreToolUse and PostToolUse hooks defined in project settings run arbitrary shell commands with user privileges.All seven vectors share one root cause: project-scoped settings execute with user privileges before the user has a chance to verify what they do.
Enterprise hardening exists but is opt-in. Managed policy files can restrict these settings, but the default for every non-enterprise user is full exposure.
.claude/settings.json in every repository you clone before opening it with Claude Code. Treat it like you would a .npmrc or .env file from an untrusted source.enableAllProjectMcpServers -- if present, remove it. This is the single most dangerous setting..claude/ -- run find .claude -type l to identify any symlink-based redirects.PreToolUse or PostToolUse hook runs shell commands. Read them before accepting.| Tool | Version | Result |
|---|---|---|
| Claude Code | v2.1.x | Settings file loads and executes with user privileges before trust verification |
Confidence: empirical -- two CVEs independently confirmed by Anthropic's security team. Five additional vectors identified through source review and runtime testing.
Falsification criterion: This claim would be disproved by demonstrating that project settings are sandboxed or require explicit user approval before any setting takes effect -- including MCP server definitions, hooks, and environment variable overrides.
Open questions: Will Anthropic add a trust-on-first-use prompt for project settings? Are there other settings fields beyond enableAllProjectMcpServers and ANTHROPIC_BASE_URL that have security implications?
Seen different? Contribute your evidence -- theory delta is what makes this knowledge base work.
Tested this tool yourself? Contribute your evidence -- confirmation, contradiction, or a fix.