Amazon Q VS Code Flaw Lets Malicious Repositories Steal Cloud Credentials

A high-severity vulnerability in the Amazon Q Developer Extension for Visual Studio Code (VS Code), Amazon’s AI-powered coding assistant, allowed attackers to execute arbitrary code and steal cloud credentials.

Tracked as CVE-2026-12957 and CVE-2026-12958, the flaws have been patched in Language Servers for AWS version 1.69.0, with corresponding fixes across all affected Amazon Q Developer IDE plugins.

The root cause was straightforward but dangerous: Amazon Q automatically loaded MCP (Model Context Protocol) server configurations from .amazonq/mcp.json within workspace files without any user consent, approval dialog, or workspace trust verification.

Amazon Q VS Code Flaw

MCP servers are local processes that extend AI assistants’ capabilities, allowing them to interact with databases, APIs, and local system resources.

Because the security model assumes users explicitly configure these servers, auto-loading them from untrusted workspace files fundamentally violated that trust boundary.

Making matters worse, spawned processes inherited the victim’s complete environment, including AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN), cloud CLI authentication tokens, API keys, and SSH agent sockets. An attacker only needed to plant a malicious .amazonq/mcp.json inside a repository.

Once a developer cloned and opened the folder in VS Code with Amazon Q active, the extension silently executed the embedded configuration, no prompts, no warnings, no user interaction beyond opening the folder.

In Wiz’s proof-of-concept, the payload used a single bash command to invoke aws sts get-caller-identity and exfiltrate the captured AWS session to an attacker-controlled server.

The attack could escalate further to backdooring IAM users, establishing cloud persistence, or pivoting to internal production systems via an inherited VPN context.

Realistic delivery vectors include typosquatted packages, malicious pull requests to popular repositories, compromised dependencies, and fake job interview coding tests, a tactic already documented as a known DPRK threat technique.

Affected Versions

Two separate CVEs were assigned:

  • CVE-2026-12957 — Improper trust boundary enforcement; auto-executes commands from project config files without workspace trust validation
  • CVE-2026-12958 — Missing symlink validation; allows a maliciously crafted symlink to resolve to a file path outside the workspace trust boundary
ProductVulnerable Version
Language Servers for AWS< 1.69.0
Amazon Q Developer for VS Code< 2.20
Amazon Q Developer for JetBrains< 4.3
Amazon Q Developer for Eclipse< 2.7.4
AWS Toolkit with Amazon Q for Visual Studio< 1.94.0.0

Wiz researcher Maor Dokhanian discovered the vulnerability on April 17, 2026, reported it to Amazon Security on April 20, and received acknowledgment the same day.

Amazon deployed an initial fix via language server update on May 12, CVE-2026-12957 was assigned on June 23, and public disclosure followed on June 26, 2026.

Amazon has fully remediated both issues. The AWS language server updates automatically in most configurations; reloading the IDE triggers the update. No action is required for users already on the patched versions.

Developers are advised to audit workspace directories for unexpected .amazonq/ folders, review MCP server consent prompts carefully before approving commands, and treat any unfamiliar repository as potentially untrusted.

Similar MCP auto-execution flaws were simultaneously disclosed in Claude Code (CVE-2025-59536, CVE-2026-21852), Cursor (CVE-2025-54136), and Windsurf (CVE-2026-30615), signaling that the industry must address workspace config trust as a foundational security requirement for AI-assisted development environments.

Follow us on Google News , LinkedIn and X to Get More Instant Updates. Set Cyberpress as a Preferred Source in Google.

Tamilselvan
Tamilselvanhttps://cyberpress.org/
Tamilselvan is an Investigative cybersecurity journalist dedicated to breaking stories on ransomware cartels, data breaches, and state-sponsored espionage.

Trending News

Related Stories