Skip to content
OTFotf
All posts

Claude Code vulnerabilities expose threats via local config, repo hooks, and MCPs

D
DaveAuthor
8 min read
Claude Code vulnerabilities expose threats via local config, repo hooks, and MCPs

Claude Code security vulnerabilities reported in June 2026 are a wake-up call for every developer running AI coding agents locally. Three major attack paths—config tampering, repository hook exploits, and Model Context Protocol (MCP) token hijack—have been uncovered, putting OAuth tokens, source code, and SaaS accounts at risk. These findings, summarized in a June 2026 dispatch by Thorsten Meyer and referencing Check Point Research and Mitiga Labs, show why the Claude Code attack surface is now central to development security. Anthropic has patched several remote code and API key vulnerabilities, but token theft via npm packages remains an open, actively exploitable vector. Protecting your environment now requires more than applying patches; it means rethinking what files and integrations you trust.

What are Claude Code security vulnerabilities reported in June 2026?

Security research published in June 2026—cited by Thorsten Meyer’s AI dispatch—details three key vulnerability chains in Claude Code:

  1. Local config tampering: Malicious npm packages can rewrite ~/.claude.json, the configuration file used by Claude Code agents. This allows redirection of authenticated traffic and theft of sensitive credentials.
  2. Repository hooks remote code execution: Check Point Research identified CVE-2025-59536, describing how repository hook scripts—often considered simple automation glue—could be leveraged to achieve remote code execution via the agent.
  3. MCP integration token theft: Attacks against Model Context Protocol connectors, also described by Mitiga Labs, enable adversaries to intercept long-lived OAuth tokens for services like GitHub, Jira, and Confluence.

The report also covers CVE-2026-21852, an API key exfiltration vulnerability, which—along with CVE-2025-59536—Anthropic has patched after responsible disclosure.

A separate line of attack, reported by SecurityWeek and all-about-security, involves fake GitHub repositories pushing malware under the guise of AI code tools. There is no evidence all these vectors have been used in a single campaign, but the cumulative risk profile for developer workstations is sharply higher.

How does the Claude coding agent create an attack surface?

The Claude Code agent isn’t just another CLI tool; it typically runs with broad file, network, and credential access on developer machines. These local agents touch source code, interact with cloud consoles, and integrate with SaaS APIs. That proximity to valuable resources raises the stakes of compromise.

Three exposed points:

  • Configuration files like ~/.claude.json are often trusted, presumed inert, and left unmonitored. A compromised dependency (npm or otherwise) can quietly mutate this file, redirecting agent requests for code or credentials.
  • Repository hooks (git pre-commit, post-merge, etc.) run automatically as part of CI/CD workflows. If the Claude agent triggers these and the hook logic can be overwritten or injected, you have a silent code execution path with agent-level privileges.
  • MCP integrations extend agent authority into external systems—Jira, Confluence, GitHub—often via long-lived tokens. Exploitable integrations multiply the blast radius: a hijacked token may be honored as the real user or service, bypassing usual artifact checks.

Because agent tokens often have broad scope (“do-anything” OAuth tokens), activity generated via the agent can blend smoothly with normal user activity. Standard anomaly detection (IP geo, login risk, device fingerprinting) won’t flag operations performed from inside the trusted developer environment.

Takeaway: the coding agent collapses several layers of defense into a single, high-value target. Any vulnerability here is automatically a deep lateral pivot.

how a coding agent connects to config files, repo hooks, MCP integrations, and SaaS tokens

Same component. Web and mobile. One codebase.

The free, open-source SDK gives you components that work the same on web and mobile — one codebase. github.com/otf-kit/sdk

Get the free SDK

What is the live token theft chain disclosed by Mitiga Labs?

Mitiga Labs has detailed a currently unpatched token-theft chain affecting Claude Code installs. Here’s how it works:

  1. A malicious npm package is published to the ecosystem. It executes post-install, searching for and rewriting ~/.claude.json.
  2. By altering the config, the package adds attacker-controlled endpoints for MCP traffic—Claude’s Model Context Protocol integration hooks.
  3. Once the agent runs, it unwittingly routes authentication and session tokens (including OAuth tokens with wide SaaS access) through the attacker’s server.
  4. Tokens from connected services like GitHub, Jira, and Confluence are intercepted. Given the scope of these tokens, the attacker can now operate in these environments as the compromised user.

Mitiga’s analysis is clear: this attack chain remains live and outside Anthropic’s current patch set for Claude Code. Simply updating or applying vendor-provided patches is not enough. Developers who installed any npm dependency with post-install scripts—or who cannot confirm the integrity of ~/.claude.json—may already be compromised.

Unlike phishing, which requires the user to click, this is a supply chain exploit: malicious code runs as part of an innocuous npm install workflow.

Why this matters: source code, deployment automation, and critical SaaS integrations are all exposed in one step. The line between “just a config file” and “full credential exfiltration” no longer exists.

