Amazon Q's MCP Auto-Load Bug Made Cloned Repos a Cloud Credential Risk
Wiz showed that older Amazon Q for VS Code (AWS's AI coding assistant extension) language-server versions automatically loaded workspace MCP (Model Context Protocol, a way for AI assistants to connect to external tools) configuration without consent, letting a malicious repository define a command-backed MCP server that inherited the developer environment and exfiltrated AWS identity data. AWS fixed CVE-2026-12957 in language server 1.65.0 and later.
Threat Analysis
- The attack starts at repository trust. A developer opens a malicious workspace that contains
.amazonq/mcp.json, making project files part of the AI assistant control plane. - The vulnerable client auto-executed configuration. Amazon Q loaded MCP server definitions without a workspace-trust or user-consent gate, so a repo-controlled command could run locally.
- The MCP process inherited sensitive developer context. The proof of concept ran AWS CLI identity discovery and sent the result to an attacker endpoint.
- The risk is bigger than one command. Any local secret, cloud session, source checkout, or developer network path reachable from the assistant process becomes potential follow-on material.
- The strongest fix is signed and consented configuration. Client configuration should be validated, signed, reviewed, and blocked when it attempts shell startup or sensitive environment inheritance.
Applicable AIDEFEND Defenses (9)
What Defenders Should Do Now
- Upgrade Amazon Q Developer for VS Code to a version that includes language server 1.65.0 or later.
- Search workspaces for
.amazonq/mcp.jsonand review any command-backed or shell-backed MCP server definitions. - Block assistant clients from auto-loading unsigned workspace configuration and require explicit approval for new MCP servers.
- Run AI coding tools with minimal environment variables, no long-lived AWS keys, and outbound egress controls.
- Rotate cloud credentials for developers who opened untrusted repositories while running affected Amazon Q versions.
Conclusion
This case is a clean example of why AI coding assistants need client-side control-plane security. A repository is not just source code when the assistant reads it as configuration. Signed config, explicit consent, minimal environments, and egress policy turn a cloned repo back into a file tree instead of a code-execution decision.