# Cloud role trust missing subject condition

AssumeRole or OIDC trust policies with wildcard, absent, or silently dropped subject/audience conditions

_Area: Cloud and container security. Seen in 3 disclosed reports; latest 2026-11-09. Updated 2026-11-16._

## How it works
A role trust policy answers one question: which principals may assume this role. For OIDC federation the identity provider (GitHub, GitLab, Terraform Cloud, a vendor SaaS) issues tokens to many customers, so the provider alone proves nothing. The trust policy must narrow the token with a condition — typically `sub` (which repo/workflow/identity) and often `aud`. When that condition is absent or wildcarded, the role trusts *every* identity the provider issues, so any account holder on that SaaS can assume it [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)[E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md). The same break appears in cross-account vendor integrations: trusting a vendor account root with only an External ID gate treats a non-secret, plaintext-logged value as the credential, so anyone holding vendor-account IAM credentials can assume every customer role [E1](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md).

## Where it shows up
- IAM role trust policies with `Principal` = an OIDC provider or a vendor account root, and no `Condition` on `sub`/`aud` [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)[E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md)
- `sub` present but wildcarded (`repo:org/*`, `StringLike` with `*`) or scoped to the wrong claim
- Vendor-specific keys required instead of `sub`: `sts:RoleSessionName` (Microsoft Defender), `aws:RequestTag/*` (DoIT/env0) [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)
- `aud` or provider URL values that are not customer-unique [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)
- Duplicate JSON keys in a trust policy — Terraform/Go `encoding/json` silently drops the duplicate, erasing the `sub` entry [E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md)
- Cross-account integration roles trusting a vendor account with only `sts:ExternalId` [E1](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md)

## How to review
For each role, read the trust policy and ask: what single value in the incoming token or request ties it to *this* customer? The invariant: the condition must bind to a customer-unique, attacker-uncontrollable claim (`sub` for the exact repo/workflow, or the vendor's required key), and must not be satisfiable by another tenant of the same provider. Check the raw policy JSON for duplicate keys before trusting the rendered view [E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md). For vendor integrations, confirm the External ID is treated as non-secret and that the trust is not merely the vendor account root [E1](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md).

## How finders spotted it
- Reviewed public documentation of 20+ vendors' AWS OIDC integrations to learn which condition keys each requires, then built detections for integrations missing them [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)
- Audited IAM role trust policies for GitHub OIDC integrations and noticed `sub` missing; traced a root cause to Terraform dropping duplicate JSON keys, and found a popular tutorial with the same mistake explaining copy/paste spread [E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md)
- Correlated CloudTrail `AssumeRole` events to a vendor account and flagged non-AWS source IPs, recognizing a broad supply-chain pattern across customer environments [E1](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md)

## Variants seen
- OIDC trust missing `sub`, any GitHub repo can assume [E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md)
- OIDC trust missing `sub`/`aud` across GitHub, GitLab, Terraform Cloud, Defender [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)
- Cross-account vendor role trusting account root with only External ID [E1](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md)
- Condition silently removed by duplicate-key parsing [E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md)

## Impact and severity
OIDC gaps grant full account access to any provider tenant [E2](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md)[E3](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md). The vendor case reached many customers at once: harvested IAM keys, Entra and Okta client secrets were validated to pivot into further accounts and identity providers [E1](https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md). Severity rises with breadth of trust and reuse of harvested credentials.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **Terraform** (encoding/json JSON parsing) (version not stated): A security community success story of mitigating a misconfiguration. Report: https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Awiz-io-blog-qubole-cross-account-access-abused-in-the-wild.md
- E2: https://bugbountylibrary.com/r/blog%3Awiz-io-blog-avoiding-mistakes-with-aws-oidc-integration-conditions.md
- E3: https://bugbountylibrary.com/r/blog%3Awiz-io-blog-a-security-community-success-story-of-mitigating-a-misconfiguration.md
