Summary
A validation flaw in @hulumi/policies can allow set-qualified AWS IAM condition operators, such as ForAnyValue:StringLike, to conceal wildcard GitHub Actions OIDC subject conditions from security guardrails. When a policy is evaluated by these incomplete checks, an attacker may be able to influence or assume an AWS IAM role through an overly broad GitHub OIDC trust relationship.
Affected context
This issue can arise in environments that use @hulumi/policies to inspect or enforce security requirements for AWS IAM trust policies involving GitHub Actions OIDC identities. The risk is greatest when policy guardrails do not recursively or consistently validate set-qualified condition operators and therefore fail to recognize wildcard subject patterns.
Exploit preconditions
- Attack surface: AWS IAM trust-policy validation and GitHub Actions OIDC
federation
- Required access: The ability to create, modify, submit, or influence an
IAM trust policy or its deployment inputs
- Trigger point: Validation of a trust policy containing a
set-qualified condition operator
- Why exploitation is possible: Incomplete validation may treat a
wildcard-bearing OIDC subject condition as acceptable when it is nested
under an operator that the guardrail does not properly inspect
Why this happens
The underlying bug is an authorization-validation mismatch. Security guardrails inspect some IAM condition forms but fail to apply equivalent restrictions to set-qualified operators such as ForAnyValue:StringLike. As a result, a condition that broadens the set of accepted GitHub OIDC subjects can evade checks intended to require narrowly scoped identities. This maps to CWE-284, Improper Access Control, because authorization policy enforcement does not consistently constrain access across semantically equivalent policy representations.
Potential impact
- An attacker could bypass policy guardrails intended to restrict trusted GitHub repositories or workflow subjects.
- An attacker may assume an AWS IAM role through an overly broad GitHub OIDC trust relationship.
- Compromised or untrusted workflows could obtain cloud permissions intended for controlled automation.
- AWS resources, data, credentials, or deployment pipelines could be modified, exposed, or disrupted.
- The affected account or connected cloud environments could experience privilege escalation or lateral movement.
General mitigation guidance
Mitigation generally focuses on making IAM trust-policy validation semantic rather than dependent on a limited set of operator spellings. Validation should inspect all supported condition operators, including set-qualified variants, and reject wildcard GitHub OIDC subject claims unless they are explicitly justified and narrowly bounded. Secure-by-default alternatives include exact repository, branch, environment, and workflow identity matching, centrally managed policy templates, and deny-by-default federation rules. Organizations can also reduce input trust by reviewing generated policies before deployment, restrict who may change trust relationships, and apply least-privilege permissions to federated roles.
How teams detect issues like this
Detection approaches can include static and policy analysis rules that enumerate every IAM condition operator and normalize set-qualified forms before evaluating GitHub OIDC subject claims. Code review should flag wildcard-bearing sub conditions, use of ForAnyValue or ForAllValues operators, dynamically generated trust policies, and validation logic that checks only selected operator names. CI policy enforcement can reject broad OIDC trust relationships, compare rendered policies against approved templates, and test semantically equivalent operator representations. Cloud audit monitoring can also identify unexpected role assumptions by federated principals and unusual activity from GitHub-connected roles.

