GitHub user to server tokens can create issues in any public repository
An authorization flaw in GitHub Enterprise Server let a user-to-server token from a GitHub App installation perform write actions on public repositories outside its intended scope. An attacker with a victim's token could create issues, comments, and private vulnerability reports on any public repository, appearing as the victim.
- Triaged in under an hour
- Fixed in 4 months
- Paid in 4 months
- Disclosed after 4 months
Summary by the program
An incorrect authorization vulnerability was identified in GitHub Enterprise Server that allowed a user-to-server token scoped to a GitHub App installation to perform certain write operations on public repositories outside the token's intended scope. This was possible because the authorization check only verified that the installation had read permissions on the target repository rather than verifying that the token's installation was explicitly granted access to that repository. An attacker who obtained a victim's user-to-server token could create issues, issue comments, commit comments, and private vulnerability reports on any public repository, appearing as the victim user with no indication of the app involvement. This vulnerability was fixed by adding a repository scope check for user-to-server tokens issued by global apps. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.22 and was fixed in versions 3.21.2, 3.20.4, 3.19.8, 3.18.11, 3.17.17, 3.16.20.
Context
GitHub Enterprise Server (GHES) is the self-hosted edition of GitHub. GitHub Apps can act on behalf of users through user-to-server tokens: when a user authorises an app, the app receives a token that carries the user's identity and the app's installation permissions. Those tokens are meant to be limited to the repositories that the app's installation has been granted access to.
The report describes an incorrect authorization flaw in that model. A user-to-server token issued by a global app could perform certain write operations on public repositories that lay outside the installation's intended scope. The program's summary states that the authorization check only verified that the installation had read permissions on the target repository, rather than verifying that the token's installation had been explicitly granted access to that repository.
The affected asset is api.github.com, and the issue was tracked as CVE-2026-14340.
Setup
The report does not describe the researcher's environment, accounts, tools or test versions. What the program summary establishes as preconditions is:
- A GitHub App installation with a user-to-server token.
- A target public repository that the installation has not been explicitly granted access to, but on which the installation holds read permissions.
- Possession of a victim's user-to-server token, which the summary frames as the attacker's starting point.
All versions of GitHub Enterprise Server prior to 3.22 were affected.
Finding it
The authorization decision for user-to-server tokens did not check whether the token's installation was explicitly granted access to the target repository. Instead, the check stopped at confirming that the installation had read permissions on that repository. Because read permission on a public repository is broadly available, this left a gap between what the token was scoped to and what the server would accept.
The behaviour looked wrong because a user-to-server token is supposed to inherit the installation's repository scope. A token whose installation was never granted access to a repository should not be able to write to it, regardless of whether the installation can read it.
Exploitation
The report does not include the individual HTTP requests, parameters, headers or server responses used during testing. The program summary describes the outcome of the flaw rather than the request sequence, so the steps below reflect what the summary states, without inventing endpoints or payloads.
Step 1: Obtain a victim's user-to-server token
The attacker starts with a user-to-server token belonging to a victim user. The summary treats this as the precondition for the attack and does not describe how such a token would be obtained.
Step 2: Use the token against a public repository outside the installation's scope
The attacker directs the token at a public repository that the token's installation was not explicitly granted access to. The authorization check passes because the installation has read permissions on that repository, even though the installation was never granted access to it.
Step 3: Perform write operations
With the check bypassed, the token can carry out write operations on the target public repository. According to the summary, these are:
- Creating issues.
- Creating issue comments.
- Creating commit comments.
- Creating private vulnerability reports.
Step 4: Observe attribution
The actions appear as the victim user. The summary states there is no indication of the app's involvement, so repository owners and other users see the activity as coming from the token's owner rather than from an app acting outside its scope.
Root cause
The authorization check for user-to-server tokens issued by global apps verified only that the installation had read permissions on the target repository. It did not verify that the token's installation had been explicitly granted access to that repository. Since read permission on a public repository does not imply that an installation was granted access to it, the check was insufficient to enforce the token's intended scope.
The existing defence, the installation's repository scope, was not consulted at the point of the write operation, so it did not stop the request. The summary does not describe any further controls that were in place.
Impact
An attacker holding a victim's user-to-server token could create issues, issue comments, commit comments and private vulnerability reports on any public repository. The activity would be attributed to the victim user, with no indication that an app was involved. This affects the integrity of repository content and the accuracy of attribution: maintainers would see actions from a trusted account rather than from an app operating outside its granted scope.
The program rated the issue medium severity. The summary does not state a bounty amount.
Fix
The vulnerability was fixed by adding a repository scope check for user-to-server tokens issued by global apps. With that check in place, the server verifies that the token's installation was explicitly granted access to the target repository before allowing the write operation.
The fix shipped in GitHub Enterprise Server 3.21.2, 3.20.4, 3.19.8, 3.18.11, 3.17.17 and 3.16.20. All versions prior to 3.22 were affected.
Variants to test
- Test other token types issued by apps, such as installation access tokens, against public repositories outside the installation's scope. A positive result is a successful write operation on a repository the installation was never granted access to.
- Test other write operations beyond the four listed, such as pull request creation or label changes, on out-of-scope public repositories. A positive result is any write that succeeds where the installation lacks explicit access.
- Test the same pattern on private repositories where the installation has read permissions but no explicit grant. A positive result is a write succeeding on a repository outside the installation's scope.
- Test whether the same authorization gap applies to other app types, such as apps installed on a single organisation rather than globally. A positive result is a write on a repository the installation was not granted access to.
- Test whether the attribution behaviour holds across operations, checking whether any audit trail or UI element reveals the app's involvement. A positive result is a write that appears solely as the victim user with no app indication.
Hunting notes
This kind of bug tends to hide in authorization checks that conflate two different questions: whether a principal can read a resource, and whether a principal was granted access to that resource. Public repositories make the distinction easy to miss, because read access is effectively universal, so a check that only tests read permission will pass for almost any installation.
During recon, look for features where tokens or credentials carry a scope that is enforced somewhere other than the write path. Signals include APIs that accept user-to-server tokens, app installation models with repository selection, and any operation that writes to a repository. Comparing behaviour between a repository the installation was granted access to and one it was not is the quickest way to surface the gap.
The summary states that a token could perform concrete write operations, including creating issues, comments and private vulnerability reports, on repositories outside its scope, while appearing as the victim user. That combination of a clear scope violation and a realistic abuse path is what supports acceptance of the report.
What happened, in plain words
GitHub is a website where people store and share code. Large companies often run their own private copy of GitHub inside their own network instead of using the public website. That private copy is called GitHub Enterprise Server, or GHES for short. This report is about a mistake in how GHES decided whether a piece of software was allowed to do something on a repository.
A repository (often shortened to "repo") is a folder of code plus its history, hosted on GitHub. A GitHub App is a piece of software that connects to GitHub, for example a tool that automatically labels new bug reports. When you let such an app act for you, GitHub gives the app a special pass called a user-to-server token. Think of a token as a temporary wristband at an event: it proves who you are and what you are allowed to enter, without you having to show your ID every time. The token carries two things: your identity (so actions look like you did them) and the app's permissions (so the app can only do what it was installed to do).
The bug was that the wristband was checked too loosely. The server only asked "can this app read the repository?" instead of "was this app actually given access to this repository?". On a public repository, almost anyone can read, so the first question is almost always yes. That meant a token could write to public repositories the app had never been granted access to. An attacker who got hold of a victim's token could create issues, comments and private vulnerability reports on any public repository, and everything would look like the victim did it, with no sign that an app was involved.
GitHub rated the issue medium severity and fixed it by adding a proper check that the app was explicitly granted access to the repository. The issue is tracked as CVE-2026-14340. All versions of GitHub Enterprise Server before 3.22 were affected, and it was fixed in versions 3.21.2, 3.20.4, 3.19.8, 3.18.11, 3.17.17 and 3.16.20.
Context
GitHub Enterprise Server (GHES) is the self-hosted edition of GitHub: instead of using github.com, an organisation runs GitHub on its own servers. GitHub Apps are integrations that add features to GitHub. They can act on behalf of users through user-to-server tokens. When a user authorises an app, the app receives a token that carries the user's identity and the app's installation permissions. Those tokens are meant to be limited to the repositories that the app's installation has been granted access to.
An API (Application Programming Interface) is the set of addresses a program uses to talk to a server, like a service counter at a post office: you go to a specific window, hand over a specific form, and get a specific result. The affected asset here is api.github.com, the address where GitHub's API lives.
The report describes an incorrect authorization flaw in that model. "Authorization" means deciding whether someone is allowed to do a particular thing; it is different from "authentication", which is proving who someone is. A user-to-server token issued by a global app could perform certain write operations on public repositories that lay outside the installation's intended scope. The program's summary states that the authorization check only verified that the installation had read permissions on the target repository, rather than verifying that the token's installation had been explicitly granted access to that repository.
The issue was tracked as CVE-2026-14340. A CVE is a public catalogue number given to a known security flaw so people can look it up and track fixes.
Setup
The report does not describe the researcher's environment, accounts, tools or test versions. What the program summary establishes as preconditions is:
- A GitHub App installation with a user-to-server token.
- A target public repository that the installation has not been explicitly granted access to, but on which the installation holds read permissions.
- Possession of a victim's user-to-server token, which the summary frames as the attacker's starting point.
All versions of GitHub Enterprise Server prior to 3.22 were affected.
In plain terms: to reproduce this, you would need an app that has been installed somewhere and has a token, a public repository that the app can read but was never given access to, and a token belonging to some other user. The report treats the last item as a given and does not explain how an attacker would get one.
Finding it
The authorization decision for user-to-server tokens did not check whether the token's installation was explicitly granted access to the target repository. Instead, the check stopped at confirming that the installation had read permissions on that repository. Because read permission on a public repository is broadly available, this left a gap between what the token was scoped to and what the server would accept.
"Scope" here means the boundary of what a token is allowed to touch. A token scoped to one repository should not be able to affect another. The behaviour looked wrong because a user-to-server token is supposed to inherit the installation's repository scope. A token whose installation was never granted access to a repository should not be able to write to it, regardless of whether the installation can read it.
A useful comparison: a library card that lets you read any book in the building should not also let you write notes in the margins of any book. Reading and writing are separate permissions, and being allowed to read does not mean you were given the book.
Exploitation
The report does not include the individual HTTP requests, parameters, headers or server responses used during testing. The program summary describes the outcome of the flaw rather than the request sequence, so the steps below reflect what the summary states, without inventing endpoints or payloads.
An HTTP request is the message a browser or program sends to a server to ask for something. A header is a labelled line inside that message, for example one that carries the token. A parameter is a value attached to the request, such as the title of an issue. A response is what the server sends back.
Step 1: Obtain a victim's user-to-server token
The attacker starts with a user-to-server token belonging to a victim user. The summary treats this as the precondition for the attack and does not describe how such a token would be obtained.
Why this step matters: the token is the attacker's key. Without it, there is nothing to misuse. The report does not say how the token was acquired, so the attack as described begins after that has already happened.
Step 2: Use the token against a public repository outside the installation's scope
The attacker directs the token at a public repository that the token's installation was not explicitly granted access to. The authorization check passes because the installation has read permissions on that repository, even though the installation was never granted access to it.
Why this step matters: this is where the flaw is triggered. The server is asked to accept a token for a repository it should refuse, and it accepts because it only checked the weaker condition (read permission) rather than the stronger one (explicit access).
Step 3: Perform write operations
With the check bypassed, the token can carry out write operations on the target public repository. According to the summary, these are:
- Creating issues.
- Creating issue comments.
- Creating commit comments.
- Creating private vulnerability reports.
An issue is a bug report or task on a repository. A comment is a reply attached to an issue or a commit. A commit is a saved change to the code, and a commit comment is a note attached to one. A private vulnerability report is a way to tell maintainers about a security problem without making it public. All four are write operations: they add content rather than just reading it.
Why this step matters: it shows the flaw has real consequences. The token is not merely able to look at the repository; it can leave marks that other people will see.
Step 4: Observe attribution
The actions appear as the victim user. The summary states there is no indication of the app's involvement, so repository owners and other users see the activity as coming from the token's owner rather than from an app acting outside its scope.
Attribution means who an action is credited to. Why this step matters: it makes the attack harder to notice and harder to trace. If a maintainer sees a new issue from a trusted account, they have no reason to suspect an app was involved.
Root cause
The authorization check for user-to-server tokens issued by global apps verified only that the installation had read permissions on the target repository. It did not verify that the token's installation had been explicitly granted access to that repository. Since read permission on a public repository does not imply that an installation was granted access to it, the check was insufficient to enforce the token's intended scope.
The existing defence, the installation's repository scope, was not consulted at the point of the write operation, so it did not stop the request. The summary does not describe any further controls that were in place.
A comparison: a bouncer who only checks that you are wearing a wristband, and never checks which event the wristband is for, will let you into any party in the building. The wristband exists, and the rule exists, but the check at the door asks the wrong question.
Impact
An attacker holding a victim's user-to-server token could create issues, issue comments, commit comments and private vulnerability reports on any public repository. The activity would be attributed to the victim user, with no indication that an app was involved. This affects the integrity of repository content and the accuracy of attribution: maintainers would see actions from a trusted account rather than from an app operating outside its granted scope.
Integrity, in security terms, means that data has not been changed by someone who should not have changed it. Here, content on repositories could be added by a token that was never meant to touch them, and the record of who did it would point at the wrong party.
The program rated the issue medium severity. The summary does not state a bounty amount.
Fix
The vulnerability was fixed by adding a repository scope check for user-to-server tokens issued by global apps. With that check in place, the server verifies that the token's installation was explicitly granted access to the target repository before allowing the write operation.
In everyday terms: the bouncer now checks not just that you have a wristband, but that your wristband is for this event. The fix shipped in GitHub Enterprise Server 3.21.2, 3.20.4, 3.19.8, 3.18.11, 3.17.17 and 3.16.20. All versions prior to 3.22 were affected.
Variants to test
These are follow-up ideas: other places where the same kind of mistake might appear. A "positive result" means the test found the problem again.
- Test other token types issued by apps, such as installation access tokens, against public repositories outside the installation's scope. A positive result is a successful write operation on a repository the installation was never granted access to.
- Test other write operations beyond the four listed, such as pull request creation or label changes, on out-of-scope public repositories. A positive result is any write that succeeds where the installation lacks explicit access.
- Test the same pattern on private repositories where the installation has read permissions but no explicit grant. A positive result is a write succeeding on a repository outside the installation's scope.
- Test whether the same authorization gap applies to other app types, such as apps installed on a single organisation rather than globally. A positive result is a write on a repository the installation was not granted access to.
- Test whether the attribution behaviour holds across operations, checking whether any audit trail or UI element reveals the app's involvement. A positive result is a write that appears solely as the victim user with no app indication.
An audit trail is a log of who did what and when. A UI element is a piece of the visible interface, such as a label or badge.
Hunting notes
This kind of bug tends to hide in authorization checks that conflate two different questions: whether a principal can read a resource, and whether a principal was granted access to that resource. A principal is simply the actor making a request, here the app acting through the token. Public repositories make the distinction easy to miss, because read access is effectively universal, so a check that only tests read permission will pass for almost any installation.
During recon, look for features where tokens or credentials carry a scope that is enforced somewhere other than the write path. Recon means the exploratory phase of testing, where you map out what a system does before trying to break it. Signals include APIs that accept user-to-server tokens, app installation models with repository selection, and any operation that writes to a repository. Comparing behaviour between a repository the installation was granted access to and one it was not is the quickest way to surface the gap.
The summary states that a token could perform concrete write operations, including creating issues, comments and private vulnerability reports, on repositories outside its scope, while appearing as the victim user. That combination of a clear scope violation and a realistic abuse path is what supports acceptance of the report.
Glossary
- API: the set of addresses and rules a program uses to talk to a server, like a service counter with specific windows and forms.
- Attribution: the record of who performed an action.
- Audit trail: a log of actions taken in a system, used to trace what happened.
- Authentication: proving who you are.
- Authorization: deciding whether an identified party is allowed to do a particular thing.
- Commit: a saved change to the code in a repository.
- Commit comment: a note attached to a commit.
- CVE: a public catalogue number for a known security flaw.
- GitHub App: a piece of software integrated with GitHub that can act on behalf of users, within permissions it has been granted.
- GitHub Enterprise Server (GHES): the self-hosted edition of GitHub, run on an organisation's own servers.
- Global app: an app whose installation is not limited to a single organisation.
- Header: a labelled line in an HTTP message, often carrying a token or other metadata.
- HTTP request: the message a browser or program sends to a server to ask for something.
- Installation: a specific deployment of a GitHub App on an account or organisation, with its own granted permissions and repository access.
- Installation access token: a token issued to an app installation, as opposed to one issued on behalf of a user.
- Integrity: the property that data has not been changed by someone who should not have changed it.
- Issue: a bug report or task recorded on a repository.
- Issue comment: a reply attached to an issue.
- Parameter: a value attached to a request, such as a title or a name.
- Principal: the actor making a request, such as a user or an app.
- Private vulnerability report: a way to report a security problem to maintainers without making it public.
- Public repository: a repository that anyone can read.
- Read permission: the right to view content without changing it.
- Recon: the exploratory phase of security testing, mapping out how a system works.
- Repository (repo): a folder of code plus its history, hosted on GitHub.
- Response: what a server sends back after a request.
- Scope: the boundary of what a token or app is allowed to touch.
- Severity: a rating of how serious a flaw is, here medium.
- Token: a temporary credential that proves identity and permissions, like a wristband at an event.
- UI element: a visible part of a user interface, such as a label or badge.
- User-to-server token: a token an app receives when a user authorises it, carrying the user's identity and the app's permissions.
- Write operation: an action that adds or changes content, as opposed to only reading it.