How the attack works
GitHub organization owners can change every setting, manage members and teams, manage Actions secrets, install GitHub Apps and delete repositories. Enterprise owners control the policies of every organization in an enterprise account and can join any of those organizations as an owner.
After compromising one owner (through a phished password without two-factor authentication, a stolen session or a leaked token), attackers promote an account they control, often a new or long-dormant one, so they keep access even if the original account is recovered. An attacker who wants less attention can assign an organization or enterprise role instead, or widen a custom role the account already holds, because such roles carry administrative permissions without the owner title. Two rules on this page read the role assignment actions and the actions that create or edit a custom role.
What an attacker needs
- Control of an existing organization or enterprise owner account, or of a token with admin:org scope.
Impact
Full control of the organization: source code theft, tampering with CI/CD and releases (software supply chain compromise), exfiltration of Actions secrets that unlock cloud environments, and removal of other administrators.
Detection rules
GitHub Custom Role Created or Changed
Detects a custom organization role, a custom enterprise role or a custom repository role being created or edited (organization_role.create and update, enterprise_role.create and update, role.create and update). An edit applies to the users and teams that already hold the role, so their access changes without a new assignment. The events list the permissions in role_permissions, and the update events also carry old_role_permissions. GitHub does not document the values of those fields in the audit log reference, so the rule matches on the action name and the permissions have to be read by a person.
title: GitHub Custom Role Created or Changed
id: d9d45b27-db62-41ac-832a-c34e33b78a09
status: experimental
description: >-
Detects a custom organization role, a custom enterprise role or a custom
repository role being created or edited (organization_role.create and
update, enterprise_role.create and update, role.create and update). An edit
applies to the users and teams that already hold the role, so their access
changes without a new assignment. The events list the permissions
in role_permissions, and the update events also carry old_role_permissions.
GitHub does not document the values of those fields in the audit log
reference, so the rule matches on the action name and the permissions have
to be read by a person.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: github
service: audit
detection:
selection:
action:
- organization_role.create
- organization_role.update
- enterprise_role.create
- enterprise_role.update
- role.create
- role.update
condition: selection
falsepositives:
- Owners who design or maintain custom roles. These changes are rare in most organizations, so review role_permissions on each one and compare an update with old_role_permissions.
level: low
False positives
- Owners who design or maintain custom roles. These changes are rare in most organizations, so review role_permissions on each one and compare an update with old_role_permissions.
GitHub Organization or Enterprise Role Assigned
Detects an organization role or an enterprise role being assigned to a user or a team (organization_role.assign, enterprise_role.assign). These roles give administrative permissions without the owner role. An organization role can hold permissions such as managing organization Actions secrets, runners or custom roles, and a base repository role inside it applies to all current and future repositories of the organization. The role is named in organization_role_name or enterprise_role_name. Which permissions it holds is not in this event, so read the role's definition.
title: GitHub Organization or Enterprise Role Assigned
id: 89bf9aa5-bfa8-43a3-9358-73c4abd6e280
status: experimental
description: >-
Detects an organization role or an enterprise role being assigned to a user
or a team (organization_role.assign, enterprise_role.assign). These roles
give administrative permissions without the owner role. An organization
role can hold permissions such as managing organization Actions secrets,
runners or custom roles, and a base repository role inside it applies to
all current and future repositories of the organization. The role is named
in organization_role_name or enterprise_role_name. Which permissions it
holds is not in this event, so read the role's definition.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: github
service: audit
detection:
selection:
action:
- organization_role.assign
- enterprise_role.assign
condition: selection
falsepositives:
- Planned delegation, for example a security team that receives a role for security settings. Confirm each assignment with the acting owner, and exclude team synchronisation that assigns roles on a schedule by actor.
level: medium
False positives
- Planned delegation, for example a security team that receives a role for security settings. Confirm each assignment with the acting owner, and exclude team synchronisation that assigns roles on a schedule by actor.
GitHub Organization or Enterprise Owner Role Granted
Detects a member being added to, or promoted within, a GitHub organization with the owner (admin) role, and an enterprise owner being added.
title: GitHub Organization or Enterprise Owner Role Granted
id: 3209fc4f-7e64-40d5-8bd5-cc252a1a8b6c
status: experimental
description: >-
Detects a member being added to, or promoted within, a GitHub organization
with the owner (admin) role, and an enterprise owner being added.
references:
- https://attack.mitre.org/techniques/T1098/
- https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
author: Forestall
date: 2026-11-10
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: github
service: audit
detection:
selection_org_owner:
action:
- org.add_member
- org.update_member
permission: admin
selection_enterprise_owner:
action: business.add_admin
condition: 1 of selection_*
falsepositives:
- Planned owner changes; confirm with the organization's security contact.
level: high
False positives
- Planned owner changes; confirm with the organization's security contact.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Owner role granted and taken away again within a few hours
An attacker who needs the owner role for one task, such as installing an app, approving a token or changing a security setting, can give it to an account they control and take it back afterwards, so that the list of owners looks unchanged at the next review. A promotion that is reversed for the same account within a few hours, with actions by that account in between, fits this better than a planned owner change, which lasts.
- An account receives the owner role:
org.add_memberororg.update_memberwithpermissionadmin, orbusiness.add_adminfor an enterprise owner. Keep the account inuser, theorgorbusiness, the actingactorand the time. - Within 4 hours the same
userloses it:org.update_memberwithold_permissionadmin,org.remove_member, orbusiness.remove_admin. - List the events between the two whose
actoris that account. They show what the owner role was used for, for example changes to single sign-on, two-factor, IP allow list or audit log streaming settings, app installations, token approvals or secrets.
Eventsorg.add_memberorg.update_memberorg.remove_memberbusiness.add_adminbusiness.remove_admin
LimitsAn owner who corrects a mistaken promotion, and access processes that grant the owner role for a fixed period, produce the same pair. GitHub describes user as the user affected by the action but does not list it for each event, so check on one of your own events that it names the promoted account. The 4 hours are a starting point.
Triage
- Identify who made the change (actor) and the promoted account (user), and check when the promoted account was created or last active.
- Confirm the change with the acting owner through a separate channel.
- If unexplained, demote the account, revoke its tokens and SSH keys, and review audit log activity by both accounts.
Response
Once the attack is confirmed:
- Remove the owner role from the promoted account, and remove the account from the organization if nobody can vouch for it. Remove a rogue enterprise owner at enterprise level, since an enterprise owner can join any organization as an owner.
- Secure the owner account that made the promotion. Reset its password and second factor, end its sessions and revoke its SSH keys and personal access tokens. A token with
admin:orgscope is enough to make this change. - Check the full list of owners and the pending invitations of the organization and the enterprise. An invited owner does not show as one until the invitation is accepted, so cancel invitations nobody can explain.
- Review and reverse what the two accounts changed as owners, such as installed GitHub Apps, organization settings, member and team changes and removed administrators.
- Rotate the organization's Actions secrets and the cloud credentials they unlock, because owners manage those secrets.
Mitigation
- Require two-factor authentication for the organization and enterprise, preferably phishing-resistant methods.
- Keep the number of owners small and review owner changes; use teams with scoped roles for daily administration.
- Stream the audit log to your SIEM and alert on promotions to owner, on accounts that join with the owner role (
org.add_memberwith permission admin) and on enterprise owner invitations (business.invite_admin). The organization invitation event (org.invite_member) does not record the invited role, so an invited owner becomes visible only when the invitation is accepted.
Frequently asked questions
Why did no alert fire when the attacker invited a new owner?
The organization invitation event (`org.invite_member`) does not record the invited role, so an invited owner cannot be told from an invited member. The owner becomes visible when the invitation is accepted, as `org.add_member` with permission admin. Review pending invitations by hand during an incident. Enterprise owner invitations are a separate event, `business.invite_admin`.
What does the value admin in the permission field mean?
In the organization audit log the owner role appears as permission `admin`. The owner rule matches `org.add_member` and `org.update_member` with that value, which covers an account that joins as an owner and a member who is promoted to owner. Enterprise owners are matched through `business.add_admin`.
Is recovering the compromised owner account enough?
No. The point of promoting a second account is to keep access after the first one is recovered. The promoted account, often a new or long-dormant one, has to be demoted and its tokens and SSH keys revoked. Changes that either account made as an owner have to be reviewed as well.
How does an enterprise owner differ from an organization owner in this attack?
An organization owner controls one organization. An enterprise owner controls the policies of every organization in the enterprise account and can join any of them as an owner. A rogue enterprise owner therefore has to be removed at enterprise level, and every organization has to be checked for what that account did.