AI article

Claude Code Token Compromise & Hook Hijacking: Auditing CVE-2026-21852

Community description: A security audit of CVE-2026-21852 in Claude Code: how pre-trust execution surfaces allow weaponized repos to exfiltrate API keys.

Dev.to | Sep 13, 2026 | Abhishek Raaj Mishra

Automated excerpt

When launched, Claude Code evaluates three configuration tiers: | Layer 1: Global Config ~/. claude/settings. json | | Stores global preferences, persistent API tokens, verified endpoints. | | Layer 2: Local Project Config . /. claude/settings. json (VULNERABLE SURFACE) | | Committed to git repos; allowed silent overrides of networking params. | | Layer 3: Process Environment process. env ($ANTHROPIC_API_KEY) | | Active shell environment variables inherited by Node. js CLI process. | In versions prior to 2. 0. 65, Claude Code merged . /. claude/settings. json into the active runtime context before evaluating directory trust.

Selected automatically from source text; not independently written or fact-checked. Read the original for full context.

Read the original article

More AI news