# Amazon Q Developer VS Code extension 1.84.0 shipped injected code after a CodeBuild token leak

Source: https://botpassword.com/incidents/2025-07-amazon-q-developer-extension
Disclosed: 2025-07-23 · Type: AI agent · Status: Resolved · Updated: 2026-10-25

In July 2025 AWS disclosed that version 1.84.0 of its Amazon Q Developer extension for VS Code shipped with injected code designed to call the Q Developer CLI, after an attacker extracted an over-scoped GitHub token from the project's AWS CodeBuild configuration and committed to the open-source repository. AWS says a syntax error stopped the code from running and that it could not change services or customer environments. Remove 1.84.0, install 1.85.0 or later, and if you run CodeBuild on untrusted pull requests, rotate the repository token it uses.

Identifiers: CVE-2025-8217, AWS-2025-015, AWS-2025-016, GHSA-7g7f-ff96-5gcw

## What was exposed

The direct exposure was a **GitHub token with write access** that AWS says was inappropriately scoped and reachable from the CodeBuild environment that built the extension. AWS-2025-016 explains the general issue: when CodeBuild runs automatically on pull requests from untrusted contributors, the PR's code can read the build's memory and extract the GitHub, Bitbucket or GitLab token CodeBuild uses. For extension users, AWS says the injected code failed because of a syntax error and could not change any services or customer environments, so AWS does not ask users to rotate their own AWS credentials. Because the injected code targeted an AI coding agent's CLI, the incident shows how a compromised extension could try to drive an agent that has the developer's cloud access.

## Who is affected

**Extension users:** you are affected if Amazon Q Developer for VS Code version 1.84.0 is or was installed in VS Code or in a fork or derivative editor. Check the version in the Extensions panel. AWS says the code is still present in existing 1.84.0 copies even though it cannot run. **CodeBuild customers:** you are exposed to the same technique if a CodeBuild project builds pull requests from untrusted contributors automatically and its repository token has write permission.

## What to do

1. Remove every installation of Amazon Q Developer for VS Code 1.84.0 and update to 1.85.0 or later, including in forks and derivative editors.
2. In CodeBuild, turn off automatic builds for pull requests from untrusted contributors, or add webhook event or actor filters so only trusted users trigger builds.
3. If such builds ran with a write-capable repository token, rotate that GitHub, Bitbucket or GitLab token and review the repository's git and audit logs for commits made with it.
4. Remove write permissions from CodeBuild repository credentials unless a build truly needs to push.
5. For public repositories that need builds of outside contributions, AWS suggests self-hosted GitHub Actions runners in CodeBuild, which it says are not affected.

## Keys to rotate

- [GitHub](https://botpassword.com/keys/github)
- [GitLab](https://botpassword.com/keys/gitlab)
- [Bitbucket](https://botpassword.com/keys/bitbucket)

## Timeline

- 2025-07-23: AWS publishes bulletin AWS-2025-015: Amazon Q Developer for VS Code 1.84.0 contains malicious code committed with a GitHub token from the extension's CodeBuild configuration. AWS says it revoked and replaced the credentials and released 1.85.0. ([source](https://aws.amazon.com/security/security-bulletins/AWS-2025-015/))
- 2025-07-25: AWS publishes AWS-2025-016: a malicious pull request built automatically by CodeBuild could dump the build's memory and extract the source-repository token. AWS says an actor used this to obtain tokens for the AWS Toolkit for VS Code and AWS SDK for .NET repositories. ([source](https://aws.amazon.com/security/security-bulletins/aws-2025-016))
- 2025-07-26: GitHub advisory GHSA-7g7f-ff96-5gcw is published for the extension, rated moderate. ([source](https://github.com/aws/aws-toolkit-vscode/security/advisories/GHSA-7g7f-ff96-5gcw))
- 2025-07-30: CVE-2025-8217 is published, describing inert injected code designed to call the Q Developer CLI when the extension launches. ([source](https://nvd.nist.gov/vuln/detail/CVE-2025-8217))

## Indicators

- Amazon Q Developer for VS Code version 1.84.0. AWS publishes its SHA-256 hash in AWS-2025-015.
- Unexpected commits to repositories made with a CodeBuild-held token after an automated pull-request build.

## Sources

- https://aws.amazon.com/security/security-bulletins/AWS-2025-015/
- https://aws.amazon.com/security/security-bulletins/aws-2025-016
- https://github.com/aws/aws-toolkit-vscode/security/advisories/GHSA-7g7f-ff96-5gcw
- https://nvd.nist.gov/vuln/detail/CVE-2025-8217
