Skip to content
Claude Code 2.1.268: MCP Errors Were Leaking Credentials to Your Logs
NewsSeptember 11, 20268 min read

Claude Code 2.1.268: MCP Errors Were Leaking Credentials to Your Logs

Claude Code 2.1.268 patches an MCP credential leak in error logs and fixes the HTTP 400 regression that broke third-party API endpoints since v2.1.265.

Claude Code v2.1.268, released September 10, 2026, patches a security issue where MCP and plugin error output was writing credentials and tokens into log files. It also fixes a regression from v2.1.265 that broke all third-party ANTHROPIC_BASE_URL endpoints with HTTP 400 errors, and adds a 300-second WebFetch timeout to prevent indefinite agent hangs.

Two of the fixes in this release are the kind that make you quietly nervous when you read the changelog. A credential leak in error logs -- the sort of thing that only fires when an MCP server throws, but logs that routinely ship to Datadog or CloudWatch with weaker access controls than your secrets vault. And a broken API endpoint that silently failed for several days before the fix landed. If you run MCP servers in production or route Claude Code through a custom gateway, here is what happened and what to audit.

What was leaking, and why?

MCP server errors and plugin errors in Claude Code were including credential data in their formatted error output -- API keys, OAuth tokens, and auth headers were surfacing in log entries generated during error paths. Normal operation with error-free MCP servers was not affected. Version 2.1.268 strips sensitive values from error formatting before they reach log output.

This fits a well-documented pattern in the MCP ecosystem. A 2026 Practical DevSecOps report found over 12,000 API keys and passwords exposed due to insecure MCP credential handling. Credential data leaking into logs is a specific variant of that exposure -- log files frequently ship to third-party aggregators (Datadog, Loki, CloudWatch, Splunk) without the same access controls as the secrets themselves. One compromised log stream exposes every key your MCP servers touch.

The attack surface is larger than it sounds. Claude Code connects to MCP servers for everything from file system access to custom API integrations. Production setups often connect to Slack, Notion, GitHub, Stripe, or internal APIs -- all of which use credentials that need fast rotation if exposed. If your MCP servers were erroring between v2.1.260 and v2.1.267, those error logs are worth auditing now.

Free Newsletter

Get the daily AI agent signal in your inbox.

One email, every morning. The builds, tools, and frontier research that matter — no fluff, no AI hype cycle noise.

Subscribe free

Who was broken by the HTTP 400 regression?

Starting with v2.1.265, Claude Code introduced a regex pattern in the Artifact tool input schema that caused every API call to return HTTP 400 when routed through third-party Anthropic-compatible endpoints. Anyone pointing ANTHROPIC_BASE_URL at OpenRouter, LiteLLM, a custom proxy, or a corporate gateway was broken -- every turn failed -- from the v2.1.265 release date through September 10 when 2.1.268 shipped.

The root cause: the Artifact tool schema added a regex that the Anthropic API accepts but third-party endpoints (which parse tool schemas more strictly) reject with a 400. Claude Code sends this schema on every turn, so every turn failed. GitHub issue #46105 documents the reports and confirms the v2.1.265 breakage date. The fix in 2.1.268 removes the schema rejection by adjusting how the Artifact tool definition handles regex constraints when reaching non-Anthropic endpoints.

Worth noting: v2.1.265, v2.1.266, and v2.1.267 all shipped between September 4 and September 10 -- a six-day window where any ANTHROPIC_BASE_URL configuration was completely broken. Three releases shipped without catching a regression that broke all gateway users. That timeline matters if your team depends on OpenRouter or LiteLLM for cost management or model routing.

Get the AI Agent Briefing

One email per week. The best AI agent news, tutorials, and tools -- written by someone who actually builds with them.

Subscribe Free

WebFetch now has a 300-second hard timeout

Claude Code's built-in WebFetch tool now enforces a 300-second (5-minute) hard timeout by default. Before 2.1.268, a hanging HTTP fetch stalled the entire agent session -- the subagent waited indefinitely with no recovery path, no error surfaced to the parent agent, and the only escape was killing the process and losing context. The 300-second default gives even slow servers enough runway while preventing runaway hangs from taking down long-running agents.

Set CLAUDE_CODE_WEBFETCH_DEADLINE_MS to override the default. Set it to 0 to disable entirely -- not recommended unless you have your own timeout handling downstream. GitHub issue #34565 documented the indefinite hang behavior as a long-standing request. For multi-agent workflows where a subagent WebFetch freeze cascades into a parent stall, this is one of the more impactful reliability fixes in recent releases.

Gateway pricing parity and the gatewayInternalNetworks setting

