Accessible Deleted Data in Github

Support HackTricks

This ways to access data from Github that was supposedly deleted was reported in this blog post.

Accessing Deleted Fork Data

  1. You fork a public repository

  2. You commit code to your fork

  3. You delete your fork

The data commited in the deleted fork is still accessible.

Accessing Deleted Repo Data

  1. You have a public repo on GitHub.

  2. A user forks your repo.

  3. You commit data after they fork it (and they never sync their fork with your updates).

  4. You delete the entire repo.

Even if you deleted your repo, all the changes made to it are still accessible through the forks.

Accessing Private Repo Data

  1. You create a private repo that will eventually be made public.

  2. You create a private, internal version of that repo (via forking) and commit additional code for features that you’re not going to make public.

  3. You make your “upstream” repository public and keep your fork private.

It's possible to access al the data pushed to the internal fork in the time between the internal fork was created and the public version was made public.

How to discover commits from deleted/hidden forks

The same blog post propose 2 options:

Directly accessing the commit

If the commit ID (sha-1) value is known it's possible to access it in https://github.com/<user/org>/<repo>/commit/<commit_hash>

Brute-forcing short SHA-1 values

It's the same to access both of these:

And the latest one use a short sha-1 that is bruteforceable.

References

Support HackTricks

Last updated