Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
codebuild_project_webhook_filters_use_anchored_patternsProvider: AWS
Service:
codebuildSeverity: HIGH
Categories:
software-supply-chain, ci-cdResource type:
AwsCodeBuildProjectWhat this check verifies
AWS CodeBuild webhook filters usingACTOR_ACCOUNT_ID, HEAD_REF, or BASE_REF have regex patterns anchored with ^ (start) and $ (end) to enforce exact matching and prevent substring bypass attacks.
Risk
Unanchored patterns expose CI/CD pipelines to CodeBreach attacks. Attackers can bypassACTOR_ACCOUNT_ID filters by creating GitHub accounts with IDs containing trusted values as substrings. Confidentiality: Credentials leaked via build logs. Integrity: Malicious code injected into builds. Availability: Resource exhaustion through unauthorized builds.
Recommendation
Anchor all webhook filter patterns with^ (start) and $ (end) to enforce exact matching. For multiple values use: ^value1$|^value2$. This prevents attackers from bypassing filters using substring matches.
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
References
- https://www.wiz.io/blog/wiz-research-codebreach-vulnerability-aws-codebuild
- https://docs.aws.amazon.com/codebuild/latest/userguide/github-webhook.html
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = codebuild_project_webhook_filters_use_anchored_patterns. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks