Summary
According to Wiz Research, when a developer opened a malicious repository in Visual Studio Code and enabled the Amazon Q Developer extension, the MCP server defined in the repository’s bundled .amazonq/mcp.json started with no approval dialog and no workspace-trust check. Because the started process inherited the developer’s full set of environment variables, it could reach their AWS credentials. AWS fixed it in language server 1.65.0, which now asks for consent before starting. There is no report of in-the-wild exploitation; this is a research disclosure. Unless, before a process is started from a config bundled in a repository, the config’s origin and the scope of the launch are checked apart from the fact that a folder was opened, a single config file can run commands while holding the developer’s credentials.
A pre-execution check means checking, before an MCP server starts, the config's origin and the scope of the launch and of the environment passed, and keeping a record. Detection means finding, reporting and fixing vulnerabilities. The dates are when the issue was reported, fixed and published, not when the route was used.
and reach the developer's credentials
What got through
- What got through
- Starting a local process from an MCP config bundled in a repository. According to Wiz Research, right after a folder was opened, the extension read
.amazonq/mcp.jsonin the workspace and started the MCP servers defined there. There was no consent prompt and no check to stop execution in an untrusted folder. - What reached the receiving side
- According to Wiz Research, the started process inherited the developer’s environment variables wholesale. For developers who work with the cloud, that often includes AWS credentials (access key, secret and session token), cloud-CLI tokens, API keys and the SSH-agent socket. In Wiz’s demonstration, a planted command sent the AWS session’s identity information to an external server, showing that the AWS session could be taken over with no action beyond opening the folder and enabling Amazon Q. Wiz says this can also lead to persistence in the cloud, reaching internal services, and lateral movement using a developer with production access as a foothold.
- Not disclosed
- The number of affected users. Whether any repository actually used this route before the fix (there is no report of exploitation).
Pre-execution check
Whatever the route, the condition for telling them apart is that, before an AI coding tool starts a process from a repository’s config, it checks the config’s origin, the scope of the launch and the scope of the credentials passed, apart from the fact that a folder was opened.
Unless, before a process is started from a config bundled in a repository, the config's origin and the scope of the launch are checked apart from the fact that a folder was opened, a single config file can run commands while holding the developer's credentials.
- Who approves
- The development teams that use the AI coding tool, and those who manage the development environment. They decide which MCP configs may be started and where they may come from, apart from what is in the repository. Launches from configs outside that scope are approved by a person.
- Where it is checked
- Just before the extension starts an MCP server. It checks that the config comes from an approved source and that the launch and the environment passed are within the decided scope, and does not start what cannot be checked. Opening a folder is not treated as approval to launch.
- What is recorded
- Which process was started from which config, with which environment (which credentials were passed), or which launch was stopped. Kept apart from the tool, in a form that can be shown later.
The researcher’s report and the shipped fix worked, and the known route was closed before publication. What did not work was the layer before that, which checks a launch from a bundled config against the config’s origin and the scope of the launch. It connects with Brief 037, which looked across auto-execution of bundled configs, and Brief 062 on the Claude Code GitHub Action, where an agent trusted an issue claiming to be a [bot] and acted with privilege, in that the origin of the input is not checked before it connects to execution; with Brief 027 on LibreChat, where server secrets leaked from a user-specified MCP URL, in that an MCP config turns directly into execution; and with Brief 059, where broad OAuth permissions given to an AI tool became an intrusion path, in that the developer’s cloud privileges are inherited without a per-action check. Brief 094 on Cursor (DuneSlide), disclosed around the same time, enters through instructions in external content the agent read; this case enters through a config bundled in the repository.
What Lemma does
Lemma builds the pre-execution check into the point just before the extension starts an MCP server. It does not look for malicious configs; it checks, before execution, the origin of the config about to be started and the scope of the launch and the environment passed, against permissions managed apart from what is in the repository.
Industries and operations to watch
- IndustryDevelopers
- Development teams that use an AI coding tool such as Amazon Q Developer in environments holding cloud credentials, and that have occasion to open unfamiliar repositories (outside pull requests, dependencies, code handed over as a hiring exercise, and so on).
- IndustryAI
- Organizations that build and ship AI tools that start processes such as MCP servers from repository or workspace settings.
Current controls vs Lemma
This incident’s route falls in columns 1 and 2. Column 3 is not a route in this incident.
| Control | Starting a process from a bundled config with no consent | Handing the started process the full set of credentials | Malicious behavior within a config the user consented to |
|---|---|---|---|
| Updating to the fixed version (language server 1.65.0, consent before launch) | Partial | Partial | Not effective |
| Workspace trust (stops execution in untrusted folders) | Partial | Not relevant | Not effective |
| Lemma (pre-execution check) | Effective | Partial | Not effective |
The fixed version asks for consent before launch, so nothing starts without consent. But it is the user who reads the prompt and decides, and once they consent, no change to what is passed to the started process has been disclosed. Workspace trust stops execution in untrusted folders, but does not stop configs in trusted folders and does not look at the scope of the environment passed. Lemma checks the config’s origin and the scope of the launch before execution against permissions managed apart from what is in the repository, and stops when it cannot be checked, so the launch in column 1 stops before it runs. The scope of credentials passed can also be part of the check, but narrowing the environment is up to the tool’s implementation, so column 2 is “Partial.” If malicious behavior happens within a permitted config, the check matches.
Note: Lemma’s check works only when it is built into the extension’s process for starting MCP servers, and the configs and sources that may be started, and the environment that may be passed, are managed apart from what is in the repository. If the scope is set broadly, malicious launches within it go through. The check neither finds malicious configs nor fixes flaws in the extension. The table compares what each control checks; it does not show whether this incident would have been stopped. Lemma does not detect or prevent intrusions.
Three things to confirm in organizations that use AI coding tools
- Is the Amazon Q Developer language server you use on a fixed version (1.65.0 or later)?
- Do you know whether the repositories you open contain MCP configs (such as
.amazonq/)? - Can you see, apart from the tool, a record of the processes the AI coding tool started and the credentials passed to them?
Facts and timeline
- Subject
- the Amazon Q Developer extension (Visual Studio Code version), AWS’s AI coding-assistance tool.
- Identifiers
- CVE-2026-12957 (GitHub Security Advisory: GHSA-xhcr-j4j9-3gh7). Found and reported by Wiz Research (Maor Dokhanian).
- Severity
- High. 8.5 on CVSS 4.0 (GHSA); 7.8 on NVD’s CVSS 3.1.
- Root cause (Wiz Research)
- two behaviors combined. First, right after a folder was opened, the extension read
.amazonq/mcp.jsonin the workspace and started the MCP servers defined there with no consent prompt. Second, the started process inherited the developer’s environment variables wholesale. - Impact (Wiz Research)
- not limited to local arbitrary code execution; it can lead to theft of cloud credentials, persistence in the cloud, reaching internal services over an inherited VPN or network, and lateral movement using a developer with production access as a foothold.
- Plausible entry points
- a malicious pull request to a popular repository, a look-alike repository name, a poisoned dependency, or a fake job interview that has the target clone a “coding challenge.”
- Exploitation status
- no report of in-the-wild exploitation. The CISA ADP entry also notes “no confirmed exploitation.”
Glossary
Amazon Q Developer — AWS's AI coding-assistance tool. This case concerns its Visual Studio Code extension.
MCP — Model Context Protocol. A standard by which AI-assistance tools start local processes called "MCP servers" to connect to databases, APIs, build tools and so on. Starting a server means running commands on the machine.
Workspace trust — A VS Code feature that stops execution driven by a folder's settings when the folder is not trusted.
Environment variables — Settings values passed to a process. For developers who work with the cloud, they often hold AWS access keys and session tokens, API keys and the like.
Timeline
- Wiz found the vulnerability.
- Wiz reported it to Amazon Security, and Amazon confirmed receipt.
- the fix shipped through a language-server update.
- CVE-2026-12957 was assigned (GHSA-xhcr-j4j9-3gh7).
- Wiz Research published, and AWS issued Security Bulletin 2026-047-AWS.
The facts in this Brief rest on Wiz Research’s disclosure, AWS’s security bulletin and the GitHub Security Advisory entry. The fix was available in 1.65.0 before disclosure. Per AWS, the language server usually updates automatically and in most cases no extra user action is needed (if network configuration prevents auto-update, update to the latest version). This Brief does not include reproduction steps. What has not been disclosed does not mean there were no controls.
After disclosure
- AWS: fixed it in language server 1.65.0 and issued Security Bulletin 2026-047-AWS. The fixed version asks for consent before starting a workspace’s MCP servers. AWS thanked Wiz for its cooperation.
- Wiz Research: recommended that developers be wary of unknown repositories, review MCP consent prompts carefully, inspect unexpected
.amazonq/directories in a repository, and audit MCP configs. It also drew three lessons: “workspace settings are attacker-controllable input,” “convenience features tend to skip consent,” and “full environment inheritance to child processes is an underrated risk.” Wiz frames this not as specific to Amazon Q but as an “MCP auto-execution” pattern also seen in Claude Code (CVE-2025-59536 / CVE-2026-21852), Cursor (CVE-2025-54136) and Windsurf (CVE-2026-30615).
Sources
- Wiz (research, primary): “MCP Auto-Execution: From Git Clone to Cloud Compromise in Amazon Q VS Code Extension” (2026-06-26) — https://www.wiz.io/blog/amazon-q-vulnerability
- Amazon Web Services (vendor bulletin): Security Bulletin 2026-047-AWS — https://aws.amazon.com/security/security-bulletins/2026-047-aws/
- GitHub Security Advisory: GHSA-xhcr-j4j9-3gh7 (CVE-2026-12957) — https://github.com/aws/language-servers/security/advisories/GHSA-xhcr-j4j9-3gh7
- The Hacker News: “Amazon Q Developer Flaw Could Let Malicious Repos Run Code via MCP Configs” — https://thehackernews.com/2026/06/amazon-q-developer-flaw-could-let.html
References: “The last layer left for cyber defense in the age of AI”