How the attack works
An outside collaborator is a person who is not a member of the organization but has been given access to one or more of its repositories. By default anyone with admin access to a repository can invite one, unless the owners restrict invitations to themselves. Outside collaborators are not required to use SAML single sign-on, so their access does not depend on the organization's identity provider. The base permission is the opposite lever: one organization setting that gives every member the same level of access (none, read, write or admin) to every repository, and a change applies to existing members as well as new ones.
Both are quiet ways to keep or widen access. An attacker who controls an account with admin rights on a repository adds an account of their own as an outside collaborator and keeps reading or writing code after the first account is recovered. Mandiant's investigation of the 2025 Salesloft Drift incident, as reported by The Register, found that the actor in the company's GitHub account downloaded content from several repositories, added a guest user and set up workflows. An attacker with owner rights can instead raise the base permission, which gives every member account write or admin access to every repository. GitHub records the addition as org.add_outside_collaborator, an invitation as repository_invitation.create, and the two settings as org.update_default_repository_permission and org.update_member_repository_invitation_permission.
What an attacker needs
- Admin access to a repository to invite an outside collaborator, unless the organization restricts invitations to owners.
- An organization owner to change the base permission or the invitation policy, or an enterprise owner for the enterprise policy.
- A GitHub account that the attacker controls and that can accept the invitation.
Impact
An account outside the organization keeps read or write access to private repositories. It does not pass through single sign-on, it does not show in a review of members, and with write access it can push code and workflow files that run with the repository's Actions secrets. A raised base permission gives the same access to every member on every repository at once.
Detection rules
GitHub Base Repository Permission or Outside Collaborator Policy Changed
Detects a change to the base repository permission of an organization (org.update_default_repository_permission) or of all organizations of an enterprise (business.update_default_repository_permission), and a change to the policy that decides whether members may invite outside collaborators (org.update_member_repository_invitation_permission). The base permission applies to every member and every repository, and a change affects existing members too. The actions are written for a change in either direction. The base permission events carry old_permission and permission, and GitHub's audit log reference does not document their values, so the rule matches on the action name and the two fields have to be compared by a person.
title: GitHub Base Repository Permission or Outside Collaborator Policy Changed
id: 4717d8e8-ff1a-4a77-8b09-c94290c125ad
status: experimental
description: >-
Detects a change to the base repository permission of an organization
(org.update_default_repository_permission) or of all organizations of an
enterprise (business.update_default_repository_permission), and a change
to the policy that decides whether members may invite outside
collaborators (org.update_member_repository_invitation_permission). The
base permission applies to every member and every repository, and a change
affects existing members too. The actions are written for a change in
either direction. The base permission events carry old_permission and
permission, and GitHub's audit log reference does not document their
values, so the rule matches on the action name and the two fields have to
be compared 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-user-access-to-your-organizations-repositories/managing-repository-roles/setting-base-permissions-for-an-organization
- https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators
- 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:
- org.update_default_repository_permission
- business.update_default_repository_permission
- org.update_member_repository_invitation_permission
condition: selection
falsepositives:
- An owner who lowers the base permission or restricts invitations writes the same actions. Compare old_permission with permission, and confirm every change with the organization owners, because these settings should change rarely.
level: medium
False positives
- An owner who lowers the base permission or restricts invitations writes the same actions. Compare old_permission with permission, and confirm every change with the organization owners, because these settings should change rarely.
GitHub Outside Collaborator Added to a Repository
Detects an outside collaborator being added to a repository of the organization (org.add_outside_collaborator). An outside collaborator is not a member of the organization and is not required to use SAML single sign-on, so the access rests on a GitHub account that the organization's identity provider does not control. The event names the added account in invitee, the inviting account in inviter and the access in permission. GitHub does not document the values of permission, so the rule fires for every role.
title: GitHub Outside Collaborator Added to a Repository
id: 7e36845b-3a86-4a2a-aebc-50fef643e145
status: experimental
description: >-
Detects an outside collaborator being added to a repository of the
organization (org.add_outside_collaborator). An outside collaborator is
not a member of the organization and is not required to use SAML single
sign-on, so the access rests on a GitHub account that the organization's
identity provider does not control. The event names the added account in
invitee, the inviting account in inviter and the access in permission.
GitHub does not document the values of permission, so the rule fires for
every role.
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-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization
- 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: org.add_outside_collaborator
condition: selection
falsepositives:
- Contractors, partners and open source contributors who are given access on purpose. Confirm each account with the team that owns the repository, and where such additions are frequent keep the alert for private repositories that hold production code.
level: medium
False positives
- Contractors, partners and open source contributors who are given access on purpose. Confirm each account with the team that owns the repository, and where such additions are frequent keep the alert for private repositories that hold production code.
GitHub Repository Invitation Sent or Collaborator Added
Detects an invitation to join a repository being sent (repository_invitation.create) and a collaborator being added to a repository (repo.add_member). These actions are written for direct access to a single repository, which is how an outside account is brought in and also how members are given access outside of teams. The rule does not tell the two apart, so it is at low level and serves as context for the rule on org.add_outside_collaborator. The invitation names the account in invitee, and repo.add_member carries the access in permission.
title: GitHub Repository Invitation Sent or Collaborator Added
id: 9e35cb6e-58b6-4fb2-9c27-e4a8e149702c
status: experimental
description: >-
Detects an invitation to join a repository being sent
(repository_invitation.create) and a collaborator being added to a
repository (repo.add_member). These actions are written for direct access
to a single repository, which is how an outside account is brought in and
also how members are given access outside of teams. The rule does not
tell the two apart, so it is at low level and serves as context for the
rule on org.add_outside_collaborator. The invitation names the account in
invitee, and repo.add_member carries the access in permission.
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-organization-settings/setting-permissions-for-adding-outside-collaborators
- 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:
- repository_invitation.create
- repo.add_member
condition: selection
falsepositives:
- Repository administrators who give colleagues direct access instead of using a team, which is common in many organizations. Use the rule for hunting and for the repositories where direct access should not occur.
level: low
False positives
- Repository administrators who give colleagues direct access instead of using a team, which is common in many organizations. Use the rule for hunting and for the repositories where direct access should not occur.
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.
New outside collaborator who clones repositories right after being added
An account that an attacker adds for themselves is used at once, usually to copy the code it can now reach. A contractor who starts work clones the one or two repositories of the project. An outside collaborator who is added and clones within hours, in more than one repository or with a token, fits the first case better.
- An outside collaborator is added:
org.add_outside_collaborator. Keep the added account frominvitee, the repository fromrepo, the acting account fromactorand the time. - In the following 24 hours, collect
git.cloneevents whoseactoris the added account. GitHub delivers Git events through the REST API, audit log streaming and exports only. - Count the different values of
repoamong the clones, and note fromprogrammatic_access_typewhether a token was used. - Check for further
org.add_outside_collaboratorevents with the sameinviteeor the sameactorin the period, which show access to more repositories.
Eventsorg.add_outside_collaboratorgit.clone
LimitsA contractor who starts on several repositories on the first day looks the same, so the result has to be confirmed with the repository owners. GitHub lists invitee among the fields of the event without describing it, so confirm on one event of your own that it holds the added account. The 24 hours are a starting point.
Triage
- Identify who added the account (
actor,inviter), the account that was added (invitee), the repository (repo) and the access it received (permission). - Ask the team that owns the repository whether the account belongs to a known contractor or partner, and look at the age and the activity of the account's profile.
- Check the acting account for other recent changes, such as new tokens, new SSH keys or changed workflow files.
- For a change of the base permission, compare
old_permissionwithpermissionand confirm the change with the organization owners. - Review what the added account did since the event, such as pushes, workflow runs and clones.
Response
Once the attack is confirmed:
- Remove the outside collaborator from every repository of the organization, and cancel the pending invitations that the same actor sent.
- Set the base permission and the invitation policy back to their recorded values.
- Secure the account that made the change. Reset its credentials and sessions, revoke its tokens and SSH keys, and take its admin rights until the change is explained.
- Revert what the added account changed, with particular attention to workflow files, and rotate the Actions secrets of the repositories it could write to.
- Treat the private repositories the account could read as copied, and rotate the credentials stored in them.
- After a raised base permission, review the pushes and setting changes that members made with the wider access during the period.
Mitigation
- Restrict the ability to invite outside collaborators to organization owners, which GitHub Enterprise Cloud allows.
- Keep the base permission at none or read, and give write and admin access through teams.
- Review outside collaborators on a schedule, remove those nobody can vouch for and give the rest the lowest role that works.
- Require two-factor authentication for the organization, which outside collaborators then have to enable before they can accept an invitation.
- Alert on every added outside collaborator and on every change to the base permission or the invitation policy.
Frequently asked questions
Why does disabling a person at the identity provider not remove an outside collaborator?
GitHub states that outside collaborators are not required to use SAML single sign-on to access the resources of an organization. Their access rests on their own GitHub account and on the repository role they were given. It ends only when the collaborator is removed from the repository or the organization in GitHub.
Which events show an invitation and which show the access itself?
GitHub writes `repository_invitation.create` when an invitation to join a repository is sent and `repository_invitation.accept` when it is accepted. It writes `org.add_outside_collaborator` when an outside collaborator is added to a repository. The medium rule on this page matches the addition, and a second rule at low level matches invitations and collaborators added to a repository in general.
Why is the base permission on the same page as outside collaborators?
Both give access to code without making anyone an owner. The base permission is a single organization setting that applies to every member and every repository, and GitHub notes that a change affects existing members as well as new ones. It does not apply to outside collaborators. The rule fires on every change, so `old_permission` and `permission` have to be compared.
Does the rule show which role the outside collaborator received?
The event carries a `permission` field. GitHub's audit log reference lists the field without its values, so the rule does not filter on it and fires for every role. Read the field during triage, and treat a collaborator with write or admin access as the more urgent case.
References
- MITRE ATT&CK T1098: Account Manipulation
- Audit log events for your enterprise
- Adding outside collaborators to repositories in your organization
- Setting permissions for adding outside collaborators
- Setting base permissions for an organization
- Enforcing repository management policies in your enterprise
- The Register: Drift massive attack traced back to loose Salesloft GitHub account (8 September 2025)