An AWS CodeBuild vulnerability could’ve caused supply chain chaos – luckily a fix was applied before disaster struck

A single misconfiguration could have allowed attackers to inject malicious code to launch a platform-wide compromise

Amazon Web Services (AWS) logo pictured above an escalator at the Venetian Hotel conference center ahead of AWS re:Invent 2025 with conference attendees walking in foyer below.
(Image credit: ITPro/Ross Kelly)

Amazon Web Services (AWS) is downplaying reports that a CodeBuild vulnerability could have compromised thousands of enterprise user accounts.

CodeBuild is a managed Continuous Integration (CI) service that’s often connected to GitHub repositories, triggering builds on events like new pull requests.

The vulnerability, dubbed by Wiz researchers as ‘CodeBreach’, stemmed from a subtle flaw in how core AWS GitHub repositories handled build triggers.

Image

Make Password Security Your New Year's Resolution

Get 50% off Keeper Personal and Family plans, and 30% off Keeper Business Starter today!

"The issue allowed a complete takeover of key AWS GitHub repositories - most notably the AWS JavaScript SDK, a core library that powers the AWS Console," said Wiz.

"By exploiting CodeBreach, attackers could have injected malicious code to launch a platform-wide compromise, potentially affecting not just the countless applications depending on the SDK, but the Console itself, threatening every AWS account."

Researchers found that just two missing characters in a Regex security filter - the start (^) and end ($) anchors - allowed unauthenticated attackers to compromise the build environment and leak privileged credentials.

These anchors are essential to ensuring an exact match; without them, the filter simply searches for a string that contains the pattern. As a result, Wiz said any GitHub user ID containing an approved maintainer’s ID as a substring would look legitimate.

“This creates a critical risk: if an attacker can compromise a single build, they are just a memory dump away from stealing credentials that often possess powerful permissions over the source repository,” the company explained in a blog post.

How the CodeBuild vulnerability was discovered

In dissecting the vulnerability, Wiz researchers created thousands of GitHub bot accounts until one matched the criteria, allowing them to push a pull request that looked legitimate.

This successfully extracted GitHub credentials for the aws-sdk-js-automation account, which had admin privileges over several AWS repositories, including private ones.

Wiz acknowledged that the issue wasn't a service-wide flaw, but warned that CodeBuild customers could introduce the same misconfiguration to their own projects.

The company disclosed its findings to AWS, which fixed the issue within 48 hours.

AWS also implemented global hardening measures within the CodeBuild service to prevent similar attacks, most notably with a new Pull Request Comment Approval build gate.

The company said it had audited all AWS-managed open source GitHub repositories, and found that none involved this type of misconfiguration.

"These activities had no impact to any AWS customer environments and did not impact any AWS services or infrastructure. No customer action is required," said the firm.

Regardless, Wiz recommends that CodeBuild users should enable the new Pull Request Comment Approval build gate or use CodeBuild-hosted runners to manage build triggers via GitHub workflows.

If there's really a need for webhook filters, they should ensure their regex patterns are anchored.

Organizations should also secure the CodeBuild-GitHub connection by generating a unique, fine-grained Personal Access Token (PAT) for each CodeBuild project, strictly limiting the PAT's permissions to the minimum required, and perhaps using a dedicated unprivileged GitHub account for the CodeBuild integration.

FOLLOW US ON SOCIAL MEDIA

Make sure to follow ITPro on Google News to keep tabs on all our latest news, analysis, and reviews.

You can also follow ITPro on LinkedIn, X, Facebook, and BlueSky.

Emma Woollacott

Emma Woollacott is a freelance journalist writing for publications including the BBC, Private Eye, Forbes, Raconteur and specialist technology titles.