How have Check Point’s reported CVEs been addressed by Anthropic?

Check Point Research published two high-impact Claude Code vulnerabilities:

  • CVE-2025-59536: repository hook-based remote code execution
  • CVE-2026-21852: API key exfiltration

According to the source material, Anthropic patched both issues following disclosure. The report does not specify patch release dates or version numbers, but says these two CVEs are considered remediated in current Claude Code releases.

If you run Claude Code on local machines, the immediate action is to ensure your deployment is running the latest version after these patches landed. Don’t assume your CI or local environment is upgraded—many teams discover outdated agents long after a fix is published.

Steps for best-practice coverage:

# Confirm Claude Code version
claude --version

# If unsure of patch status, reinstall clean
npm uninstall -g claude-code
npm install -g claude-code@latest

# Verify file hashes on critical config files
shasum ~/.claude.json

# Check repository hooks for unauthorized changes
ls -l .git/hooks/
cat .git/hooks/pre-commit

Regularly audit both global and project-local installs, as repo-level Claude Code binaries may linger after an upgrade.

How can developers secure their environments against Claude Code attacks today?

Security postures against AI coding agent attacks must go beyond patching. Here’s an actionable workflow:

1. Audit local config files

  • Check ~/.claude.json for unauthorized or unexpected changes.

  • Automate file-integrity monitoring:

    # cron job: report unexpected changes
    find ~/.claude.json -mtime -1 -exec mail -s "CLAUDE CONFIG CHANGED" you@yourdomain.com {} \;
  • Store a baseline hash and alert on drift.

2. Harden repository hooks

  • Restrict write permissions on .git/hooks/, and enforce code reviews for any changes.

  • Remove executable bits from all hooks except those you intend to run:

    chmod -x .git/hooks/*
    chmod +x .git/hooks/pre-commit  # only if approved

3. Monitor MCP integrations

  • List all Model Context Protocol connectors in your environment. Are there any unknown endpoints?
  • Block egress to known bad or unexpected MCP hosts at the network level.
  • Rotate OAuth tokens for all integrated services (GitHub, Jira, Confluence) on suspicion of compromise.

4. Restrict npm dependencies

  • Ban or review npm packages with install-time scripts (postinstall, preinstall).
  • Use a lockfile (package-lock.json, yarn.lock) with strict audit checks.
  • Prefer allowlist-based install scripts for team environments.

5. Token security

  • Apply least-privilege OAuth scopes for all agent-integrated services.
  • Rotate all tokens at set intervals, not just on vendor breach notification.
  • Prefer short-lived tokens and require enforced session expiry where possible.

6. Isolation

  • Run Claude Code and similar agents inside containers or VMs to limit blast radius.
  • Do not allow arbitrary outbound connections from agent VMs/containers to the wider network.

Takeaway: defense is layered. Configuration integrity, dependency hygiene, isolation and access control all play a part.

Why are coding agent security issues critical for developers and organizations?

Coding agents are not passive helpers—they sit at the core of your development stack, often privileged as user-level actors with read/write access across code, credentials, and SaaS tooling. The risks linked to vulnerabilities like those found in Claude Code are substantial:

  • Source code compromise: direct exfiltration or implant via the agent’s permissions.
  • SaaS account breaches: OAuth token theft opens surfaces in GitHub, Jira, and Confluence, sidestepping 2FA and device checks.
  • Lateral movement: once an agent token is compromised, attackers can operate as “trusted” infrastructure, making detection far harder and escalation more likely.

The source article does not offer precise statistics, but the pattern matches other high-profile supply chain and agent attacks—where token theft, not perimeter breach, is the enemy. The combination of local and cloud risk is unique: agent-bound vulnerabilities create the shortest path from dependency to production secrets.

If you build or run code with AI assistance, you’re not just automating workflows; you are creating new attack surfaces that operate faster and more quietly than traditional malware.

Secure your Claude Code environment—now

June 2026’s disclosures around Claude Code security vulnerabilities are a warning, not just an alert. The attack surface is deep and developer-adjacent; ignoring these issues is courting a breach. Anthropic’s patches close off remote code execution and API key leaks, but live threats—like npm-driven token hijack—demand direct action. Audit every config, restrict agent permissions, monitor integration endpoints, and run coding agents in isolation whenever possible.

Proactive security isn’t optional. The fastest way to lose source code or SaaS access in 2026 is to trust what used to be “safe” developer defaults. Patch fast, audit constantly, and treat agent-facing files as live targets.

securityagentsai-tools
OTF SDK + Kits

Buy once, own the code. Ship with the agent you already use.

  • Free, open-source SDK — same component, web and mobile
  • Paid kits include AI configs + 40+ tested prompts — your agent reads the whole project
  • $99/kit or $149 for everything. No subscription, no sandbox limit.