GitHub scoped user to server tokens can escape their installation
An improper authorization flaw in GitHub Enterprise Server allowed an authenticated attacker with a scoped user-to-server token to access private repositories outside the intended installation scope, including write operations. The issue arose from an authorization fallback that treated a revoked or deleted installation as a global installation context, and could be chained with token revocation timing and SSH push attribution to obtain and reuse a victim-scoped token.
- Triaged in 6 hours
- Fixed in 4 months
- Paid in 4 months
- Disclosed after 4 months
Summary by the program
An improper authorization vulnerability in scoped user-to-server (ghu_) token authorization in GitHub Enterprise Server allows an authenticated attacker to access private repositories outside the intended installation scope, which can include write operations, via an authorization fallback that treated a revoked/deleted installation as a global installation context, which could be chained with token revocation timing and SSH push attribution to obtain and reuse a victim-scoped token. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.21 and was fixed in versions 3.20.1, 3.19.5, 3.18.8, 3.17.14, 3.16.17, 3.15.21, and 3.14.26.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an authorization fallback that treated a revoked or deleted installation as a global installation context, failing to properly restrict the token's scope.
Impact
An authenticated attacker could access private repositories outside the intended installation scope, potentially including write operations, and could chain the flaw with token revocation timing and SSH push attribution to obtain and reuse a victim-scoped token.
What the attacker needed
Authenticated attacker; scoped user-to-server token; GitHub Enterprise Server before 3.21
The fix
The vulnerability was fixed in versions 3.20.1, 3.19.5, 3.18.8, 3.17.14, 3.16.17, 3.15.21, and 3.14.26.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
GitHub Enterprise Server lets apps act on a user's behalf using special tokens. A bug meant that if an app's installation was removed, the system still treated the token as having broad access, so an attacker could reach private code they should not see or change. The flaw was fixed in later versions.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.