Arbitrary Read of Another Users private repository without Authorization
An improper access control flaw in GitHub Enterprise Server let any user with access to a repository retrieve limited code from another private repository by creating a diff between them. An attacker needed to know the private repository's name and its branches, tags, or commit SHAs to trigger the compare/diff functionality and read code without authorisation.
- Triaged in 3 months
- Fixed in 4 months
- Paid in 4 months
- Disclosed after 5 months
Summary by the program
An improper access control vulnerability was identified in GitHub Enterprise Server that allowed users with access to any repository to retrieve limited code content from another repository by creating a diff between the repositories. To exploit this vulnerability, an attacker needed to know the name of a private repository along with its branches, tags, or commit SHAs that they could use to trigger compare/diff functionality and retrieve limited code without proper authorization. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.18, and was fixed in versions 3.14.17, 3.15.12, 3.16.8 and 3.17.5.
What the report shows
The target is GitHub Enterprise Server. The feature at the centre of the report is the compare/diff functionality, which lets a user build a diff between two repositories. The weakness is classified as an insecure direct object reference: the server accepts a repository reference from the request and returns content for it without checking that the caller is allowed to read that repository.
The program's summary describes the flow as follows:
- The attacker has access to at least one repository on the instance. Any repository is enough; the attacker does not need to be a member of the target repository.
- The attacker learns the name of a private repository, plus one of its branches, tags or commit SHAs.
- The attacker uses those values to trigger the compare/diff functionality between a repository they can access and the private one.
- The instance returns limited code content from the private repository, even though the attacker has no authorisation to read it.
The report does not include the individual HTTP requests, parameters or responses used to demonstrate the issue. What it does state is that the amount of code retrieved is limited, and that the attack depends on knowing the private repository's name together with a branch, tag or commit SHA. Those two constraints shape the impact: this is not a way to browse an unknown private repository, but a way to pull fragments of code out of one whose identifiers the attacker already holds.
The vulnerability affected all versions of GitHub Enterprise Server prior to 3.18. It was fixed in versions 3.14.17, 3.15.12, 3.16.8 and 3.17.5, and tracked as CVE-2025-8447.
Root cause
The report does not describe the internal cause; the weakness is classified as an insecure direct object reference. In other words, the object reference (the repository identifier, branch, tag or SHA) is trusted as an input rather than validated against the caller's access rights.
This is the classic IDOR shape: a resource identifier travels in the request, the handler resolves it directly, and the authorisation decision is made somewhere else, or only for part of the operation.
Impact
An authenticated user with access to any repository on the instance could read limited code content from a private repository they were not authorised to see, provided they already knew its name and a branch, tag or commit SHA. The confidentiality impact is real but bounded: the report describes the disclosure as limited code content obtained through a diff, not full repository access. The precondition of knowing repository identifiers reduces the exposure to attackers who have some prior knowledge of the target, for example from a leaked name, a fork, a CI reference or an insider.
How this kind of bug works
IDOR arises when an application exposes a direct reference to an internal object (a numeric ID, a UUID, a repository name, a file path, a commit SHA) and uses that reference to fetch the object without confirming that the current principal may access it. The check is either missing entirely, applied to the wrong object, or applied to only one of several objects involved in a composite operation.
Compare and diff features are a common home for this pattern because they are inherently multi-object: they take a base and a head, resolve both, and merge their contents. Developers often reason about access to the base (the repository the user is working in) and forget the head, or vice versa. The same applies to features such as pull request creation across forks, commit patch views, blame, raw file endpoints, archive downloads and search.
Defences are straightforward in principle: every object reference resolved from a request must be checked against the caller's permissions on that specific object, at the point of use, not only at the entry point of the request. Centralising authorisation in a policy layer that all handlers call, and testing it with negative cases (a user who can see A but not B), is what prevents regressions.
How to test for it
A general method for hunting this class:
- Map features that accept two or more object references: compare, diff, merge preview, cross-repository pull requests, patch and raw views, archive export, search scoped to a repository, webhook or integration configuration that names a repository.
- Create two accounts and two repositories: one you own (A) and one you do not have access to (B). Where possible, use a second account to create B so you know its name, branches and a commit SHA.
- As the account that can see only A, send the feature request with A as the base and B as the head, then swap them. Try B's name, a branch name, a tag and a commit SHA in each position.
- Compare responses: status code, body length, and whether any content from B appears. A positive result is any fragment of B's code, file names or commit metadata returned to an account with no permission on B.
- Repeat with B made private, then with B's visibility changed, to confirm the behaviour depends on authorisation and not on caching.
Common false positives: content that is genuinely public; data returned from a cache keyed only by URL; error messages that echo the repository name but no content; and responses that differ only because of rate limiting or feature flags. Confirm that the leaked bytes actually originate in B and could not have been guessed.
How it is fixed
The vulnerability was fixed in versions 3.14.17, 3.15.12, 3.16.8 and 3.17.5; the report does not describe the fix. Concretely: resolve each reference, look up the caller's permission on that repository, and reject the request if any reference fails.
Hunting notes
This class tends to hide in composite features: anything that takes two identifiers, anything that aggregates across repositories, and anything that renders content from a repository the user is not currently viewing. Recon signals include endpoints whose parameters look like repository names, owner/name pairs, branch names or SHAs, and features that accept a base and head. GraphQL APIs are worth attention because nested resolvers can each resolve an object without repeating the parent's authorisation check.
To get a report accepted, demonstrate the leak with two controlled accounts, show that the second account has no access to the target repository, and quote the exact bytes returned that could only have come from it. State the preconditions honestly (knowledge of the repository name and a ref), because programs weigh impact against those preconditions when triaging.
What happened, in plain words
GitHub Enterprise Server is a version of GitHub that a company runs on its own servers. One of its features is the compare/diff view: it shows what changed between two repositories, or between two points in a repository, by lining up the old and new versions side by side. A diff is simply a list of added and removed lines, like the tracked changes in a word processor.
The report describes an access control bug in that feature. Access control means deciding who is allowed to see or do what. As a result, a user who could see any repository on the instance could pull limited code content out of a private repository they had no right to read, by asking for a diff between their own repository and the private one.
The weakness is classified as an insecure direct object reference, or IDOR. An object is any item the server stores and can look up, such as a repository, a file or a commit. A reference is the name or number used to point at that object, like a house number. IDOR means the server takes the reference from the request and hands back the object without checking whether the caller is allowed to have it. It is like a hotel reception giving out a room key to anyone who knows the room number, without checking the guest list.
The program's summary lays out the attack in four steps:
- The attacker has access to at least one repository on the instance. Any repository will do; they do not need to be a member of the target repository.
- The attacker learns the name of a private repository, plus one of its branches, tags or commit SHAs. A branch is a named line of development, such as
main. A tag is a label attached to a particular point in history, often a release. A commit SHA is a long string of letters and numbers that uniquely identifies one saved change. - The attacker uses those values to trigger the compare/diff functionality between a repository they can access and the private one.
- The instance returns limited code content from the private repository, even though the attacker has no authorisation to read it.
The report does not include the individual HTTP requests, parameters or responses used to demonstrate the issue. What it does state is that the amount of code retrieved is limited, and that the attack depends on knowing the private repository's name together with a branch, tag or commit SHA. Those two constraints shape the impact: this is not a way to browse an unknown private repository, but a way to pull fragments of code out of one whose identifiers the attacker already holds. Someone might know those identifiers from a leaked name, a fork, a continuous integration reference or from working inside the company.
The vulnerability affected all versions of GitHub Enterprise Server prior to 3.18. It was fixed in versions 3.14.17, 3.15.12, 3.16.8 and 3.17.5, and tracked as CVE-2025-8447. A CVE is a public catalogue entry that gives a security flaw a fixed identifier so people can talk about it and track fixes. A bug bounty is a programme where companies pay researchers for reporting flaws responsibly instead of exploiting them.
In general, how this kind of bug works
IDOR arises when an application exposes a direct reference to an internal object (a numeric ID, a UUID, a repository name, a file path, a commit SHA) and uses that reference to fetch the object without confirming that the current principal may access it. The principal is whoever is making the request, identified by their login or session. The check is either missing entirely, applied to the wrong object, or applied to only one of several objects involved in a composite operation.
Compare and diff features are a common home for this pattern because they are inherently multi-object: they take a base and a head, resolve both, and merge their contents. Developers often reason about access to the base (the repository the user is working in) and forget the head, or vice versa. The same applies to features such as pull request creation across forks, commit patch views, blame, raw file endpoints, archive downloads and search.
Defences are straightforward in principle: every object reference resolved from a request must be checked against the caller's permissions on that specific object, at the point of use, not only at the entry point of the request. Centralising authorisation in a policy layer that all handlers call, and testing it with negative cases (a user who can see A but not B), is what prevents regressions.
A general method for hunting this class:
- Map features that accept two or more object references: compare, diff, merge preview, cross-repository pull requests, patch and raw views, archive export, search scoped to a repository, webhook or integration configuration that names a repository.
- Create two accounts and two repositories: one you own (A) and one you do not have access to (B). Where possible, use a second account to create B so you know its name, branches and a commit SHA.
- As the account that can see only A, send the feature request with A as the base and B as the head, then swap them. Try B's name, a branch name, a tag and a commit SHA in each position.
- Compare responses: status code, body length, and whether any content from B appears. A positive result is any fragment of B's code, file names or commit metadata returned to an account with no permission on B.
- Repeat with B made private, then with B's visibility changed, to confirm the behaviour depends on authorisation and not on caching.
Common false positives: content that is genuinely public; data returned from a cache keyed only by URL; error messages that echo the repository name but no content; and responses that differ only because of rate limiting or feature flags. Confirm that the leaked bytes actually originate in B and could not have been guessed.
The vulnerability was fixed in versions 3.14.17, 3.15.12, 3.16.8 and 3.17.5; the report does not describe the fix. Concretely: resolve each reference, look up the caller's permission on that repository, and reject the request if any reference fails.
This class tends to hide in composite features: anything that takes two identifiers, anything that aggregates across repositories, and anything that renders content from a repository the user is not currently viewing. Recon signals include endpoints whose parameters look like repository names, owner/name pairs, branch names or SHAs, and features that accept a base and head. GraphQL APIs are worth attention because nested resolvers can each resolve an object without repeating the parent's authorisation check.
To get a report accepted, demonstrate the leak with two controlled accounts, show that the second account has no access to the target repository, and quote the exact bytes returned that could only have come from it. State the preconditions honestly (knowledge of the repository name and a ref), because programs weigh impact against those preconditions when triaging.
Glossary
- GitHub Enterprise Server: a self-hosted edition of GitHub that a company runs on its own infrastructure.
- Repository: a project's collection of files and their history.
- Private repository: a repository visible only to people who have been granted access.
- Diff: a side-by-side or line-by-line comparison showing what was added, removed or changed between two versions of content.
- Compare/diff functionality: the feature that builds a diff between two repositories or two points in history.
- Access control: the rules that decide who may see or do what.
- Authorisation: the act of checking whether a given user is permitted to perform an action or read an object.
- Authentication: proving who you are, usually by logging in.
- IDOR (insecure direct object reference): a flaw where an object is fetched using an identifier from the request without checking the caller's permission on that object.
- Object: any stored item the server can look up, such as a repository, file or commit.
- Reference: the name, number or string used to point at an object.
- Branch: a named line of development in a repository, such as
main. - Tag: a label attached to a specific point in a repository's history, often marking a release.
- Commit: a saved snapshot of changes in a repository.
- Commit SHA: a long string of letters and numbers that uniquely identifies a commit.
- Base and head: the two sides of a comparison; the base is the starting point and the head is the ending point.
- Endpoint: a specific address on a server that accepts requests for a particular operation.
- Request: a message a browser or tool sends to a server asking it to do something.
- Response: the server's reply to a request, including a status code and a body.
- Status code: a number in a response indicating the outcome, such as 200 for success or 403 for forbidden.
- Parameter: a named value sent with a request, such as a repository name or branch.
- Session: a period during which the server remembers who you are, usually via a cookie.
- Cookie: a small piece of data the browser stores and sends back to the server to identify the session.
- Token: a string used in place of a password to prove identity or grant access.
- Principal: the identity making a request, such as a user account.
- CVE: a public catalogue entry giving a security flaw a fixed identifier.
- Severity: a rating of how serious a flaw is, often high, medium or low.
- Bug bounty: a programme that pays researchers for responsibly reporting security flaws.
- Bounty: the payment made for an accepted report.
- False positive: a finding that looks like a flaw but is not, because the behaviour is legitimate.
- Cache: a store of previously computed responses that can be served again quickly.
- Rate limiting: a control that restricts how many requests can be made in a period.
- Feature flag: a switch that turns a feature on or off for certain users or environments.
- GraphQL: a query language for APIs in which clients ask for specific fields and nested objects.
- Resolver: the function in a GraphQL server that fetches the data for a field.
- Regression test: a test that checks a fixed bug stays fixed.
- Recon: the information-gathering phase of security testing.