CodeBreach: The Regex Error That Nearly Broke AWS

In the world of high-stakes cybersecurity, the smallest typo can bring down a giant. Recently, security researchers at Wiz uncovered a massive vulnerability they named CodeBreach. This flaw wasn’t a complex piece of malware or a sophisticated social engineering scheme; instead, it was a simple oversight in how Amazon Web Services (AWS) filtered who was allowed to run code in their development pipelines. Had it been found by hackers first, it could have granted total control over AWS’s internal code repositories, potentially poisoning the software that millions of businesses rely on every single day.

A Tiny Mistake with Massive Consequences

At the heart of this issue was a tool called AWS CodeBuild. When developers want to update software, they use “pipelines” that automatically test and build the code. To keep these pipelines safe, AWS uses filters to make sure only trusted people—like official employees—can trigger a build. One of the ways they do this is by checking the “Actor ID” of the person making a request against a list of approved ID numbers.

However, AWS made a classic mathematical error in their regular expressions (regex), which are the rules used to match these ID numbers. They forgot to “anchor” the numbers. In technical terms, they left out two tiny symbols: the caret ($^$) and the dollar sign ($\$$). Without these anchors, the system didn’t look for an exact match. If an approved ID was “755743,” the system would mistakenly trust any ID that simply contained those digits, such as “226755743.”

Rhyno Cybersecurity
Security Services Rhyno

How the Attackers “Gained” Entry

The researchers realized that because GitHub assigns user IDs in a predictable, numerical order, they could essentially “guess” their way into the system. By repeatedly creating new “bot” accounts on GitHub, they could wait until they were assigned an ID number that happened to include a trusted AWS ID within it. Wiz estimated that a new “matching” ID would appear naturally about every five days.

Once the researchers had an account with a “matching” ID, the AWS filters waved them right through. This gave them the ability to trigger a build process that held the “keys to the kingdom”—specifically, a GitHub admin token. This token wasn’t just for any random project; it belonged to the AWS JavaScript SDK, a critical piece of software used by almost every AWS customer to manage their cloud environments. With that token, an attacker could have injected malicious code directly into the official AWS source code, silently spreading a “digital virus” to every company using Amazon’s services.

The Fix and the Future of Cloud Safety

Fortunately, this story has a safe ending. Wiz followed “responsible disclosure” rules, alerting Amazon to the problem in August 2025. By September, AWS had quietly patched the hole. They fixed the broken filters, rotated all their secret keys, and added extra layers of protection to ensure that even if a filter fails in the future, a stranger can’t walk away with administrative powers.

AWS has stated there is no evidence that real-world hackers ever used this trick. Still, the discovery is a sobering reminder of how fragile the “software supply chain” can be. This isn’t the first time “pull request” triggers have caused a headache for big tech. Similar issues have popped up at Google and Microsoft, proving that even the smartest engineers in the world can be undone by a few missing characters in a line of code. For now, the cloud is safe, but “CodeBreach” serves as a permanent warning: in the digital age, your security is only as strong as your simplest filter.

Privacy Preference Center