GitHub Actions A Cloudy Day for Security - Part 2 #209
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
This post is a hands-on guide to securely integrating GitHub Actions with Azure using OpenID Connect (OIDC), showing exactly how the identity flow works, what Azure validates, where insecure patterns arise, and multiple PoCs to abuse weak Federated Identity Credential (FIC) subject identifiers and workflow design flaws to obtain Azure access tokens and act as the configured service principal. It also demonstrates hardening with custom sub claims, reusable workflows bound via job_workflow_ref,...
🔧 Technical Details
Abusing weak OIDC subject identifiers: If a Federated Identity Credential uses
sub=repo:<org>/<repo>:pull_request, or ties to unprotected branches/tags/environments, any collaborator can run a matching workflow, exchange the GitHub ID token via azure/login (or manually) and obtain Azure access tokens.Manual GitHub→Azure token exchange: Request a GitHub ID token with
audience=api://AzureADTokenExchangeand POST it asclient_assertionto/<tenant>/oauth2/v2.0/tokenwithgrant_type=client_credentialsand...:jwt-bearerto receive an Azure access token for chosen scopes.Token exfiltration from runners: After
azure/login, the Azure CLI stores tokens in~/.azure/msal_token_cache.json. Exfiltrate withcat ... | base64 -w0 | base64 -w0and ...🤖 Agent Actions
I analyzed the repository and identified a gap: HackTricks already documents OIDC federation abuse for AWS and GCP but not for Azure. The provided blog is highly technical and focuses on abusing GitHub Actions OIDC with Azure Workload Identity (FIC) through weak subject scoping, manual token exchange, job_workflow_ref misuse, script injection in reusable workflows, and Terraform plan as an execution primitive. This content fits perfectly into HackTricks under the existing CI/CD and cloud security structure.
What I updated/created:
Why this placement:
No other files needed updating. The new content is purely technical, actionable, and aligned with HackTricks style and structure.
Changes implemented:
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.
🗑️ File Cleanup