Two new additions ship together for teams running Claude Code through a self-hosted gateway. First, gateway pricing parity: when pricing: is configured in gateway.yaml, signed-in Claude Code clients receive the same rates through managed settings, so /cost and telemetry match the actual spend meter. Before this, cost estimates used Anthropic public rates regardless of your gateway pricing -- meaning tracked spend was wrong for any team using volume discounts or a reseller gateway.

Second, the new gatewayInternalNetworks managed setting lets administrators allow /login on the organization's own public IPv4 block. This is network-policy control for internal gateway authentication -- it enables auth flows without conflicting with existing CIDR access controls. Per the 2.1.268 technical changelog, the setting also triggers startup warnings when access_control.allow_cidrs is empty and when requests arrive from public addresses -- giving operators early signals on misconfigured network policies.

The rest of what shipped in 2.1.268

Beyond the security and regression fixes, 2.1.268 ships several quality-of-life changes. Web-based Claude sessions now persist uploaded files for 24 hours instead of silently losing them after 6 hours -- a long-standing source of confusion when files disappeared mid-session with no warning. Plugin installation commands gained --json output for machine-readable responses, which matters for automated deployment scripts and CI pipelines that install plugins programmatically.

VS Code integration received fixes for session list loading with custom config directories and model pill display consistency. Claude Tag in Slack got per-public-channel memory isolation -- previous conversations in one channel were bleeding context into new ones, causing unexpected behavior in busy Slack workspaces. The update also resolves prompt caching and extended thinking breaking mid-session for SDK users via the excludeDynamicSections setting, which restores cache hits without interrupting extended thinking chains.

How to check if your setup was exposed

If you ran MCP servers in Claude Code on any version between v2.1.260 and v2.1.267, the audit is straightforward: check your log files for error entries that contain auth headers or token strings. Search for Authorization:, Bearer, or x-api-key appearing in error log entries. If your logs ship to a third-party aggregator, run the search there too -- that is where exposure becomes a real risk.

Steps to address this now: Update immediately with npm install -g @anthropic-ai/claude-code@latest and confirm with claude --version. On most systems, audit logs with grep -i "bearer" ~/.claude/logs/*.log. If you find credential data in error entries, rotate the credentials your MCP servers use -- static API keys are faster to rotate than OAuth tokens, so start there. For the HTTP 400 regression: if you were using ANTHROPIC_BASE_URL with a custom endpoint between September 6 and September 10, upgrading to 2.1.268 fully restores your setup with no gateway-side changes needed.

FAQ

What exactly was leaking in the MCP credential bug in Claude Code?

Claude Code was including credential data -- API keys, OAuth tokens, and auth headers -- in the error output generated when MCP servers or plugins threw errors. The leak only occurred in error paths, not during normal operation. If your MCP servers ran without errors during the affected versions (v2.1.260 to v2.1.267), you likely were not affected. Version 2.1.268 strips sensitive values from error formatting before they reach log output.

Does this affect Claude Code on claude.ai, or only the local CLI?

The MCP credential leak and the HTTP 400 regression both affect the locally installed @anthropic-ai/claude-code npm package. Claude.ai uses separate infrastructure that is not affected. The 24-hour file persistence fix and the Claude Tag in Slack memory isolation do affect the web and Slack experience. If you only use Claude.ai in a browser without running the CLI locally, the MCP credential issue does not apply to you.

How do I update Claude Code to version 2.1.268?

Run npm install -g @anthropic-ai/claude-code@latest in your terminal and confirm with claude --version. For enterprise gateway deployments, also update your gateway.yaml to apply the gatewayInternalNetworks and pricing parity settings -- these require explicit configuration to activate. Managed deployments that auto-update via CI or container rebuilds should already be on 2.1.268 if those pipelines ran after September 10, 2026.

Was the credential leak exploited in the wild?

No confirmed exploitation has been reported as of September 11, 2026. The exposure required an MCP server to throw an error during a session where credentials were active in memory. Setups where MCP servers ran cleanly without errors were not generating the vulnerable error output. If your MCP servers routinely errored during the affected window -- connection failures, auth failures during setup, misconfigured tools -- treat your logs as potentially containing credential data and rotate the affected credentials.

Get the AI Agent Briefing

One email per week. The best AI agent news, tutorials, and tools -- written by someone who actually builds with them.

Subscribe Free

Published September 11, 2026

All articles
AI Agents First

The daily signal from the frontier of AI agents.

Join builders, founders, and researchers getting the sharpest one-email read on what's actually shipping in AI — every morning.

No spam — unsubscribe anytime