Skip to content

sec(iac/aws): aws-wif-cli.sh.tmpl hardcodes an unoverridable OIDC thumbprint placeholder (not a bypass) #152

Closed

Description

@cristim

internal/iacfiles/templates/aws-wif-cli.sh.tmpl (grep for thumbprint-list; line number shifts as the file changes) hardcodes the all-zeros
placeholder thumbprint when creating the AWS OIDC provider:

aws iam create-open-id-connect-provider $PROFILE_ARG \
  --url "${OIDC_ISSUER_URL}" \
  --client-id-list "${OIDC_AUDIENCE}" \
  --thumbprint-list "0000000000000000000000000000000000000000" >/dev/null

There is no way for the operator to override it, so every CLI-bundle
onboarding creates the provider with that value. This is the CLI-bundle
sibling of LeanerCloud/cloud-commitments-cli#1615, which PR LeanerCloud/cloud-commitments-cli#1678 fixed for the CloudFormation and Terraform
bundles (empty default, ThumbprintList omitted via AWS::NoValue /
thumbprint_list = null so IAM retrieves the issuer's real thumbprint) but
deliberately left this file alone — noted in a comment on LeanerCloud/cloud-commitments-cli#1640 by the LeanerCloud/cloud-commitments-cli#1678
author, since internal/iacfiles/ was that issue's scope, not LeanerCloud/cloud-commitments-cli#1615's.

Not an authentication bypass

Worth stating plainly, since the wording on LeanerCloud/cloud-commitments-cli#1615 could be read otherwise (PR
LeanerCloud/cloud-commitments-cli#1678 corrects that). Per AWS's docs,
AWS verifies the JWKS endpoint's TLS certificate against its own library of
trusted root CAs and consults the configured thumbprint only when that
certificate does not chain to one of them, AWS cannot retrieve it, or the
endpoint requires TLS 1.3. All-zeros is inert on the primary path, and on the
fallback path it is simply not the SHA-1 of any certificate: it matches
nothing, so role assumption fails outright. For CUDly's actual issuers
(accounts.google.com, login.microsoftonline.com — both well-known
providers AWS auto-validates without consulting the configured thumbprint at
all) this has no live impact today. The failure mode for a hypothetical
custom/non-well-known issuer would be availability plus misleading
configuration, not takeover.

Second gap in the same file: re-running doesn't correct an existing provider

if [[ "${EXISTING_PROVIDER}" == "None" || -z "${EXISTING_PROVIDER}" ]]; then
  aws iam create-open-id-connect-provider ...
fi

The script only creates the provider when one doesn't already exist; there is
no else that re-checks or corrects the thumbprint on an existing provider.
An operator who re-runs the script after a fix ships still has the
placeholder on whatever provider they already created.
aws iam update-open-id-connect-provider-thumbprint is the out-of-band
remedy today.

Fix, when this is worked

--thumbprint-list is optional on create-open-id-connect-provider;
omitting it makes IAM retrieve and use the issuer's real top intermediate CA
thumbprint, matching what PR LeanerCloud/cloud-commitments-cli#1678 did for the CloudFormation and Terraform
bundles. Also decide explicitly whether to detect-and-correct an existing
provider's thumbprint on re-run, or to leave the skip-existing behavior and
document update-open-id-connect-provider-thumbprint as the remedy in the
script's own output.

Tracked in known_issues/13_iac_aws_target.md.

Refs LeanerCloud/cloud-commitments-cli#1615, LeanerCloud/cloud-commitments-cli#1640, LeanerCloud/cloud-commitments-cli#1678.

Activity

  1. IAmJSD commented on Oct 20, 2026

    @IAmJSD
    Collaborator

    Claiming: working on this

  2. self-assigned this
    on Oct 20, 2026
  3. IAmJSD commented on Oct 20, 2026

    @IAmJSD
    Collaborator

    Closing as already fixed on main by #459 (commit 944b87e, "fix(iac): enforce AWS CLI federation guard parity", merged 2026-09-30; it said "Refs #91", so this issue wasn't auto-closed).

    On current main, internal/iacfiles/templates/aws-wif-cli.sh.tmpl:

    • Hardcoded thumbprint: create-open-id-connect-provider no longer passes --thumbprint-list, so IAM fetches the issuer's real thumbprint (matching cli#1678 for the CFN/Terraform bundles).
    • Re-run doesn't correct an existing provider: after create or lookup, the script reads the provider back and refuses to continue (before role, policy or registration) if the URL or audience doesn't match, or if any thumbprint isn't 40 hex characters or is the all-zeros placeholder. It doesn't modify shared providers, so an existing placeholder provider now fails loudly instead of being silently reused.
    • Test coverage: TestAWSWIFCLIProviderGuards (stubbed aws) covers both. Putting the --thumbprint-list "000…0" line back makes it fail.

    Two small leftovers, not worth reopening for:

    • known_issues/13_iac_aws_target.md still lists this as open.
    • The error message could name aws iam update-open-id-connect-provider-thumbprint as the fix.

    @cristim, FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions