GitHub Attack Paths: How a Dev Branch Reaches Tier Zero

By 12 min read
GitHub attack paths from an unprotected dev branch through OIDC federation to Microsoft Entra ID Tier Zero

Your production branch can have every protection GitHub offers and still not be the way in. In a test organisation built by SpecterOps, every single GitHub member had a path to Microsoft Entra ID Tier Zero, and none of them needed to touch a protected branch.

In short: GitHub attack paths are chains in which ordinary repository write access lets a workflow on any branch request a cloud token. Here that token reached a service principal able to grant itself more privilege. SpecterOps published the analysis on 25 November 2026, and it argues that the trust boundary is the cloud identity, not the branch.

What are GitHub attack paths?

A GitHub attack path is a sequence of permissions and trust links that connects a GitHub identity to something more valuable outside GitHub. The endpoint might be a cloud subscription, a database or an identity administrator role.

The idea comes from Active Directory work. BloodHound, SpecterOps’ graph tool, has long mapped how a low-privileged domain user can reach Domain Admin through group memberships and sessions. The new post applies the same graph thinking across Active Directory, Okta, GitHub and Entra ID at once.

Tier Zero means the identities and systems that control the whole environment. In Entra ID that includes roles and service principals able to grant themselves or others top-level permissions.

What did SpecterOps publish?

On 25 November 2026, SpecterOps CTO Jared Atkinson published “Beyond Branch Protection: Understanding GitHub Attack Paths”. The core claim is that branch protection and MFA do not limit blast radius. Repositories carry other security-relevant powers, such as Actions secrets and OIDC trust into the cloud.

The example environment, called K-Nexus Global, is fictional. SpecterOps says it is modelled on production configurations, but the post is a conceptual walkthrough, not a measured study of real tenants.

The headline finding

In the example, every GitHub org member had a path to Tier Zero in Entra ID. At the same time, no GitHub user showed up as a privileged Entra identity. An Entra admin reviewing privileged users would see nothing wrong. A GitHub admin reviewing branch rules would see nothing wrong either. Atkinson’s point is that each platform owner sees only their own part of the path.

How does the attack path work, step by step?

The chain has six links. None of them is a vulnerability in the usual sense. Each one is a configuration that looks reasonable on its own.

Six-stage chain from a synced identity through GitHub write access and OIDC to Entra Tier Zero.
Each link is an ordinary setting. Together they connect any org member to Tier Zero. Data: SpecterOps.

1. The identity

The path starts with a compromised GitHub identity. In the example, Active Directory accounts sync to Okta, and Okta provides single sign-on to GitHub. SpecterOps notes that GitHub Enterprise Managed Users, where GitHub hands authentication to an external identity provider such as Okta or Entra ID, ties GitHub access directly to that upstream identity.

That means workstation sessions matter. In the example one user had sessions on three Active Directory computers. Compromising any of them could expose that user’s GitHub access.

2. Effective GitHub permissions

Effective permissions come from org roles, team membership, nested teams and per-repository role assignments. In the example the organisation’s default repository permission was set to write. Every member could therefore write to repositories without any explicit repository role.

Atkinson warns that admins reviewing per-repository assignments will undercount who really has write access when the default is that broad.

3. The workflow runs

Write access lets a user run a GitHub Actions workflow from a branch they push. A workflow can request an OIDC token, a short-lived signed statement from GitHub that says which repository, branch or environment the job runs in.

4. The federated credential

A federated identity credential in Entra ID tells an app registration to trust tokens from an outside issuer, here https://token.actions.githubusercontent.com, when the token’s subject matches. No secret is stored in GitHub. SpecterOps’ example credential trusted a subject scoped to the whole repository, so any branch or environment could satisfy it.

5. The service principal

The token is exchanged for an Entra access token as the app’s service principal, the identity an application uses in a tenant. In BloodHound this link is the GH_CanAssumeIdentity edge. The GitHound schema defines it as a repository that can assume a cloud identity through OIDC federation, either an Azure workload identity or an AWS IAM role.

6. Tier Zero

In the example, that service principal held a privilege BloodHound models as AZMGGrantAppRoles: it could grant Microsoft Graph app roles. An identity that can grant itself Graph app roles can effectively give itself control of the tenant, which is why it counts as Tier Zero.

Why does branch protection not stop it?

Branch protection controls what happens on matching branches: force pushes, deletions, required reviews, status checks and who can push. It does not change what a workflow running on a different branch can authenticate to.

SpecterOps’ second example makes this concrete. The repository uses one branch per environment: dev, staging and production. Each has its own federated credential. Production and staging are protected. Dev is not. All three credentials point at the same Entra app and service principal.

Dev, staging and production branches each mapped to the same Entra service principal.
Protecting two of three branches does not matter when all three unlock the same identity. Data: SpecterOps.

A push to the unprotected dev branch therefore gets the same cloud privileges as a reviewed production deploy. SpecterOps does not call branch protection broken. It says the protection scope simply does not match the trust scope.

Admins and bypass rules make it wider

GitHub’s own documentation adds more nuance. By default, branch protection restrictions do not apply to people with admin permission or to custom roles granted the bypass permission, unless “Do not allow bypassing the above settings” is turned on. Admins can always push to or create matching branches.

The GitHound schema models these gaps as separate edges. GH_BypassBranchProtection covers roles that can skip merge gates. GH_CanEditProtection covers roles that can change or remove the rule itself.

How do GitHub OIDC subjects and Entra trust fit together?

The subject (sub claim) is the string Entra compares against. GitHub and Microsoft document these formats:

Workflow context Subject format Who controls it
Environment repo:ORG/REPO:environment:NAME Environment settings, set by repo admins
Branch repo:ORG/REPO:ref:refs/heads/BRANCH Anyone who can push that branch
Tag repo:ORG/REPO:ref:refs/tags/TAG Anyone who can create that tag
Pull request repo:ORG/REPO:pull-request Anyone who can open a PR that runs the workflow

Microsoft states that the subject must match exactly. A wrong value is accepted when you create the credential and only fails later at token exchange. Pattern matching is not supported for branches and tags, and Microsoft suggests environments for workflows that run on many branches.

Key limits: 20 federated credentials per app, 600-character subjects, tens of thousands in some tenants.
A 20-credential cap per app pushes teams toward sharing identities, and large tenants hold tens of thousands of GitHub credentials. Data: Microsoft Learn, SpecterOps.

The environment catch

GitHub environments are the safer anchor, with one trap. GitHub’s documentation says anyone who can edit workflows can create an environment just by referencing a name that does not exist yet. The new environment has no protection rules until an admin configures it.

If an Entra credential trusts environment:production but nobody configured protection rules on that environment, the name alone gives no protection. An environment is only a boundary once it has required reviewers, deployment branch rules or both.

A format change to watch

GitHub’s OIDC documentation notes that repositories created after 15 July 2026 use an immutable default subject format that includes owner and repository IDs. This does not apply to GitHub Enterprise Server. Teams copying older trust templates for new repositories should check that the subject they configure is the one GitHub actually sends.

Who is affected and how do you check your exposure?

Any organisation that deploys from GitHub Actions to Azure or AWS with OIDC is in scope. The risk is highest where three things meet: broad default repository permissions, credentials scoped to whole repositories or unprotected branches, and service principals with directory-level rights.

SpecterOps says customer environments contain tens of thousands of GitHub federated credentials, so manual review does not scale.

Questions to answer this week

  1. What is the organisation’s default repository permission, and how many members does it give write access to?
  2. Which Entra apps and managed identities have federated credentials with the GitHub issuer, and which subjects do they trust?
  3. Does any credential trust a branch without protection, a pull request context or an environment without rules?
  4. Do several environments share one service principal?
  5. What can each of those service principals do, especially in Microsoft Graph?

Tooling

SpecterOps’ GitHound is an open-source BloodHound OpenGraph collector for GitHub. It is licensed under Apache-2.0, had 152 stars and 19 forks on GitHub when checked for this article, and dates from July 2025. It models organisations, users, teams, repositories, branches and roles. With full collection it also parses workflows and computes GH_CanPwnRequest edges, for workflows that can be abused to run code with a repository’s secrets.

Its README now marks it as deprecated in favour of openhound-github, a Python collector created in April 2026. Its README describes release 0.23.0 as adding enterprise OIDC providers and external identities.

Timeline of GitHub attack path tooling and the July 2026 OIDC subject change.
The tooling to graph GitHub trust has existed since 2025. The cross-platform write-up is the new part. Data: GitHub API, GitHub Docs, SpecterOps.

How do you detect abuse of these GitHub attack paths?

SpecterOps’ post gives no detection rules or log queries. The signals below follow from how the path works.

Log sources

  • GitHub audit log (organisation or enterprise): changes to default repository permissions, branch protection and ruleset edits, environment creation and protection rule changes, and pushes that add or change workflow files.
  • Entra ID service principal sign-in logs: sign-ins by apps that have federated credentials. Compare the source context with the deployments you expect.
  • Entra ID audit logs: changes to an app’s federated credentials, new app role assignments and permission grants, especially Microsoft Graph app roles.
  • Cloud activity logs (Azure Activity Log, AWS CloudTrail): actions taken by deployment identities outside normal pipelines.

Behaviours worth alerting on

  • A workflow on a non-default or newly created branch that requests an OIDC token for an identity normally used by production.
  • A workflow file added or changed on a branch, then removed shortly afterwards.
  • A deployment service principal granting app roles or adding credentials, which a deployment pipeline should almost never do.
  • A new GitHub environment whose name matches one trusted by an Entra credential.

ATT&CK mapping

SpecterOps does not publish an ATT&CK mapping. Our reading: Valid Accounts: Cloud Accounts (T1078.004) for using the federated identity, and Account Manipulation: Additional Cloud Roles (T1098.003) for the Graph app role grant.

