Live data from Hacker News

Anyone can access deleted and private repository data on GitHub

trufflesecurity.com

261–270 of 394 posts

Re: Anyone can access deleted and private repository data on GitHub

#261
There's quite a long list of "open core" companies whose models are, start from a private repository (i.e. company is in stealth), make a private fork that will include for-profit code with enterprise features, make the original repository public so that the core will be open-source.

That GitHub is telling these companies, and bear in mind that these companies are paying customers of GitHub, yeah we don't care that your private proprietary code can be hacked off GitHub by anybody, is incredibly disturbing. Is there really not enough pressure from paying customers to fix this? Is Microsoft just too big to care?

Re: Anyone can access deleted and private repository data on GitHub

#262

Earlier quoted context omitted.

Yep, I see GitHub as "public only" hosting, and if I want to host something private, I will choose another vendor.

The noted issue looks to be applicable to forks only, not to all private repos.

Github’s attitude and perception of the terms “privacy” and “security” - it is more important.

Re: Anyone can access deleted and private repository data on GitHub

#263

Earlier quoted context omitted.

If you published a key, you must assume someone copied it and that deleting references to it is not sufficient. You must rotate that key now, and should check whether it was used improperly. This is pretty basic incident response. The thing about exposing commits that were only ever in a private repo is pretty indefensible, but not garbage collecting public commits on delete shouldn't matter.

> If you published a key Why would anyone think that a private fork is "published"!? This is the footgun here: The UI is telling you that nobody can see the secrets you committed to your private copy , but actually it is widely accessible. A similar example of UI-vs-reality mismatch that I've noticed recently is the Azure Store Account "public" visibility. By default, it uses your authenticated account for RBAC acces…

> Why would anyone think that a private fork is "published"!?

Anyone who put sensitive content in a git repo should consider published anyway. Git is a decentralized tool, as a company you cannot control the amount of git remotes that may host your code. Considering your code is only hosted as a private repo in a specific remote git server is at best naive. This is without even considering the amount of copies that are stored in dev computers.

Besides, anyone who put stuff on a third party publicly accessible infrastructure should consider it published anyway as breaches happen all the time.

If you happen to have api keys stored in a git repo, the only viable response is rotating those keys.

Re: Anyone can access deleted and private repository data on GitHub

#264
post #80

The biggest gotcha here is probably that if you start of with a private repo and a private fork, making the repo public also makes the fork "public". GitHub may very well say that this is working as intended, but if it truly is then you should be forced to make both the repo and fork public at the same time. Essentially "Making repo R public will make the following forks public as well 'My Fork', 'Super secret fork',…

Any time you make a private repo public it’s best to just copy that code into a new public repo and leave the private repo private. Otherwise have to audit every previous commit and every commit on every fork of your private code.

Yeah that's fine but the issue is GitHub doesn't make it clear that you need to do this.

Re: Anyone can access deleted and private repository data on GitHub

#266
post #50

Earlier quoted context omitted.

Yep, I see GitHub as "public only" hosting, and if I want to host something private, I will choose another vendor.

Which vendors work best for private projects?

gitea works well. Use that on your own network.

Re: Anyone can access deleted and private repository data on GitHub

#267
post #65

Earlier quoted context omitted.

> I'll be calling "private" repos "unlisted" The same for “deleted” repos.

"deleted" is just a fancy word "inaccessible to the user"

No, deleted is a word for deleted. But we started saying things were "deleted", while our eyes flicked to the stack of backup tapes in the corner, acknowledging the white lie, because really deleting things conflicted with other priorities and was hard. And we left it there, until privacy regulations came along and it turned out not using the normal definition of deleted could get you sued. So IMO Github is wide open to paying damages to the first person able to demonstrate them.

Re: Anyone can access deleted and private repository data on GitHub

#268
This behaviour is also important for ergonomic submodules. The .gitmodules file lists the upstream repo as the origin. So, if you're modifying an upstream project in a submodule and push changes to a fork, it's important that the SHA that git tracks is still reachable through the upstream link.

Ultimately I don't think it's feasible to break this behaviour and the most we can hope for is a big red warning when something counterintuitive happens.

Re: Anyone can access deleted and private repository data on GitHub

#269
I actually think this is a good thing and should simply be made more clear. The reason is the following from the article:

> I submitted a P1 vulnerability to a major tech company showing they accidentally committed a private key ... They immediately deleted the repository,

That is a ridiculous response to a compromised key. The repository should not have been "deleted", the key should have been revoked.

Imagine if you lost a bag with 100 keys to your house. Upon realising you desperately try to search for the bag only to find it's been opened and the keys spread around. You comb through the grass and forests nearby collecting keys and hoping you find them all.

Or you just change the locks and forget about it.

If you upload something, anything, to a computer system you do not own you need to consider it no longer secret. It's as simple as that. Don't like it? Don't do it.

I detest things like delete buttons in messaging apps and, even worse, email recall in Outhouse-style email apps. They just give people a false sense of security. I've been accidentally sent someone's password several times on Teams. Yeah you deleted the message, but my memory is very good and, trust me, I still know your password.

If there's a security problem here it's in people believing you can delete stuff from someone else's system, or that that systems make it look like you can. The solution is the same though: education. Don't blame GitHub. Don't force them to "fix" this. That will only make it worse because there are still a million other places people will upload stuff and also won't actually delete stuff.

Re: Anyone can access deleted and private repository data on GitHub

#270
People should realize that once you upload something, it will be out there, forever. I assume this happens to everything.

Trusting some company will actually delete your stuff is kind of naive in my opinion.

The example of people forking and putting an API key in the repo, I would never let my people do this. Once you push, it will be "out there".

Post reply on HN