Places where GitHub access works differently from what most people expect. Each one quotes the GitHub docs or changelog that states it, links the permissions, roles and scopes involved, and says how to check for it and how to close it. Open one to read it.
A private fork in your organization is readable only by the people your organization gave access to.
What GitHub does
GitHub's docs say "owners of an upstream repository can read all forks in the repository network", and that for a fork in another organization they "have read permission" but cannot delete the fork or its branches. Teams with access to the private upstream get the same access to its forks. Tested in November 2026: an owner of the upstream's organization, not a member of the fork's organization, opened the private fork, while the fork's Collaborators and teams page listed only its own member.
How to check
List your organization's private forks whose upstream is owned by someone else. Everything pushed to them can be read by that upstream's owners and teams, and your access settings do not show those people.
Push nothing to such a fork that the upstream's organization should not see. For work that has to stay private, clone the fork and push it to a new repository that is not a fork.
With code owner review required, a path owned by a team keeps needing that team's approval until someone changes CODEOWNERS.
What GitHub does
GitHub's docs say "if you specify a user or team that doesn't exist or has insufficient access, a code owner will not be assigned", and that a path without an owner "can be made with the approval of any user who has write access." CODEOWNERS names a team by its slug, so deleting the team, renaming it or removing its write access leaves its paths without an owner. The file does not change, the branch still requires code owner review, and nothing warns at merge time; the error only shows when someone opens the file or calls the errors endpoint.
How to check
Read the CODEOWNERS errors for each repository's default branch. An owner that no longer exists or lacks write access is listed as an unknown owner.
Check CODEOWNERS errors on a schedule or in CI and fail on any. Before deleting or renaming a team, search the organization's CODEOWNERS files for its slug and update them in the same change.
Owners can list and revoke every credential that has SSO access to the organization.
What GitHub does
A GitHub App user access token is authorized for SSO automatically when the user signs in to the App during an active SAML or OIDC session. GitHub's docs say these authorizations "are not visible to users or admins in the GitHub UI", are not in the REST API, and owners "cannot directly revoke SSO authorization for individual GitHub App user access tokens". The credential authorizations list only shows tokens and SSH keys.
How to check
List the Apps installed in the organization. Each one that signs users in can hold user tokens with SSO access that no list shows.
To cut off one person's App tokens, remove them from the organization: a user token never has more than its user. To cut off everyone, suspend or uninstall the App.
With the base permission set to none, members only see the repositories they were given access to.
What GitHub does
GitHub states that internal repositories have a minimum visibility level of read, even if the base permission has been set to none. Every member of the enterprise can read and clone them, whichever organization they belong to.
How to check
Read the organization's base permission and list its internal repositories.
gh api /orgs/ORG --jq .default_repository_permission
gh repo list ORG --visibility internal --limit 1000 --json name --jq '.[].name'
How to close it
Make repositories private when they should only be seen by the people given access. Keep internal for code the whole enterprise may read.
Converting a member to an outside collaborator cuts them down to nothing until they are added to a repository.
What GitHub does
GitHub's REST docs say a converted member will "only have access to the repositories that their current team membership allows". They leave the teams and the organization, but keep access to the repositories those teams reached, now as an outside collaborator.
How to check
After converting someone, list the repositories they can still reach.
gh api /orgs/ORG/outside_collaborators --paginate --jq '.[].login'
How to close it
Remove the person from the organization instead, then add them as an outside collaborator to only the repositories they need. If you convert, review and remove their repository access straight after.
Lowering the organization's base permission lowers access everywhere it applied.
What GitHub does
GitHub's docs say that when you change base permissions for an organization, permissions for private forks are not automatically updated. Forks made under the old base permission keep the access they had.
How to check
List the private forks of the organization's repositories after changing the base permission.
After lowering the base permission, review private forks and remove access or delete the ones that are no longer needed. Turn off private forking where it is not needed.
When a person is removed or disabled in the identity provider, they lose access to the organization.
What GitHub does
With SAML SSO and no SCIM, removing a user in the IdP does not remove them from the organization. Their SSO session expires, but personal access tokens, SSH keys and OAuth tokens they already authorized for SSO keep working until an owner removes the member or revokes the authorizations. With SCIM the member is removed automatically. With Enterprise Managed Users the account is suspended and its tokens and keys are deleted.
How to check
Compare the organization's SSO credential authorizations with the people who are still active in the IdP. Anyone who is gone from the IdP but still listed can use those credentials.
Turn on SCIM provisioning so removal in the IdP removes the member. Until then, make removing the GitHub member and revoking their credential authorizations part of offboarding (DELETE /orgs/{org}/credential-authorizations/{credential_id}).
A classic token needs admin:org to change organization settings; repo is about repositories.
What GitHub does
GitHub's REST docs accept admin:org or repo for PATCH /orgs/{org}, and list repo for writing organization Actions secrets and creating runner registration tokens. A classic token with only repo, created by an organization owner, can change the organization's settings, including the base repository permission for every member, without ever asking for admin:org.
How to check
Find organization owners who use classic tokens. In an organization with SAML SSO, the credential authorizations list shows each token's scopes.
Have owners use fine-grained tokens or a separate account for automation, and restrict classic tokens in the organization's personal access token policy.
A classic token without the workflow scope cannot add or change workflow files.
What GitHub does
GitHub's scope docs say a workflow file can be committed without the workflow scope when the same file, with the same path and contents, already exists on another branch of the repository. A workflow that sits on any branch can be copied to another branch with a token that only has repo.
How to check
Look for workflow files on branches other than the default branch, especially ones that use secrets or pull_request_target.
How to close it
Protect .github/workflows with a push ruleset or code owner review, and delete stale branches that carry workflow files.
A protected branch requires a review from everyone.
What GitHub does
By default a branch protection rule does not apply to people with admin on the repository, or to custom roles with "bypass branch protections". Rulesets have an explicit bypass list instead.
How to check
Check whether each protected branch also enforces its rules for admins.
gh api /repos/ORG/REPO/branches/main/protection --jq .enforce_admins.enabled
How to close it
Turn on "Do not allow bypassing the above settings", or move to rulesets with a short, named bypass list.
A GitHub App stays installed if the person who set it up leaves the organization. Its private keys do not expire either; they must be revoked by hand, and anyone holding one can mint installation tokens.
How to check
List the organization's installations and confirm an owner for each, and the age of each App's private keys.
Classic personal access tokens have no expiration requirement and OAuth app tokens are long-lived by default. GitHub revokes them automatically only when they have not been used for a year, so a token used now and then lives on.
How to check
In an organization with SAML SSO, the credential authorizations list shows each token's expiry and last use.
A private fork in your organization belongs to you, and only your admins can delete it.
What GitHub does
GitHub's docs say that when a private repository is deleted, "its private forks are also deleted." That holds for forks in other organizations too, so an admin of the upstream, often a vendor or a former partner, decides whether your fork exists. Work kept only in the fork, with its issues, pull requests and settings, goes with it.
How to check
List your organization's private forks whose upstream is owned by someone else.
For a fork you depend on, keep a standalone copy: clone it and push it to a new repository that is not a fork. Back up anything that only lives in the fork.
When an owner revokes a fine-grained token's access to the organization, whatever it set up stops working.
What GitHub does
GitHub's docs say that after an owner revokes a fine-grained token, "any SSH keys created by the token will continue to work" and the token can still read public resources in the organization. The revocation moves the token's resource owner from the organization to the user, "and the user can reassign it back."
How to check
After revoking a token, look at the owner's SSH keys and ask which ones the token added. Public keys are listed per user.
gh api /users/USER/keys --jq '.[] | [.id, .key[0:40]] | @tsv'
How to close it
When a token is revoked because it leaked, also remove the SSH keys it added, or remove the member. Revocation alone is not removal: the user can point the token back at the organization.
Anything that follows from a fork's pull request runs without the base repository's secrets.
What GitHub does
A workflow on workflow_run runs from the default branch, and GitHub's docs say it "is able to access secrets and write tokens, even if the previous workflow was not." It can also download the artifacts the fork's run uploaded. If it runs or unpacks them, the fork's code runs with secrets and a write token.
How to check
Find workflows on workflow_run and look at whether any of them download artifacts, check out the pull request's head or run scripts from it.
Treat artifacts from the triggering run as untrusted data: unpack them outside the workspace, never run them, and validate what is read from them. Set permissions in the workflow to the least the job needs.
An organization permission gives no access to repositories, so a webhook manager cannot read private ones.
What GitHub does
GitHub's docs say "organization permissions do not grant read, write, or administrator access to any repositories", but people with Manage organization webhooks "will be able to view webhook payloads, which may contain metadata for repositories in the organization." They can also point a webhook at their own URL and receive events from every repository.
How to check
List custom organization roles and who holds the ones with the webhooks permission.
With "Require approval for all external contributors" on, no workflow runs for an outsider's pull request until a maintainer approves it.
What GitHub does
GitHub's docs say pull_request_target workflows run in the context of the base branch, and "since the base branch is considered trusted, workflows triggered by these events will always run, regardless of approval settings." The privileged trigger is the one the approval setting does not gate.
How to check
Find workflows on pull_request_target in public repositories. Each one runs for any outsider's pull request, whatever the approval setting says.
Gate pull_request_target with workflow execution protections (actor rules or an event policy), or put the steps that use secrets behind an environment with required reviewers.
Self-hosted runners in an organization only run jobs for the repositories they were set up for.
What GitHub does
By default, every private repository in the organization can use the runners in a runner group, and runners registered without a group land in the default group. The REST API creates a group with visibility all unless told otherwise. Anyone who can create a repository, or push a workflow to any private repository, can send a job to those runners.
How to check
List the organization's runner groups and look for visibility all, and for groups that also allow public repositories.
Environments exist only when an admin creates them, and a job that names an unknown environment fails.
What GitHub does
Running a workflow that references an environment that does not exist creates it. Anyone who can edit workflows can do this, but only admins can configure it, so the new environment has no protection rules or secrets. A cloud OIDC trust that names an environment which was never set up in GitHub, or was deleted, can then be used by anyone with write access.
How to check
List each repository's environments and find those without protection rules. Compare them, and the names missing from the list, with the environment subjects your cloud OIDC trusts accept.
Create every environment a cloud trust names, with required reviewers and deployment branches, before the trust goes live. Remove trusts for environments that are gone.
Required reviewers and wait timers on an environment hold deployments on any paid plan.
What GitHub does
On GitHub Free, Pro and Team, required reviewers and wait timers are only available for public repositories. Deployment branches work on private repositories on Pro and Team. When a repository goes from public to private, its configured protection rules and environment secrets are ignored.
How to check
On Free or Team, list private repositories that deploy through environments, and any that used to be public.
gh repo list ORG --visibility private --limit 1000 --json name --jq '.[].name' |
xargs -I{} gh api /repos/ORG/{}/environments --jq '"{} \(.total_count)"'
How to close it
Gate deployments on reviewed merges to a protected branch, with deployment branches on the environment. Where a person must approve each deployment, move to Enterprise Cloud.
The audit log shows who cloned or pushed a repository for as long as it keeps everything else.
What GitHub does
The audit log retains Git events for seven days, while other events are kept for up to seven months. Git events are not shown in the web interface and cannot be read through GraphQL; only the REST API and a JSON export return them, and those leave out Git activity made through the browser or the APIs.
How to check
See whether the enterprise streams its audit log, and confirm that Git events arrive in the destination.
gh api "/orgs/ORG/audit-log?include=git&phrase=action:git.clone" --jq '.[0]'
How to close it
Stream the audit log, with Git events, to a SIEM or storage you keep for as long as an investigation needs.
A package published as public by mistake can be switched back to private.
What GitHub does
GitHub states that once you make a package public, you cannot make it private again. Deleting it is the only way to take it down, and anyone may already have pulled it.
How to check
List the organization's packages and look for public ones that belong to private repositories.
In the organization's Packages settings, turn off public package creation unless you publish open source, keep package admin to a few people, and treat anything in a public package as published.
A GitHub Pages site built from a private repository is only visible to people who can see the repository.
What GitHub does
GitHub's docs warn that Pages sites are publicly available on the internet, even if the repository for the site is private. Publishing a site privately needs GitHub Enterprise Cloud. On Team, anyone who can publish Pages from a private repository publishes it to everyone.
How to check
List the private repositories that have a Pages site, then look at whether each site is public.
gh api /orgs/ORG/repos --paginate --jq '.[] | select(.private and .has_pages) | .full_name' |
while read r; do echo "$r $(gh api /repos/$r/pages --jq .public)"; done
How to close it
On Enterprise Cloud, publish sites privately and clear Public under Member privileges, Pages creation. On Team, keep anything internal out of Pages sites, or unpublish them.
Rules that block files from being pushed keep applying when a repository changes visibility.
What GitHub does
Push rulesets only apply to private and internal repositories. When a repository is made public, GitHub's docs say all push rulesets will be disabled, so the file path, extension and size rules stop blocking pushes from then on.
How to check
List the organization's push rulesets and the public repositories they used to cover.
Leave visibility changes to owners by turning off the member privilege to change repository visibility. Before a repository goes public, put its file rules somewhere that still applies, such as secret scanning push protection or checks in CI.
A reusable workflow fails when the caller does not pass a secret it needs, especially one marked required.
What GitHub does
If the caller workflow doesn't pass an environment secret, the secret resolves to an empty string in the reusable workflow and the run shows no error. required: true only checks that the caller passes the secret, not that it has a value.
How to check
Find reusable workflows (on: workflow_call) that use secrets, and look at whether they check each one has a value before using it.
Start each job in a reusable workflow with a step that fails when a secret it needs is empty, so a missing secret stops the run instead of running the job without it.
With push protection on, a push that contains a secret is blocked.
What GitHub does
If a push in a public repository is larger than 50 MB, push protection skips it and doesn't scan it. A push that is too large can also time out the scan without blocking, and a push that contains over 1,000 existing secrets is not blocked. Secret scanning still scans after the push and creates alerts.
How to check
Treat open secret scanning alerts in public repositories as leaked, even where push protection is on.
A workflow run for a pull request from a fork gets a read-only token and no secrets.
What GitHub does
That holds for the pull_request event. With pull_request_target the job runs in the base repository and receives its GITHUB_TOKEN and access to repository and organization secrets. It is only safe while the workflow never checks out or runs code from the pull request.
How to check
Find workflows that use pull_request_target and look at whether any of them check out the pull request's head.
Use pull_request for anything that builds or tests the pull request's code. Where pull_request_target is needed, never check out the head ref, and set permissions in the workflow to the least the job needs.
Removing a member takes away their access to private forks of the organization's repositories.
What GitHub does
Removed members lose access to private forks of the organization's private repositories, but once a private repository is forked into another organization, that organization controls access to the fork. GitHub's docs say users may retain access to the forks even after losing access to the original organization.
How to check
List the forks of each private repository and look for owners outside your organization.
Turn off forking of private repositories in Member privileges, or allow it only where needed. When someone leaves, review forks outside the organization and ask their owners to delete them.
The owner of a personal repository can give someone read-only access.
What GitHub does
In a private repository owned by a personal account, the owner can only grant write access to collaborators. Collaborators can't have read-only access, so everyone invited can push, publish releases and fork the repository.
How to check
List your private personal repositories and their collaborators.
gh api "/user/repos?affiliation=owner&visibility=private" --paginate --jq '.[].full_name'
How to close it
Move repositories that others only need to read into an organization, where read is a role.
After a rename, the old URL keeps redirecting to the repository.
What GitHub does
GitHub redirects the old name until a new repository is created with it. GitHub's docs say that if you do, redirects to the renamed repository will no longer work, so clones, pushes and links to the old URL reach the new repository instead. Actions never follow the redirect: a workflow that uses an action from a renamed repository fails with repository not found.
How to check
Look for remotes, submodules, workflows and scripts that still use a repository's old name.
How to close it
Update every reference to the new name right after a rename, and do not create a repository with the old name.
Organization owners decide which repositories an approved GitHub App can reach.
What GitHub does
By default, repository admins can add their repositories to any GitHub App an owner already installed, even when it has organization or repository administration permissions, and can install Apps that need neither. That includes outside collaborators with admin access. Since 13 October 2026 no owner approval is needed for adding a repository to an existing installation.
How to check
Look at Member privileges, "GitHub Apps", in the organization settings, and list which installations cover selected repositories.
A bypass on a repository's push ruleset only applies to that repository, and each fork's admins decide their own.
What GitHub does
Push rulesets cover a private or internal repository and its entire fork network, and so does their bypass list: only those who can bypass the ruleset in the root repository can bypass it in any fork. A bypass actor added for the root can push blocked files to every fork, and a fork's own admins cannot bypass it.
How to check
List the bypass actors on push rulesets for private and internal repositories that have forks.
A pull request opened by a workflow with GITHUB_TOKEN either runs its checks like any other, or runs nothing at all.
What GitHub does
Events made with GITHUB_TOKEN do not start workflow runs, with exceptions. A pull request it opens or updates does start runs, but they wait for approval, and someone with write access has to approve them from the merge box. GitHub's suggested way around the wait is a GitHub App or personal access token, whose pull requests run without approval.
How to check
Find workflows that open or update pull requests, and see which token they use.
How to close it
Read the pull request before approving its runs. Where a bot needs runs without approval, use a GitHub App with the fewest permissions, not a personal access token, and keep its pull requests behind required reviews.
Secrets are hidden. People who can push code cannot see them.
What GitHub does
GitHub states that any user with write access to a repository has read access to all secrets configured in it: they can push a workflow on a branch that prints or sends them. Environment secrets are only given to jobs that use the environment, and an environment with required reviewers holds the job until someone approves it.
How to check
List the repository's secrets and who has write access. Every person and token with write can read each of those secrets.
gh api /repos/ORG/REPO/actions/secrets --jq '.secrets[].name'
gh api /repos/ORG/REPO/collaborators --paginate \
--jq '.[] | select(.permissions.push) | .login'
How to close it
Move deployment secrets into environments with required reviewers, or replace them with OIDC so there is no stored secret to read.
GITHUB_TOKEN is read-only unless a workflow asks for more.
What GitHub does
Read-only became the default on 2 February 2023, but only for new enterprises, organizations and repositories. Anything created earlier kept read and write for every workflow without a permissions block.
How to check
Read the organization's and each repository's default workflow permissions.
gh api /orgs/ORG/actions/permissions/workflow
gh api /repos/ORG/REPO/actions/permissions/workflow
How to close it
Set the default to read at the enterprise or organization level, and give each workflow a permissions block with what it needs.
A workflow cannot approve its own pull request, so required reviews always mean a person looked.
What GitHub does
The setting that lets Actions approve pull requests arrived in January 2022 turned on, so existing workflows kept working; it was later renamed "Allow GitHub Actions to create and approve pull requests". Only new personal repositories are documented as having it off. Where it is on, a workflow with pull-requests: write can approve a pull request and count towards required reviews.
How to check
Check can_approve_pull_request_reviews for the organization and its repositories.
gh api /orgs/ORG/actions/permissions/workflow --jq .can_approve_pull_request_reviews
How to close it
Turn the setting off at the enterprise or organization level unless a workflow needs it.
Every time someone bypasses a ruleset, it is logged.
What GitHub does
A bypass actor with bypass_mode exempt is not checked against the rules at all, and GitHub creates no bypass audit entry for it.
How to check
Look for exempt bypass actors in organization and repository rulesets.
for id in $(gh api /orgs/ORG/rulesets --jq '.[].id'); do
gh api /orgs/ORG/rulesets/$id --jq '.name as $n | .bypass_actors[] | select(.bypass_mode == "exempt") | [$n, .actor_type, .actor_id] | @tsv'
done
How to close it
Use the always or pull_request bypass modes, which are logged, unless the actor is an automation you trust not to need review.
Rewriting history and force-pushing removes a committed secret from GitHub.
What GitHub does
The old commits leave every branch but stay on GitHub. The docs say they "may still be accessible" in clones and forks, by their SHA-1 hashes in cached views on GitHub, and through pull requests that reference them. The docs name no point at which GitHub removes them by itself. GitHub Support removes cached views and runs a garbage collection on request, and only helps when rotating the credential cannot solve it.
How to check
After the force push, open the old commit on github.com with its full hash. If the page loads, the commit is still stored.
How to close it
Revoke or rotate the secret first; that alone may be enough. For data that cannot be rotated, rewrite the history, then ask GitHub Support to remove cached views and pull request references. Forks keep their copy.
Organization Codespaces policies, such as keeping forwarded ports private, apply to every codespace for its repositories.
What GitHub does
GitHub's docs say Codespaces policies only apply to codespaces that your organization pays for. A member who opens a codespace for an organization repository on their own account is not bound by those policies, so it can forward ports publicly.
How to check
Look at who pays for codespaces in the organization's Codespaces settings, and whether members can still open codespaces for its repositories on their own accounts.
How to close it
Let the organization pay for members' codespaces so its policies apply, and treat any codespace a member pays for as outside your controls.
Revoking a stolen signing key marks the commits it signed as unverified.
What GitHub does
GitHub keeps a verification record for each signed commit. If a signing key is later revoked, expired, or otherwise altered, previously verified commits retain their verified status, and GitHub will not re-verify them. Commits pushed with a stolen key before it was revoked keep the Verified badge.
How to check
When a signing key may be stolen, find the commits it signed since then and review them by hand. The badge does not help.
How to close it
Revoke the key, then review or revert the commits it signed after the possible compromise. Treat Verified as "the key was valid when pushed", not as proof of who wrote the commit.
After an account is renamed or deleted, nobody else can serve code under its old repository paths.
What GitHub does
GitHub only retires a namespace when the project had more than 100 clones in the week before its owner's account was renamed or deleted. Anyone can register the old login, and for every other repository they can create one with the same name, so code that still points at the old path pulls theirs. Actions and reusable workflows do not follow redirects, so they fail instead of following the rename.
How to check
Look for dependencies, submodules and install scripts that point at GitHub paths which redirect or no longer exist.
How to close it
Update references to the new path, pin actions and dependencies to commit SHAs, and keep old organization names registered after a rename.
Git data from any repository in a fork network can be read from any other repository in the same network, including the upstream, even after a fork is deleted. A commit pushed to a fork stays reachable by its hash.
How to check
Assume anything ever pushed to any fork of a public repository is still readable.
How to close it
Rotate any secret that was pushed to a fork. Deleting the fork or the branch does not remove it.