How do you fix it? Prioritised steps

  1. Find Tier Zero service principals with GitHub trust. Any app that can grant Graph app roles or hold directory roles should not be reachable from a CI workflow. Remove the trust or the privilege.
  2. Give each environment its own identity. Separate service principals for dev, staging and production, each with least privilege. SpecterOps names the shared identity as the real boundary.
  3. Trust environments, not branches or whole repositories. Scope each subject to one GitHub environment and avoid repository-wide or pull request trust for privileged identities.
  4. Configure the trusted environments. Add required reviewers (up to six), turn on prevent self-review, restrict deployment branches and turn off admin bypass.
  5. Lower the default repository permission. Move from write to read and grant write through teams.
  6. Enforce protection for admins. Enable “Do not allow bypassing the above settings” or use rulesets with tight bypass lists.
  7. Graph it and repeat. Run a collector such as GitHound or openhound-github with Azure data in BloodHound, and re-run after role, repository or identity changes.

How does this compare to recent GitHub incidents?

This research describes a potential path, not an intrusion. But recent incidents show the same first steps being used for real.

Case Entry point Where it led Type
SpecterOps K-Nexus example Any GitHub org member Entra Tier Zero via OIDC Modelled path
1Password breach Stolen employee GitHub token CI/CD and backend code Real incident
wfx-loot campaign Stolen tokens for 4,837 GitHub accounts Workflow secrets in 1,806+ repos Real incident
Key Eater Stolen Entra app client secrets Mail and files in 27 organisations Real incident

The 1Password and wfx-loot cases show that attackers already treat GitHub write access as a way into CI/CD. Key Eater shows what happens once an attacker holds an Entra application identity. SpecterOps’ path connects those two halves without any stored secret at all.

For the Active Directory side of the same graph thinking, see our piece on BloodHound 9.10 and ADCS attack paths.

What is still unclear?

  • How common is it? The post uses a fictional organisation. SpecterOps cites tens of thousands of GitHub credentials in customer environments but gives no figure for how many reach Tier Zero.
  • The wildcard question. SpecterOps’ example uses a subject that covers every branch and environment in a repository. Microsoft’s documentation says standard federated credentials do not support wildcards, and points to a preview feature, flexible federated identity credentials, for claim matching. The post does not say which mechanism produced the repository-wide trust.
  • AWS and GCP. The post mentions AWS only in general terms. The GitHound edge covers AWS IAM roles, but no AWS example is worked through.
  • Data impact. SpecterOps itself notes that infrastructure access does not automatically mean customer data access, since encryption and application design can limit it.

Is this new, and is it overhyped?

The individual weaknesses are configuration choices, not new bugs, and GitHound has been able to graph GitHub permissions since 2025. What is new is a clear cross-platform model, from an Active Directory workstation session to an Entra Graph permission, and open-source collectors that build it as one graph.

The post is also vendor content. It ends with a BloodHound demo link, and its main finding comes from a test environment SpecterOps designed. The configuration checks it recommends stand on their own and need no product.

The bottom line

Branch protection answers “who can change production code?” It does not answer “who can become the production identity?”, and in SpecterOps’ example the answer was every org member. Inventory every federated credential, give each environment its own least-privilege identity and treat any CI identity that can grant Graph permissions as Tier Zero.

Sources

This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.

Frequently asked questions

What is a GitHub attack path?

A GitHub attack path is a chain of permissions and trust relationships that lets a GitHub identity reach something more valuable, such as cloud infrastructure or an identity admin role. SpecterOps maps these chains as graphs in BloodHound.

Does branch protection stop GitHub Actions from reaching Azure?

Not on its own. Branch protection controls pushes and merges on matching branches. A workflow on an unprotected branch can still request an OIDC token, and that token can reach Azure if a federated credential trusts that branch or the whole repository.

What is a federated identity credential in Microsoft Entra ID?

A federated identity credential tells an Entra app registration or managed identity to accept tokens from an external issuer, such as GitHub Actions, when the token's issuer, subject and audience match exactly. No client secret is stored in GitHub.

Does Microsoft Entra support wildcards in GitHub federated credentials?

Microsoft's documentation says standard federated identity credentials do not support wildcards or pattern matching for branches and tags. A flexible federated identity credential feature with claim matching expressions is in preview.

How many federated identity credentials can one Entra app have?

Microsoft documents a maximum of 20 federated identity credentials per application or user-assigned managed identity. Issuer and subject values are each limited to 600 characters.

What tool maps GitHub permissions into BloodHound?

SpecterOps' GitHound collector maps GitHub organisations, teams, repositories, branches, roles and workflows into BloodHound OpenGraph. Its README now says it is deprecated in favour of the openhound-github collector.

What is the safest way to connect GitHub Actions to Azure?

Use one federated credential per GitHub environment, give each environment its own least-privilege service principal and protect production environments with required reviewers, branch restrictions and no admin bypass.

Was a real company breached in the SpecterOps GitHub research?

No. SpecterOps used a fictional organisation called K-Nexus Global, modelled on production configurations. The paths it describes are potential paths, not a documented intrusion.

Keep reading

GitHub attack pathsGitHub Actions OIDCMicrosoft Entra IDworkload identity federationBloodHoundred team toolsCI/CD security