Skip to content
Business logic Disclosed report Intermediate

Import of repositories from GitHub is tied to username instead of immutable ID

GitHub account verification on Liberapay stores a mutable username instead of an immutable user ID. An attacker can verify a GitHub account, rename it, and later import repositories from whoever claims the old username, enabling impersonation.

emitrani Follow

Originally disclosed on HackerOne

  • Triaged in 14 hours
  • Fixed in 40 hours
  • Disclosed after 3 days

When a user verifies a Github account at /edit/elsewhere the final result is a Github username tied to a Liberapay account. The issue is Github usernames are mutable.

Consider the scenario.

  1. I create an account called ed-liberapay (something likely to be claimed in the future)
  2. Verify that I own that Github account on liberapay.com/edit/elsewhere
  3. I go to my Github and update my username (this doesn't change anything on liberapay.com and Github won't redirect old links to the account to the new location)
  4. Eventually that account is claimed by Ed and he creates impressive repos.
  5. I go and import the repos into my account and pretend to own it.

Impact

This can enable impersonation.

I suspect the issue is caused in this function:

https://github.com/liberapay/liberapay.com/blob/master/liberapay/elsewhere/_base.py#L266

I haven't set up my own instance to see if GitHub is indeed going through the username path but in practice I was able to set up 2 accounts as described. Change the name of the attacker to something else and then import a different account's repos as my own.

The original report as published on HackerOne, by emitrani. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 the verification stores the GitHub username rather than the immutable numeric user ID, so a later username change or reassignment causes the wrong account to be associated.

Impact

This could enable impersonation by making it appear that another person's repositories belong to the attacker.

What the attacker needed

A Liberapay account; a GitHub account; victim later claims the old username

How it was found

  1. Create a Liberapay account with a GitHub username likely to be claimed later.
  2. Verify ownership of that GitHub account on the Liberapay elsewhere page.
  3. Change the GitHub username so the old name becomes available.
  4. Wait for another person to claim the old username and create repositories.
  5. Import those repositories into the attacker's Liberapay 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 report has not been written yet. The Original tab links to the source.

When you link a GitHub account to another service, that service usually remembers your GitHub username. But GitHub lets you change your username at any time, and the old name becomes free for anyone else to take. If the service only remembers the name, it can later mistake a different person for you.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by emitrani

View all

6 more disclosed reports, best first.

More from Liberapay

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.