Potentially millions of downstream users of applications built with the AWS JavaScript SDK
On January 15, 2026, security firm Wiz disclosed CodeBreach, a critical vulnerability in Amazon Web Services' AWS CodeBuild service. The flaw, now patched, could have allowed unauthenticated attackers to gain administrative access to connected GitHub repositories by bypassing misconfigured webhook filters. The primary risk was a potential supply chain attack against core software libraries, most notably the AWS JavaScript SDK, which is used in a majority of cloud environments and within the AWS Console itself. A successful exploit could have led to the widespread distribution of malicious code, compromising countless downstream users and cloud infrastructures. AWS confirmed the flaw was fixed promptly after responsible disclosure in August 2025 and stated that no customer environments were impacted.
The CodeBreach vulnerability was a high-impact misconfiguration within the AWS CodeBuild CI/CD service. It allowed an attacker to bypass the intended security controls that trigger build jobs from GitHub events. The core of the issue was a faulty regular expression in a webhook filter that failed to properly validate the source of a build trigger. An unauthenticated attacker, knowing the actor ID of a legitimate GitHub account associated with a target repository, could craft a malicious request to initiate a build.
Once the build was triggered, the attacker could exploit the environment to leak the highly privileged GitHub Personal Access Token (PAT) associated with the CodeBuild project. In the case of the AWS JavaScript SDK repository, this token had full administrative privileges, enabling the attacker to:
The discovery was prompted by a real-world, albeit failed, supply chain attack attempt against the Amazon Q VS Code extension, which used a similarly vulnerable CodeBuild project. This incident underscores the growing trend of attackers targeting CI/CD pipelines as a vector for broad-impact supply chain compromises.
The attack chain relied on exploiting a logic flaw in the webhook filtering mechanism of AWS CodeBuild.
Initial Access - Bypassing Webhook Filters: The attacker crafts a git-upload-pack request that includes a specific GitHub actor ID in the payload. The misconfigured regex on the AWS CodeBuild webhook listener failed to properly anchor its checks, allowing this crafted request to be processed as a legitimate trigger. This maps to T1190 - Exploit Public-Facing Application.
Execution - Triggering a Malicious Build: The malicious request successfully triggers a new build job within the victim's CodeBuild environment. The attacker can specify a buildspec that contains commands to exfiltrate secrets.
Credential Access - Leaking GitHub Token: Inside the compromised build environment, the attacker's commands can access environment variables or configuration files containing the GitHub PAT. This token is then exfiltrated to an attacker-controlled server. This aligns with T1552.006 - Group Policy Preferences where secrets are stored in accessible locations.
Impact & Persistence - Code Repository Compromise: With the administrative PAT, the attacker gains full control over the target GitHub repository. They can inject malicious code, creating a backdoor in a trusted software library. This constitutes a classic T1195.001 - Compromise Software Dependencies and Development Tools supply chain attack. The ability to approve pull requests and modify code also provides a form of persistence within the development lifecycle.
| Tactic | Technique ID | Technique Name |
|---|---|---|
| Initial Access | T1190 |
Exploit Public-Facing Application |
| Credential Access | T1552.006 |
Group Policy Preferences |
| Impact | T1195.001 |
Compromise Software Dependencies and Development Tools |
| Defense Evasion | T1078 |
Valid Accounts |
A successful exploitation of CodeBreach would have been catastrophic. The primary target identified, the AWS JavaScript SDK, is a foundational component for a vast number of applications and services that interact with AWS. According to Wiz, 66% of cloud environments utilize this SDK.
Security teams should hunt for signs of CI/CD pipeline abuse:
| Type | Value | Description |
|---|---|---|
| log_source | AWS CloudTrail |
Monitor for unusual or unauthorized StartBuild API calls in CodeBuild. |
| log_source | GitHub Audit Logs |
Look for suspicious pull request approvals, direct pushes to main branches, or changes to repository secrets by service accounts. |
| network_traffic_pattern | Outbound traffic from build runners | Monitor for network connections from CodeBuild environments to unknown or suspicious IP addresses, especially those associated with data exfiltration. |
| command_line_pattern | printenv, cat /root/.git-credentials |
Look for build commands that inspect or exfiltrate environment variables or credential files within build logs. |
Detecting this type of attack requires deep visibility into CI/CD pipeline activity and repository interactions.
While AWS has patched the specific flaw, organizations should adopt a defense-in-depth strategy for their CI/CD pipelines.
Principle of Least Privilege (M1026): Ensure CodeBuild projects and their associated service accounts have the minimum permissions necessary. GitHub tokens should be scoped to specific repositories and granted only the required access (e.g., read-only if pushes are not needed). This maps to D3-UAP: User Account Permissions.
Harden Webhook Configurations (M1054): Implement strict validation on all incoming webhooks. Use cryptographic verification (e.g., webhook secrets) to ensure triggers originate from a trusted source, rather than relying solely on IP filtering or payload inspection. This is a form of Application Configuration Hardening (D3-ACH).
Audit and Monitor (M1047): Continuously monitor CI/CD logs (CloudTrail, CodeBuild logs) and source code repository audit logs (GitHub audit logs) for suspicious activity. Set up alerts for events like direct pushes to protected branches or changes in repository permissions by automated accounts. This relates to Domain Account Monitoring (D3-DAM).
Require Pull Request Reviews: Enforce policies that require human review for all pull requests, even those from automated systems. Do not allow CI/CD service accounts to merge code into protected branches without oversight.
Harden CI/CD webhook configurations to require cryptographic verification, preventing spoofed build triggers.
Mapped D3FEND Techniques:
Apply the principle of least privilege to CI/CD service accounts and their access tokens, scoping permissions to the minimum required.
In the context of the CodeBreach vulnerability, Application Configuration Hardening should be applied directly to the CI/CD pipeline's interaction points. Specifically for AWS CodeBuild and GitHub integration, this involves moving beyond simple regex filters for webhook validation. Instead, organizations must implement and enforce the use of webhook secrets. When configuring a webhook in GitHub, a secret token should be generated. This token is then sent with each webhook payload in the X-Hub-Signature-256 header. The CodeBuild project or an intermediary Lambda function must be configured to validate this signature using the shared secret before processing any build request. This cryptographic verification ensures that the request genuinely originated from the configured GitHub repository and not an attacker spoofing the request structure. This countermeasure directly prevents the initial access vector used in the CodeBreach attack by providing strong authentication for build triggers.
The impact of CodeBreach was magnified by the administrative privileges of the leaked GitHub PAT. To mitigate this, User Account Permissions must be strictly enforced using the principle of least privilege. Instead of using long-lived, admin-level PATs, organizations should transition to short-lived, fine-grained access tokens. For GitHub, this means using GitHub Apps or fine-grained personal access tokens that can be scoped to specific repositories and specific permissions (e.g., read-only access to code, write access only to pull request comments). For AWS CodeBuild, the associated IAM role should only have permissions to perform its specific build tasks and nothing more. Regularly audit these permissions using tools like IAM Access Analyzer. By ensuring the CI/CD service account can only perform its designated function, the potential damage from a compromised build environment is drastically reduced, preventing an attacker from escalating to full repository control.
To detect the exfiltration phase of an attack like CodeBreach, implement robust Network Traffic Analysis for all egress traffic from CI/CD build environments. Since CodeBuild runners operate within an AWS-managed VPC, this can be achieved by analyzing VPC Flow Logs or deploying a network tap with an IDS/IPS. Security teams should establish a baseline of normal outbound traffic. For most build jobs, this might be limited to package repositories (e.g., npm, PyPI), container registries, and the source code provider (GitHub). Any connection from a build runner to an unknown or suspicious IP address, a cloud storage bucket in a different organization, or a raw data transfer service like Pastebin should trigger a high-severity alert. This technique acts as a critical backstop, allowing for the detection of a compromise even if the initial access and execution phases are missed.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats