- Guard
- Security
- Advisories
- mcp token theft via headers
MCP authentication token theft via headers
MCP servers that accept authentication tokens in headers can leak those tokens if the server logs requests, shares telemetry, or is compromised. Tokens passed to MCP servers persist in server-side logs and may be accessible to attackers.
Key facts
MCP authentication token theft via headers is a high-severity AI agent security threat targeting MCP server authentication, HTTP headers, server-side logs, telemetry pipelines. Use short-lived, narrowly scoped MCP credentials and rotate them according to the provider policy. Guard can evaluate supported MCP tool calls and retain decision evidence, but do not rely on Guard for authentication-token inventory or remote server telemetry inspection.
What happens
When an AI agent authenticates to an MCP server, the authentication token is sent in an HTTP header. If the MCP server logs headers, shares telemetry, or is compromised, the token is exposed and can be reused by an attacker.
How the attack unfolds
What it looks like in practice
A developer configures Claude Code to use an MCP server called "db-query" with an OAuth token. The db-query server logs all requests including the Authorization header to Datadog for debugging. A Datadog admin sees the token in the logs and uses it to access the developer's database directly.
Detection and Guard coverage
How to stop it
Use short-lived, narrowly scoped MCP credentials and rotate them according to the provider policy. Guard can evaluate supported MCP tool calls and retain decision evidence, but do not rely on Guard for authentication-token inventory or remote server telemetry inspection.
Related threat guides
Use the protections Guard supports here
Guard can review or block supported actions for this threat. The advisory above calls out what Guard covers and where other controls are still needed.