How I Hacked Your Private Repository In Github And Got Jackshit
The installation_id parameter in GitHub App setup callbacks is a sequential, guessable identifier shared across all installations. An attacker who sends a setup request with a guessed installation_id before the legitimate user can associate the integration with their own account, gaining access to the victim's private repositories.
Reuvein Vinokurov - https Follow
Published on infosecwriteups.com
After reporting this security vulnerability to GitHub, I got back a statement that it is an “intentional design decision”.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the third-party app trusts the installation_id from the callback without verifying that the user completing the setup is the same user who initiated the installation, and the identifier is sequential and guessable.
Impact
An attacker could gain control over the victim's private repositories based on the permissions of the integrated app, though GitHub classified the behaviour as an intentional design decision and not a vulnerability.
What the attacker needed
Attacker can send requests to the third-party app; attacker guesses the victim's installation_id; attacker's request arrives before the victim's
The fix
Third-party apps should verify that the user completing the setup is the same user who initiated the installation, for example by binding a state or session to the installation_id.
How it was found
- Start the GitHub App installation flow from the third-party app.
- Select repositories and click install, then observe the redirect to the app's callback with installation_id.
- Note that installation_id values are sequential and shared across all GitHub installations.
- Continuously send setup completion requests with guessed installation_id values to the third-party app.
- If the attacker's request is accepted before the legitimate user's, the integration is associated with the attacker's account.
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 write-up has not been written yet. The Original tab links to the source.
When you install a third-party app on GitHub, GitHub sends you back to the app's website with a number called installation_id. That number goes up by one for every installation on GitHub, so anyone can guess the next ones. If an attacker guesses your number and tells the app first, the app thinks the attacker installed it and gives them access to your repositories.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.