News for hackers. Stuff that matters.
Re:Hidden GitHub Commits and How to Reveal Them by funyug on Friday February 23, 2024 @02:38PM (#39485147)
Is this an issue with git or github only? If this is an issue with github only, i won't use it anymore for personal projects
Re:Hidden GitHub Commits and How to Reveal Them by kevincox on Friday February 23, 2024 @03:21PM (#39485600)
Mostly a Git issue. In general Git won't remove old data pushed to remotes. Maybe if they run a garbage collection.

However GitHub does exacerbate it a little by providing APIs that list commits that are no longer in the history. However there are other ways to get this info such as brute-forcing short prefixes of commits.

But really this is another case of the general problem that once you publish information you can't unpublish it. If you push a secret to a repo you can't 100% reliably clean it up. You should assume that everyone with the repo took a copy.

Re:Hidden GitHub Commits and How to Reveal Them by Denvercoder9 on Friday February 23, 2024 @02:57PM (#39485345)
It's not really an issue, it's just that the assumption that removing a commit from the history actually deletes it is not correct. That holds for both Git and GitHub, and probably most other Git hosts.

Also in general, don't assume that you can remove anything from the internet once it has been published.

Re:Hidden GitHub Commits and How to Reveal Them by IshKebab on Friday February 23, 2024 @05:21PM (#39486899)
It is an issue. It means there's no way to actually delete commits from a GitHub repo.

And it is a GitHub issue. If you were self-hosting you could just run `git prune` `git gc` or `git repack` or whatever the magic command is.

Re:Hidden GitHub Commits and How to Reveal Them by biftek on Friday February 23, 2024 @05:45PM (#39487117)
If your remote is publicly accessible (GitHub or not) anyone could have cloned it while the sensitive data was there and no magic command will make that go away
Re:Hidden GitHub Commits and How to Reveal Them by vinay427 on Friday February 23, 2024 @08:42PM (#39488369)
Right, but it’s not uncommon for a repo to be private with sensitive data that is identified and “removed” (using something like bfg or git-filter-branch) before being made public.

Naturally, if it’s a key or something else revocable those extra precautions should be taken regardless of using these tools, but that isn’t an option for some types of data and this implies that users have no systematic recourse.

Re:Hidden GitHub Commits and How to Reveal Them by IshKebab on Saturday February 24, 2024 @06:18AM (#39490758)
This is a classic binary security fallacy. It's like saying "there's no point having a lock on your front door because you occasionally leave it open and then anyone could walk in!".

You know you are arguing that it should be impossible to delete things from a website right?

Re:Hidden GitHub Commits and How to Reveal Them by riedel on Friday February 23, 2024 @08:44PM (#39488379)
Git can potentially clean dangling commits `git gc --aggressive --prune=now` . Gitlab offers this as part of housekeeping. However, be aware: this garbage collection does not work if you e.g. reference a commit in an issue. (Like creating an incident that references the offending commit)