News for hackers. Stuff that matters.
Re:Anyone can access deleted and private repository data on ... by andersa on Wednesday July 24, 2024 @03:03PM (#41060617)
I reported this on their HackerOne many years ago (2018 it seems) and they said it was working as intended. Conclusion: don't use private forks. Copy the repository instead.

Here is their full response from back then:

> Thanks for the submission! We have reviewed your report and validated your findings. After internally assessing the finding we have determined it is a known low risk issue. We may make this functionality more strict in the future, but don't have anything to announce now. As a result, this is not eligible for reward under the Bug Bounty program.

> GitHub stores the parent repository along with forks in a "repository network". It is a known behavior that objects from one network member are readable via other network members. Blobs and commits are stored together, while refs are stored separately for each fork. This shared storage model is what allows for pull requests between members of the same network. When a repository's visibility changes (Eg. public->private) we remove it from the network to prevent private commits/blobs from being readable via another network member.

Re:Anyone can access deleted and private repository data on ... by tedivm on Wednesday July 24, 2024 @03:10PM (#41060699)
I reported a different security issue to github, and they responded the same (although they ultimately ended up fixing it when I told them I was going to blog about the "intended behavior").
Re:Anyone can access deleted and private repository data on ... by myfonj on Wednesday July 24, 2024 @04:04PM (#41061387)
What "intended behaviour" was that, specifically?
Re:Anyone can access deleted and private repository data on ... by _heimdall on Wednesday July 24, 2024 @07:52PM (#41063452)
Did you end up getting a bug bounty out of it?
Re:Anyone can access deleted and private repository data on ... by liendolucas on Wednesday July 24, 2024 @03:27PM (#41060894)
Honest question. Submitting these types of bugs only to get a: "we have determined it is known low risk issue..." seems like they really don't want to pay for someone else's time and dedication in making their product safer. If they knew about this, was this disclosed somewhere? If not I don't see them playing a fair game. What's the motivation to do this if in the end they can have the final decision to award you or not? To me it looks like similar to what happens with Google Play/Apple store to decide whether or not an app can be uploaded/distributed through them.

Edit: I popped this up because to me is absolutely miserable from a big company to just say: "Thanks, but we were aware of this".

Re:Anyone can access deleted and private repository data on ... by jonahx on Wednesday July 24, 2024 @03:38PM (#41061025)
Not defending GH here (their position is indefensible imo) but, as the article notes, they document these behaviors clearly and publicly:

https://docs.github.com/en/pull-requests/collaborating-with-...

I don't think they're being underhanded exactly... they're just making a terrible decision. Quoting from the article:

> The average user views the separation of private and public repositories as a security boundary, and understandably believes that any data located in a private repository cannot be accessed by public users. Unfortunately, as we documented above, that is not always true. Whatsmore, the act of deletion implies the destruction of data. As we saw above, deleting a repository or fork does not mean your commit data is actually deleted.

Re:Anyone can access deleted and private repository data on ... by andersa on Wednesday July 24, 2024 @03:52PM (#41061226)
Based on some (admittedly not very thorough) search, this documentation was posted in 2021, three years after my report.
Re:Anyone can access deleted and private repository data on ... by YetAnotherNick on Wednesday July 24, 2024 @04:42PM (#41061832)
But that would still means they didn't intend to fix it, hence not giving bounty is fair.
Re:Anyone can access deleted and private repository data on ... by malfist on Wednesday July 24, 2024 @05:02PM (#41062076)
It's a bug bounty, not a "only if we have time to fix it" bounty.

He found a security problem, they decided not to act on it, but it was still an acknowledged security problem

Re:Anyone can access deleted and private repository data on ... by coldtea on Wednesday July 24, 2024 @06:03PM (#41062683)
>It's a bug bounty, not a "only if we have time to fix it" bounty

It's only a bug if it's not intended

Re:Anyone can access deleted and private repository data on ... by ethbr1 on Wednesday July 24, 2024 @08:32PM (#41063651)
Do some companies intend for their platform to feature remote code execution?
Re:Anyone can access deleted and private repository data on ... by jen20 on Wednesday July 24, 2024 @09:33PM (#41063957)
Remote code execution is literally a feature of GitHub…
Re:Anyone can access deleted and private repository data on ... by ethbr1 on Wednesday July 24, 2024 @11:29PM (#41064465)
Sandboxed code execution is a bit different than RCE.
Re:Anyone can access deleted and private repository data on ... by coldtea on Thursday July 25, 2024 @07:26AM (#41067277)
Some might very well do. E.g. a company with a service for training hackers and security researchers.

In this case the question is moot, as this doesn't involve remote code execution.

Re:Anyone can access deleted and private repository data on ... by ethbr1 on Thursday July 25, 2024 @01:59PM (#41071466)
Make a general point, get a general answer.

If the criteria for bug is "not intended", and that's solely judged by the company, then broken auth et al. suddenly become part of their product design.

If it quacks like a bug, it's a bug.

Re:Anyone can access deleted and private repository data on ... by bmitc on Thursday July 25, 2024 @02:07AM (#41065208)
I think a lot of developers and companies interpret "that's the way the code or process works" as intentional behavior, which is not always the case.
Re:Anyone can access deleted and private repository data on ... by madeofpalk on Wednesday July 24, 2024 @05:21PM (#41062286)
The point of a bug bounty is for companies to find new security problems.

If the (class of) problem is already known, it’s not worth rewarding.

Re:Anyone can access deleted and private repository data on ... by berdario on Wednesday July 24, 2024 @05:37PM (#41062434)
I can see this argument making a bit of sense, but if they documented this 3 years after the issue was reported, they don't have a way to demonstrate that they truly already knew.

At the end it boils down to: is Github being honest and fair in answering the bug bounty reports?

If you think it is, cool.

If you don't, maybe it's not worth playing ball with Github's bug bounty process

Re:Anyone can access deleted and private repository data on ... by tptacek on Wednesday July 24, 2024 @05:44PM (#41062498)
It doesn't matter if they knew. If they don't deem it a security vulnerability --- and they have put their money where their mouth is, by documenting it as part of the platform behavior --- it's not eligible for a payout. It can be a bug, but if it's not the kind of bug the bounty program is designed to address, it's not getting paid out. The incentives you create by paying for every random non-vulnerability are really bad.

The subtext of this thread is that companies should reward any research that turns up surprising or user-hostile behavior in products. It's good to want things. But that is not the point of a security bug bounty.

Re:Anyone can access deleted and private repository data on ... by lolinder on Wednesday July 24, 2024 @07:27PM (#41063300)
> The incentives you create by paying for every random non-vulnerability are really bad.

So much this. It's pretty clear that most people commenting on this thread have never been involved in a bug bounty program on the company's side.

Bug bounty programs get a lot of reports, most of which are frankly useless and many of which are cases of intended behavior subjectively perceived as problematic. Sifting through that mess is a lot of work, and if you regularly pay out on unhelpful reports you end up with many more unhelpful reports.

This particular case definitely feels like one where the intended behavior is horribly broken, but there are absolutely many cases where "this is intended" is the only valid answer to a report.

Re:Anyone can access deleted and private repository data on ... by cycomanic on Wednesday July 24, 2024 @06:42PM (#41062985)
I would argue that even if the behaviour was as intended, at least the fact that it was not documented was a bug (and a pretty serious one at that).
Re:Anyone can access deleted and private repository data on ... by tptacek on Wednesday July 24, 2024 @07:20PM (#41063236)
Again: you don't generally get bounties for finding "bugs"; you get them exclusively for finding qualified vulnerabilities.
Re:Anyone can access deleted and private repository data on ... by berdario on Thursday July 25, 2024 @08:01AM (#41067589)
That's true, but what's stopping a company from documenting a security issue as a known (mis)behaviour/bug? [*]

Companies can join/setup a bug bounty program, and just use it as a fig leaf for pretending to care about their own product/service's security.

Of course bug bounties can and are abused daily by people who report trivial non-issues in the hope of compensation

But in the same way, companies can also be bad actors in the way that they engage with bounties. I would usually expect big names (like Google, Apple, Github, etc.) to be trustworthy...

[*] Of course what stops companies is precisely them not being seen as trustworthy actors in the bug bounty system anymore... And for now, that's a decision that individuals have to make themselves

Re:Anyone can access deleted and private repository data on ... by tptacek on Thursday July 25, 2024 @10:05AM (#41068833)
No large company cares even a tiny bit about the money they're spending on bug bounties. They would literally lose money trying to cheat, because it would cost them more in labor to argue with people than to pay out. In reality, the bounty teams at Google and Apple are incentivized to maximize payouts, not minimize them.

If you don't trust the company running a bounty, don't participate. There are more lucrative ways to put vulnerability research skill to use.

Re:Anyone can access deleted and private repository data on ... by andrewinardeer on Wednesday July 24, 2024 @05:39PM (#41062448)
If a renown company won't pay a bug bounty, a foreign government often will.
Re:Anyone can access deleted and private repository data on ... by madeofpalk on Wednesday July 24, 2024 @06:10PM (#41062733)
Why would a foreign government pay for a commonly known security limitation of a product?
Re:Anyone can access deleted and private repository data on ... by prepend on Wednesday July 24, 2024 @06:33PM (#41062927)
Good luck selling this to a foreign (or domestic) government. It doesn’t seem valuable to me, but who knows, maybe someone finds it worth payout.
Re:Anyone can access deleted and private repository data on ... by K0balt on Thursday July 25, 2024 @04:57AM (#41066401)
The property (“bug”) in question is an inherent and intentional property of meekly-tree type storage systems such as git.

Calling this a bug is like reporting that telnet sends information unencrypted.

The actual bug is in the way that their UX paradigm sets user expectations.

Re:Anyone can access deleted and private repository data on ... by oasisaimlessly on Thursday July 25, 2024 @10:26AM (#41069042)
s/meekly/Merkle/g
Re:Anyone can access deleted and private repository data on ... by K0balt on Friday July 26, 2024 @06:10PM (#41082768)
lol. Someday autocorrect is going to take over my social media entirely.
Re:Anyone can access deleted and private repository data on ... by yencabulator on Thursday July 25, 2024 @12:10PM (#41070324)
Don't blame Git for Github decisions.

Github chooses to store all "Github forks" in the same repository, and allow accessing things in that repository even when they are not reachable by the refs in the namespace of one "fork". That is purely a Github decision.

Re:Anyone can access deleted and private repository data on ... by K0balt on Thursday July 25, 2024 @08:29PM (#41074879)
They could have split forks off into new repos, but then they wouldn’t be forks, in the repository sense. It was never hard to just copy a repo instead of forking it. The UX just leads people into holding it wrong.
Re:Anyone can access deleted and private repository data on ... by jowea on Wednesday July 24, 2024 @05:21PM (#41062287)
Shouldn't that be on the config page for the repo below the "private" button with a note saying private is not actually private if it's a fork? And ditto for delete?
Re:Anyone can access deleted and private repository data on ... by jiggawatts on Wednesday July 24, 2024 @07:18PM (#41063222)
From the article:

"We surveyed a few (literally 3) commonly-forked public repositories from a large AI company and easily found 40 valid API keys from deleted forks."

This is how your customers get their entire cloud taken over, because you made a stupid, stupid decision and instead of fixing it when warned (repeatedly!) you instead decide to just blame the customer for not reading page 537 paragraph 3 subsection B about the counter-intuitive security footgun you've left in your product.

This is negligence, pure and simple.

Re:Anyone can access deleted and private repository data on ... by ndriscoll on Wednesday July 24, 2024 @09:08PM (#41063836)
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.

Re:Anyone can access deleted and private repository data on ... by jiggawatts on Wednesday July 24, 2024 @10:37PM (#41064262)
> 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 access checks, so if you click around it'll say something like "you don't have browse access". This looks secure, but attempting access anonymously would have succeeded!

I had a customer recently where this happened -- they clicked through every Storage Account to "check" them, convinced themselves they were secure, meanwhile they had database backups with PII accessible to world+dog!

Re:Anyone can access deleted and private repository data on ... by ndriscoll on Wednesday July 24, 2024 @11:29PM (#41064467)
The bit you quoted is referring to public forks that were deleted. That sounds like a non-issue to me, and I'm not at all surprised that

1. Public "forks" are just namespaced branches that share an underlying repo

2. They don't run the garbage collector all the time

I'd be surprised if those weren't true.

Like I said, the behavior with private forks sounds indefensible.

The OP is mixing together multiple things. Being able to access deleted public data isn't that surprising and definitely isn't a security issue as far as leaking keys is concerned (it was already public. Assume it has been cloned). Being able to access private forks is a footgun/issue. They should be garbage collecting as part of public repo creation so that unreferenced commits from private forks aren't included.

Re:Anyone can access deleted and private repository data on ... by andersa on Thursday July 25, 2024 @05:59AM (#41066775)
As far as I can tell, they never run the garbage collector. Code I pushed to a fork that was deleted several years ago can still be accessed through the original parent repo.
Re:Anyone can access deleted and private repository data on ... by cellis on Wednesday July 24, 2024 @11:27PM (#41064458)
Putting keys in repos should not be done, full stop. Even if GitHub forks weren’t public, their _private_ repos could one day be compromised. Instead, store keys in a shared vault, .gitignore the .env and have a .env.example with empty keys.
Re:Anyone can access deleted and private repository data on ... by jiggawatts on Thursday July 25, 2024 @02:16AM (#41065268)
Any time I hear “shouldn’t be done” I translate that to “will happen regularly”.

I do see this regularly in my work. All but one dev team I’ve worked with over the last few years has done this.

Re:Anyone can access deleted and private repository data on ... by Eisenstein on Thursday July 25, 2024 @09:45AM (#41068627)
Don't blame the end user for doing something you don't want them to do if it is more convenient to do and works without immediate consequences. Redesign it or rethink your assumptions.
Re:Anyone can access deleted and private repository data on ... by prmoustache on Thursday July 25, 2024 @03:10AM (#41065631)
> 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 ... by andersa on Wednesday July 24, 2024 @04:14PM (#41061520)
I didn't find anything mentioning it online at the time. But there wasn't much time and dedication involved either, to be fair. I discovered it completely on accident when I combined a commit hash from my local client with the wrong repository url and it ended up working.
Re:Anyone can access deleted and private repository data on ... by kayodelycaon on Wednesday July 24, 2024 @03:34PM (#41060982)
As the article pointed out, GitHub already publicly documented this vulnerability.

My employer doesn't pay out for known security issues, especially if we have mitigating controls.

A lot of people spam us with vulnerability reports from security tools we already use. At least half of them turn out to be false positives we are already aware of. In my opinion, running a bug bounty program at all is a net negative for us. We aren't large enough to get the attention of anyone competent.

Re:Anyone can access deleted and private repository data on ... by ipaddr on Wednesday July 24, 2024 @05:27PM (#41062331)
For both sides it turns into a net negative. Better to keep your bugs and use them when needed or sell them to others to use if possible.

Lets get back to what we had before when multiple people can find the same bug and exploit if needed. Now we have the one person who finds the bug it gets patched and they don't get paid.

Re:Anyone can access deleted and private repository data on ... by giobox on Wednesday July 24, 2024 @05:30PM (#41062359)
> As the article pointed out, GitHub already publicly documented this vulnerability.

I'm honestly not yet convinced that is enough here - I've fallen victim to this without realizing it - the behaviour here is so far removed from how I suspect most user's mental model of github.com works. For me none of the exposed data is sensitive, but the point remains I was totally unawares it would be retrievable like this.

If the behaviour flies so against the grain, just publishing it in a help doc is not enough I'd argue. The linked article makes the exact same argument:

> "The average user views the separation of private and public repositories as a security boundary, and understandably believes that any data located in a private repository cannot be accessed by public users. Unfortunately, as we documented above, that is not always true. Whatsmore, the act of deletion implies the destruction of data. As we saw above, deleting a repository or fork does not mean your commit data is actually deleted."

Re:Anyone can access deleted and private repository data on ... by tptacek on Wednesday July 24, 2024 @05:47PM (#41062528)
The problem with this line of argument is that the fundamental workings of git are also surprising to people, such that they routinely attempt to address mistaken hazmat commits by simple reverts. If at bottom this whole story is just that git is treacherous, well, yeah, but not news.

There's a deeper problem here, which is that making the UX on hosting sites less surprising doesn't fix the underlying problem. There is a best-practices response to commiting hazmat to a repository: revoke the hazmat, so that its disclosure no long matters. You have to do this anyways. If you can't, you should be in contact with Github directly to remove it.

Re:Anyone can access deleted and private repository data on ... by Cpoll on Wednesday July 24, 2024 @06:21PM (#41062809)
Is "git" relevant here? Forking isn't a git concept, and none of this behaviour has much to do with git; it's all GitHub.

Also, you can revoke an API key, but you can't revoke a company-proprietary algorithm that you implemented into a fork of a public project.

Re:Anyone can access deleted and private repository data on ... by tptacek on Wednesday July 24, 2024 @06:25PM (#41062854)
Like I said: if you can't revoke the thing you committed, you need to get in touch with Github and have them remove it. That's a thing they do.
Re:Anyone can access deleted and private repository data on ... by Cpoll on Thursday July 25, 2024 @11:33AM (#41069870)
Sure, but the whole point of the article is that people don't know their "private" forks aren't private. You can't get in touch with GitHub if you've never had any indication that anything's wrong.

The solution for that is better UX.

Re:Anyone can access deleted and private repository data on ... by schrodinger on Thursday July 25, 2024 @12:34AM (#41064739)
aside: I think it's questionable to say that forking isn't a git concept. it's just a branch on a different upstream. Those two upstreams could simply be two different folders on your machine, or shared server.

I supposed the branding and UI for it could be a counter argument, but then again Github allows regular branch creation / committing / merging in their UI. Their main value add (not downplaying it—it's huge) on top of git (besides ancillary things like CI / linters) is the ability to comment on a branch's diff, i.e. a PR Review.

Re:Anyone can access deleted and private repository data on ... by giobox on Thursday July 25, 2024 @11:38AM (#41069920)
There's an entire custom UX flow for forking on GH that is not part of git at all. I think its very fair here to discuss "fork" in the specific sense Github uses it, as its what has lead to some of the issues discussed. There are absolutely means of providing fork functionality that don't have some of the problems we are discussing, but that's not how GH chose to build it.
Re:Anyone can access deleted and private repository data on ... by Aeolun on Wednesday July 24, 2024 @07:26PM (#41063295)
Yeah, and we can blame a lot of that on the Git developers, but they never use words like ‘public’ and ‘private’ to indicate things they’re not.

Regardless, the vulnerability in Github forks falls squarely on Github, and is not mitigated by Git being hard to understand in the first place.

Re:Anyone can access deleted and private repository data on ... by gowld on Wednesday July 24, 2024 @08:35PM (#41063663)
Two thinks can be true (and are)

1. GitHub has a nasty privacy/security hole, where commonsense expectations about the meanings of common words are violated by the system.

2. Github has publicly announced that they don't care about this part of user data security (private code), so won't pay people to know tell them what they alreay know and announced.

Github won't pay you to tell them they are wrong when everyone alreay knows.

Re:Anyone can access deleted and private repository data on ... by oxfordmale on Wednesday July 24, 2024 @07:33PM (#41063340)
As the author pointed out, the documentation was written three years after he reported it.

Beyond that is is also a batshit crazy implementation. Just I imagine AWS would still allow AWS credentials to give access to a deleted account

Re:Anyone can access deleted and private repository data on ... by account42 on Thursday July 25, 2024 @05:37AM (#41066655)
The expectations for AWS and public repository hosting are not the same. If you leaked something to a public GitHub repo you should assume that it has been cloned the second you pushed it.
Re:Anyone can access deleted and private repository data on ... by oxfordmale on Thursday July 25, 2024 @07:06AM (#41067159)
This is about access to private repos, not public ones:

"Anyone can access deleted and private repository data on GitHub"

Re:Anyone can access deleted and private repository data on ... by 93po on Wednesday July 24, 2024 @03:39PM (#41061045)
companies vary wildly in their honesty and cooperation with bug bounties and develop reputations as a result. if they have a shit reputation, people stop doing free work for them and instead focus on more honest companies
Re:Anyone can access deleted and private repository data on ... by account42 on Thursday July 25, 2024 @05:45AM (#41066701)
Not all free work is wanted. Discouraging frivolous reports is exactly what is being accomplished by not paying for them.
Re:Anyone can access deleted and private repository data on ... by 93po on Friday July 26, 2024 @08:30AM (#41078058)
there are endless examples of reports that, by the judgement of the community, are entirely valid and unknown security concerns and fit within the guidelines of a company's bug bounty program, and do not ever result in payment
Re:Anyone can access deleted and private repository data on ... by cyrnel on Wednesday July 24, 2024 @04:19PM (#41061569)
Security disclosures are like giving someone an unsolicited gift. The receiver is obligated to return the favor.

But if you buy someone non-refundable tickets to a concert they already have tickets for, you aren't owed compensation.

Re:Anyone can access deleted and private repository data on ... by TheDong on Wednesday July 24, 2024 @07:33PM (#41063342)
Security disclosures are like telling someone they have a spot on their face. It's not always welcome, and there's no obligation on anyone to do so, nor anyone to return the favor.

In this case, the spot turned out to be a freckle, which everyone involved already knew was a freckle (since it was documented), and if anyone owes anyone anything, it's the researcher that owes github for wasting their time.

Re:Anyone can access deleted and private repository data on ... by account42 on Thursday July 25, 2024 @05:40AM (#41066674)
> Security disclosures are like giving someone an unsolicited gift.

Exactly.

> The receiver is obligated to return the favor.

Not at all. This is a very toxic expectation.

Re:Anyone can access deleted and private repository data on ... by nyrikki on Wednesday July 24, 2024 @05:12PM (#41062193)
For moral reasons, historically I never wrote POCs or threatened disclosure.

For companies like Microsoft, which a CSRB audit showed that their security culture 'inadequate', the risk of disclosure with a POC is about the only tool we have to enforce their side of the Shared Responsibility Model.

Even the largest IT spender in the world, the US government has moved more from the carrot to the stick model. If they have to do it so do we.

Unfortunately as publishing a 'bad practices' list by us doesn't invoke the risk of EULA busting gross negligence claims, responsible disclosure is one of the few tools we have.

Re:Anyone can access deleted and private repository data on ... by tptacek on Wednesday July 24, 2024 @05:40PM (#41062461)
No large company running a bug bounty cares one iota about stiffing you on a bounty payment. The teams running this programs are internally incentivized to maximize payouts; the payouts are evidence that the system is working. If you're denied a payment --- for a large company, at least --- there's something else going on.

The thing to keep in mind is that large-scale bug bounty programs make their own incentive weather. People game the hell out of them. If you ack and fix sev:info bugs, people submit lots more sev:info bugs, and now your security program has been reoriented around the dumbest bugs --- the opposite of what you want a bounty program to do.

Re:Anyone can access deleted and private repository data on ... by raesene9 on Thursday July 25, 2024 @06:05AM (#41066801)
In my (admittedly limited) experience, whilst payouts for bugs might be seen as a positive internally, payments for bad architecture/configuration choices are less so (perhaps as they're difficult to fix, so it's politically not expedient to raise them internally).

To provide one example I reported to a large cloud provider that their managed Kubernetes system exposed the Insecure port to the container network, meaning that anyone with access to one container automatically got cluster-admin rights. That pretty clearly seems like not a good security choice, but probably hard to fix if they were relying on that behaviour (which I'm guessing they were).

Their response was to say it was a "best practice" behaviour (no bounty applicable) and that they'd look to fix and asked me not to publicly mention it. Then they deprecated the entire product 6 months later :D

That's one example but I've seen similar behaviour multiple times for things that are more architecture choices than direct bugs, which makes me think reporting such things isn't always welcome by the program owners.

Re:Anyone can access deleted and private repository data on ... by tptacek on Thursday July 25, 2024 @10:09AM (#41068873)
Repeating myself: this almost certainly has nothing at all to do with the money they'd have to give you (I assure you, if there's even a whiff of legitimacy to your report, the people managing the bounty would probably strongly prefer to pay you just to get you off their backs) and everything to do with the warped incentives of paying out stuff like this. People forget that the whole point of a bug bounty is that the rewarded bugs get fixed; the bounty is directing engineering effort. If it directs them to expensive work they already made a strategic decision not to do, the bounty is working against them.

You would prefer this company to have made a different strategic choice about what to spend engineering time on, and that's fine. But engineering cycles are finite, so whatever time they'd spend configuring K8s differently is time they wouldn't be spending on some other security goal, which, for all we know, was more important. Software is fathomlessly awful, after all.

Re:Anyone can access deleted and private repository data on ... by raesene9 on Friday July 26, 2024 @04:13AM (#41076767)
Yep that's the point I was making, they don't want to pay out on architecture/configuration changes if making those would be expensive/difficult.

That doesn't mean the report isn't legitimate (being cluster-admin with no authentication is generally considered not to be a good security idea, in fact it's about as bad as it could get without putting the insecure port on the Internet), but that bug bounties aren't architected to accept that kind of issue. The challenge with this is it means that bug bounty researchers won't look for that kind of (legitimate) security issue as they get to know the programs often won't pay out.

Personally, I don't ever report bug bounties for the money reward, but so I don't get shouted at by companies when I write a blog or do a talk that covers the issues :) In this case I was a bit annoyed that they combined telling me it wasn't a bug, with asking me not to mention it publicly for 6+ months (IIRC they credited me like years after the fact).

Re:Anyone can access deleted and private repository data on ... by tptacek on Friday July 26, 2024 @02:50PM (#41081200)
Yes. Bug bounties are not a panacea, and were never intended to be. They have specific goals, and those goals surprise technologists working outside of the security teams that run the programs. They make a lot more sense when you remind yourself that they (a) direct engineering efforts and (b) create profound incentives; those facts together sharply constrain the problems they can be applied to.
Re:Anyone can access deleted and private repository data on ... by deepsun on Tuesday July 30, 2024 @01:24PM (#41111765)
> and asked me not to publicly mention it

Sounds sus. If they said it's "best practice" then certainly they'd want you to tell everyone about it.

If a bug bounty is denied I'd assume you're free to talk about it publicly.

Re:Anyone can access deleted and private repository data on ... by hluska on Wednesday July 24, 2024 @05:44PM (#41062494)
The issue had been reported at least twice and was clearly documented. GitHub knew about this and had known for years. Their replies to the two notifications were even very similar.

GitHub clearly knew. Would you prefer that a vendor lie?

Re:Anyone can access deleted and private repository data on ... by account42 on Thursday July 25, 2024 @05:22AM (#41066571)
Disagree. This is obviously a deliberate design choice with obvious implications. Expecting a bounty for reporting this is unreasonable. These kind of beg bounties are exactly what gives security "researchers" a bad name.

The security implications are also minor. The only problem really is with making a fork of a private repo public - that should only make what exists in that fork public and not any other objects. Something that was already public staying public even when you delete it from your repo is not a security issue at all. Keys you have ever been pushed to a public repo should be revoked no matter what, with or without this GitGub feature.

Re:Anyone can access deleted and private repository data on ... by andersa on Thursday July 25, 2024 @05:49AM (#41066733)
I wasn't really expecting a bounty, more so hoping they'd fix the issue. For example, to this day I keep having to tell people to never fork the Unreal Engine repository, instead making a manual copy, just in case.

This causes lots of problems for repositories that are private with the expectation that companies will make private forks with their own private changes.

Someone once pushed a bunch of console SDKs (under strict NDA) to a private fork without knowing this. Now that code is just there, if you can guess the commit hash, forever. Literally nothing can be done to remove it. Great.

Re:Anyone can access deleted and private repository data on ... by barco on Thursday July 25, 2024 @09:58AM (#41068774)
I reported a variant of this issue that (to me) was unexpected:

* You add someone to your private repo.

* After some time, you revoke their access.

As long as they keep a fork (which you can't control) they can use this same method to access new commits on the repo and commits from other private forks.

Back in 2018, this was a resolved as won't fix, but it also wasn't documented.

Re:Anyone can access deleted and private repository data on ... by whoknew1122 on Thursday July 25, 2024 @09:32AM (#41068500)
It's not just GitHub and it's not just because they don't want to pay bug hunters. In my career, I have escalated multiple bugs to my employer(s) in which the response was 'working as intended'. And they wouldn't have to pay me another cent if they acknowledged the issue.

In my experience, there was two reasons for this behavior:

1. They don't want to spin dev cycles on something that isn't directly related to revenue (e.g. security) 2. Developers don't have the same mindset as someone who's whole job is security. So they think something is fine when it's really not.

Re:Anyone can access deleted and private repository data on ... by jeremyjh on Wednesday July 24, 2024 @03:38PM (#41061029)
It would not even be that hard to fix it; private forks should always just be automatically copied on first write. You might lose your little link to the original repo, but that's not as bad as unintentionally exposing all your future content.
Re:Anyone can access deleted and private repository data on ... by sundalia on Wednesday July 24, 2024 @04:00PM (#41061337)
Yup, we can close the thread and ack that GitHub does not care.
Re:Anyone can access deleted and private repository data on ... by kayodelycaon on Wednesday July 24, 2024 @03:33PM (#41060964)
What does "private fork" mean in this context? I created a fork of a project by cloning it to my own machine and set origin to an empty private repository on GitHub. I manually merge upstream changes on my machine.

Is my repository accessible?

Re:Anyone can access deleted and private repository data on ... by andersa on Wednesday July 24, 2024 @03:42PM (#41061071)
No, that would be the "copy the repository" approach. Private fork is when you do it through their UI.

As far as I know, it is not accessible.

Re:Anyone can access deleted and private repository data on ... by swozey on Wednesday July 24, 2024 @04:40PM (#41061810)
Because you never git pushed to the fork it's not aware of your repo, you're ok.

What I don't know is if in 3 months you DO set your remote origin to that fork to for instance, pull upstream patches into your private repo, you're still not pushing, only pulling, so I would THINK they'd still never get your changes, but I don't know if git does some sort of log sync when you do a pull as well.

Maybe that would wind up having the commit hash available.

Re:Anyone can access deleted and private repository data on ... by masklinn on Wednesday July 24, 2024 @04:42PM (#41061831)
It’s not. The feature here works because a network of forks known by GitHub has a unified storage, that’s what makes things like PRs work transparently and keep working if you delete the fork (kinda, it closes the PR but the contents don’t change).
Re:Anyone can access deleted and private repository data on ... by dathinab on Wednesday July 24, 2024 @05:06PM (#41062123)
then it's fine

the issue is the `fork` mechanism of github is not semantically like a `git clone`

it's more like creating a larger git repo in which all forks weather private or not are contained and which doesn't properly implement access management (at least point 2&3 wouldn't be an issue if they did)

there are also some implications form point 1 that forks do in some way infer with gc-ing orphan commits (e.g. the non synced commits in he deleted repo in point 1) at least that should be a bug IMHO one which also costs them storage

(also to be clear for me 2&3 are security vulnerabilities no matter if they are classified as intended behavior)

Re:Anyone can access deleted and private repository data on ... by fullstackchris on Wednesday July 24, 2024 @05:53PM (#41062591)
To be fair, in the true git sense, if a "fork" is really just a branch, deleting the original completely would also mean deleting every branch (fork) completely

obviously not a fan of this policy though

Re:Anyone can access deleted and private repository data on ... by bogota on Thursday July 25, 2024 @02:22AM (#41065310)
But a fork is really not a branch. it’s a copy of a repo with one remote pointing at the original on github but that doesn’t need to happen.
Re:Anyone can access deleted and private repository data on ... by SnowflakeOnIce on Wednesday July 24, 2024 @06:04PM (#41062689)
There seems to be no such thing as a "private fork" on GitHub in 2024 [1]:

> A fork is a new repository that shares code and visibility settings with the upstream repository. All forks of public repositories are public. You cannot change the visibility of a fork.

[1] https://docs.github.com/en/pull-requests/collaborating-with-...

Re:Anyone can access deleted and private repository data on ... by Manuel_D on Wednesday July 24, 2024 @06:20PM (#41062805)
Not through the GitHub interface, no. But you can copy all files in a repository and create a new repository. IIRC there's a way to retain the history via this process as well.
Re:Anyone can access deleted and private repository data on ... by JyB on Wednesday July 24, 2024 @06:53PM (#41063065)
That’s beside the point. The article is specifically about « GitHub forks » and their shortcomings. It’s unrelated to pushing to distinct repositories not magically ´linked’ by the GH « fork feature ».
Re:Anyone can access deleted and private repository data on ... by mckn1ght on Wednesday July 24, 2024 @06:35PM (#41062944)
You can create a private repository on GitHub, clone it locally, add the repo being "forked" from as a separate git remote (I usually call this one "upstream" and my "fork", well, "fork"), fetch and pull from upstream, then push to fork.
Re:Anyone can access deleted and private repository data on ... by make3 on Wednesday July 24, 2024 @06:32PM (#41062917)
That's not the GitHub concept / almost trademark of "fork" anymore though, which is what your parent was talking about
Re:Anyone can access deleted and private repository data on ... by shkkmo on Wednesday July 24, 2024 @06:37PM (#41062956)
All you should have to do is just clone the repo locally and then create a blank GitHub repository, set it as the/a remote and push to it.
Re:Anyone can access deleted and private repository data on ... by a1o on Wednesday July 24, 2024 @06:33PM (#41062922)
I mean it's git, just git init, git remote add for origin and upstream, origin pointing to your private, git fetch upstream, git push to origin.
Re:Anyone can access deleted and private repository data on ... by ff7c11 on Wednesday July 24, 2024 @08:50PM (#41063756)
A fork of a private repo is private. When you make the original repo public, the fork is still a private repo, but the commits can now be accessed by hash.
Re:Anyone can access deleted and private repository data on ... by CGamesPlay on Wednesday July 24, 2024 @09:04PM (#41063826)
According to the screenshot in the documentation, though, new commits made to the fork will not be accessible by hash. So private feature branches in forks may be accessible via the upstream that was changed to public, if those branches existed at the time the upstream's visibility changed, but new feature branches made after that time won't be accessible.
Re:Anyone can access deleted and private repository data on ... by pcthrowaway on Wednesday July 24, 2024 @10:37PM (#41064264)
OK but say a company has a private, closed source internal tool, and they want to open-source some part of it. They fork it and start working on cleaning up the history to make it publishable.

After some changes which include deleting sensitive information and proprietary code, and squashing all the history to one commit, they change the repo to public.

According to this article, any commit on either repo which was made before the 2nd repo was made public, can still be accessed on the public repo.

Re:Anyone can access deleted and private repository data on ... by reisse on Thursday July 25, 2024 @06:37AM (#41066965)
> After some changes which include deleting sensitive information and proprietary code, and squashing all the history to one commit, they change the repo to public.

I know this might look like a valid approach on the first glance but... it is stupid for anyone who knows how git or GitHub API works? Remote (GitHub's) reflog is not GC'd immediately, you can try to get commit hashes from events history via API, and then try to get commits from reflog.

Re:Anyone can access deleted and private repository data on ... by marcosdumay on Thursday July 25, 2024 @10:01AM (#41068789)
Yes, even though I expect there to be people that do exactly what the GP describes, if you know git it has severe "do not do that!" vibes.

Do not squash your commits and make the repository public. Instead, make a new repository and add the code there.

Re:Anyone can access deleted and private repository data on ... by Perseids on Thursday July 25, 2024 @11:04AM (#41069522)
> it is stupid for anyone who knows how git or GitHub API works?

You need to know how git works and GitHub's API. I would say I have a pretty good understanding about how (local) git works internally, but was deeply surprised about GitHub's brute-forceable short commit IDs and the existence of a public log of all reflog activity [1].

When the article said "You might think you’re protected by needing to know the commit hash. You’re not. The hash is discoverable. More on that later." I was not able to deduce what would come later. Meanwhile, data access by hash seemed like a non-issue to me – how would you compute the hash without having the data in the first place? Checking that a certain file exists in a private branch might be an information disclosure, but gi not usually problematic.

And in any case, GitHub has grown so far away from its roots as a simple git hoster that implicit expectations change as well. If I self-host my git repository, my mental model is very close to git internals. If I use GitHub's web interface to click myself a repository with complex access rights, I assume they have concepts in place to thoroughly enforce these access rights. I mean, GitHub organizations are not a git concept.

[1] https://www.gharchive.org/

Re:Anyone can access deleted and private repository data on ... by reisse on Thursday July 25, 2024 @02:25PM (#41071744)
> You need to know how git works and GitHub's API.

No; just knowing how git works is enough to understand that force-pushing squashed commits or removing branches on remote will not necessarily remove the actual data on remote.

GitHub API (or just using the web UI) only makes these features more obvious. For example, you can find and check commit referenced in MR comments even if it was force-pushed away.

> was deeply surprised about GitHub's brute-forceable short commit IDs

Short commit IDs are not GitHub feature, they are git feature.

> If I use GitHub's web interface to click myself a repository with complex access rights, I assume they have concepts in place to thoroughly enforce these access rights.

Have you ever tried to make private GitHub repository public? There is a clear warning that code, logs and activity history will become public. Maybe they should include additional clause about forks there.

Re:Anyone can access deleted and private repository data on ... by pcthrowaway on Thursday July 25, 2024 @03:36PM (#41072510)
Dereferenced commits which haven't yet been garbage collected in a remote yet are not available to your local clones via git... I suppose there could be some obscure way to pull them from the remote if you know the hash (though I'm not actually sure), but either way (via web interface or CLI) you'd have to know the hash.

And it's completely reasonable to assume no one external to the org when it was private would have those hashes.

It sounds like github's antipattern here is retaining a log of all events which may leak these hashes, and is really not an assumption I'd expect a git user to make.

Re:Anyone can access deleted and private repository data on ... by Dylan16807 on Thursday July 25, 2024 @03:12PM (#41072273)
> Short commit IDs are not GitHub feature, they are git feature.

They're a local feature sure. But you already have a list of local commits, just open the .git directory.

Can you connect to a vanilla git server and enumerate every single hash?

> Maybe they should include additional clause about forks there.

It would help but they need much more than a clause about forks.

Ideally they would purge that extra data when making something public.

Re:Anyone can access deleted and private repository data on ... by pcthrowaway on Thursday July 25, 2024 @03:38PM (#41072538)
> Can you connect to a vanilla git server and enumerate every single hash?

If you have ssh access yes, but I don't think you can do this with just git (and of course github doesn't provide ssh access to the git repo servers)

The public distribution of commit hashes via their event log seems really irresponsible on github's part to me.

Re:Anyone can access deleted and private repository data on ... by sickblastoise on Thursday July 25, 2024 @07:56AM (#41067540)
Why not just create a new public repo and copy all of the source code that you want to it?
Re:Anyone can access deleted and private repository data on ... by cutemonster on Thursday July 25, 2024 @04:19PM (#41072939)
Because they haven't read the article and this HN discussion?

"Why not just...". Once you already know something it can seem obvious.

Re:Anyone can access deleted and private repository data on ... by sickblastoise on Friday July 26, 2024 @10:08PM (#41083982)
What?
Re:Anyone can access deleted and private repository data on ... by Log_out_ on Thursday July 25, 2024 @01:16PM (#41071050)
Chat gpt given the following repo, create a plausible perfect commit history to create this repository.
Re:Anyone can access deleted and private repository data on ... by rkagerer on Thursday July 25, 2024 @01:09AM (#41064918)
Am I the only one who finds this conceptually confusing?
Re:Anyone can access deleted and private repository data on ... by rocqua on Thursday July 25, 2024 @02:34AM (#41065367)
Nope, me too. The whole Repo network thing is not User facing at all. It is an internal thing at GitHub to allow easier pull requests between repo's. But it isn't a concept git knows, and it doesn't affect GitHub users at all except for this one weird thing.
Re:Anyone can access deleted and private repository data on ... by brazzledazzle on Thursday July 25, 2024 @04:53AM (#41066379)
I may be recalling incorrectly but I seem to remember it having some storage deduplication benefits on the backend.
Re:Anyone can access deleted and private repository data on ... by tedmiston on Monday July 29, 2024 @03:48PM (#41103161)
> Nope, me too. The whole Repo network thing is not User facing at all.

There are some user-facing parts: You can find the fork network and some related bits under repo insights. (The UX is not great.)

https://github.com/apache/airflow/forks?include=active&page=...

Re:Anyone can access deleted and private repository data on ... by itsgabriel on Thursday July 25, 2024 @04:17AM (#41066149)
Funnily enough the docs are wrong, the GitHub CLI allows changing a forks visibility https://stackoverflow.com/a/78094654/12846952
Re:Anyone can access deleted and private repository data on ... by WA on Thursday July 25, 2024 @12:48AM (#41064810)
> Conclusion: don't use private forks. Copy the repository instead.

My conclusion would be: don’t use GitHub.

Re:Anyone can access deleted and private repository data on ... by HenryBemis on Thursday July 25, 2024 @10:53AM (#41069412)
Imho there is an issue with the word "delete". Apparently for anyone who is hosting someone else's (private and/or sensitive and/or worthy) data is to hide it from view, but keep it around "just in case" or "because we can" or "what are you gonna do about it"?

I 'love' it when I see the words "hide", "archive", "remove", and other newspeak to avoid using the word "delete", since 'they' never actually delete (plus there are 1-2-5-10-forever years' of backups where your 'deleted' info can be retrieved relatively easy).

Re:Anyone can access deleted and private repository data on ... by MatthewWilkes on Friday July 26, 2024 @09:20AM (#41078414)
Same, September 2018 for me.

> After some internal discussion, we have determined this is a known low risk issue. We may make this functionality more strict in the future, but don't have anything to announce now. As a result, this is not eligible for reward under the Bug Bounty program. Below is a reference to our instructions for users to remove sensitive data from a repository. https://help.github.com/articles/removing-sensitive-data-fro...