News for hackers. Stuff that matters.

Ask HN: Was GitHub Hacked or Me?

http://confidencetoexplore.com/

That's my page. My other github pages are working fine, but that one redirects to a crazy screen with a lighting strike gif, an email address, and something about "muslim cybersecurity".

I changed the A records to put up a parking lot page and that worked, so I think it's something around github. As soon as I add the A records and CNAME records back to point to github, the hacked page goes back up.

How do I fix this?

( 42 comments | 168 points | on HN )
Re:Ask HN: Was GitHub Hacked or Me? by otras on Wednesday April 03, 2019 @03:11PM (#19566283)
This came up recently in a different HN thread: https://news.ycombinator.com/item?id=19118740

The main gist is that GitHub doesn't require proof of ownership in order to set a custom domain.

This means that if your GitHub Pages configurations are incorrect for any reason (for example, that user switched from a Pro to a regular account and lost the ability to have a GH page on a private repo), another user can come along and claim your page (confidencetoexplore.com) as the custom domain for that repo.

My bet would be that this happened to you. As another user in that thread mentioned, report them: https://github.com/contact/report-abuse

Re:Ask HN: Was GitHub Hacked or Me? by scottndecker on Wednesday April 03, 2019 @03:42PM (#19566554)
Son of a biscuit! This is exactly what happened. They said I could have my 7 private repos without a Pro account so I downgraded and didn't realize it shut down my gh-pages websites. Then this schmuck comes along and steals them. THANK YOU TO EVERYONE WHO IS REPORTING THIS!!
Re:Ask HN: Was GitHub Hacked or Me? by chrisweekly on Wednesday April 03, 2019 @10:20PM (#19568840)
Thank you for "son of a biscuit"! Best pseudo-swear since "Shut the front door".
Re:Ask HN: Was GitHub Hacked or Me? by lloeki on Thursday April 04, 2019 @03:32AM (#19570045)
In french my wife uses "lutin en herbe" (or just "lutin") instead of "putain de merde"
Re:Ask HN: Was GitHub Hacked or Me? by tendencydriven on Thursday April 04, 2019 @06:51AM (#19570802)
Google translate says "budding goblin" ... I'm just going to use that in English
Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @03:14PM (#19566304)
Yes. This is what I just discovered. OP here's the malicious github account, so we can get it banned:

https://github.com/OnyonCapitaly

I found a repo with your domain:

https://github.com/OnyonCapitaly/confidencetoexplore.com

edit: just reported them, but you should too OP.

Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @06:42PM (#19567840)
Aaaand it’s down! Good job Github and everyone who helped.

Hope this helped, OP

Re:Ask HN: Was GitHub Hacked or Me? by ronsor on Wednesday April 03, 2019 @05:10PM (#19567289)
The script kiddie will just signup for another account and "hack" the same sites again.
Re:Ask HN: Was GitHub Hacked or Me? by vokep on Wednesday April 03, 2019 @05:43PM (#19567489)
At least now they have to go through that effort again
Re:Ask HN: Was GitHub Hacked or Me? by techntoke on Wednesday April 03, 2019 @07:43PM (#19568179)
Does GitLab have this issue? Don't they offer all this for free, unlike GitHub?
Re:Ask HN: Was GitHub Hacked or Me? by lscotte on Wednesday April 03, 2019 @08:11PM (#19568314)
I don't know if they handle this case better specifically, but I found almost all GitLab page functionality is better than GitHub - plus it's more generic, you can wire any static page generator into the built-in CI/CD, not just limited to jekyll or doing it yourself.
Re:Ask HN: Was GitHub Hacked or Me? by therealmarv on Wednesday April 03, 2019 @09:26PM (#19568610)
GitLab requires you to put a txt record with a verification code in your custom private domain DNS to verify ownership.

TL;DR no, GitLab does not have that issue.

Re:Ask HN: Was GitHub Hacked or Me? by gitlab-security on Wednesday April 03, 2019 @09:59PM (#19568754)
Confirming the previous poster's comment on GitLab Pages domain ownership verification functionality, which was rolled out in February of 2018. https://about.gitlab.com/2018/02/05/gitlab-pages-custom-doma...
Re:Ask HN: Was GitHub Hacked or Me? by scottndecker on Wednesday April 03, 2019 @03:43PM (#19566566)
Thank you! This is nuts that this can happen and someone would do such a thing. Stupid.
Re:Ask HN: Was GitHub Hacked or Me? by marketgod on Wednesday April 03, 2019 @10:30PM (#19568880)
You are awesome. Good work!
Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Thursday April 04, 2019 @12:03AM (#19569221)
Thanks! This is the first time I've done this kind of internet sleuthing. It's a fun experience.
Re:Ask HN: Was GitHub Hacked or Me? by sarcasmatwork on Wednesday April 03, 2019 @03:27PM (#19566420)
Reported too...
Re:Ask HN: Was GitHub Hacked or Me? by scottndecker on Wednesday April 03, 2019 @03:43PM (#19566567)
Thank you!
Re:Ask HN: Was GitHub Hacked or Me? by morpheuskafka on Wednesday April 03, 2019 @05:23PM (#19567368)
GitHub recebtly introduced a domain verification system for an unrelated feature, they should really integrate it with Pages.
Re:Ask HN: Was GitHub Hacked or Me? by dragonwriter on Wednesday April 03, 2019 @09:34PM (#19568649)
That thread was 54 days ago, and the flaw was being exploited and was reported to GH then.

Shouldn't they, I don't know, do something beyond banning accounts caught exploiting this?

Re:Ask HN: Was GitHub Hacked or Me? by hopler on Wednesday April 03, 2019 @05:41PM (#19567474)
That thread is 2months old and GitHub/Microsoft still hasn't closed this security hole.
Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @06:44PM (#19567852)
They should at least flag accounts with an unusually high number of custom domains. Seems easy to do IMO.
Re:Ask HN: Was GitHub Hacked or Me? by max23_ on Wednesday April 03, 2019 @09:43PM (#19568671)
Yes, I got my GitHub page 'hijacked' in a similar way some time ago when I switched the repo to private (when GitHub announced free private repos for regular account).

Quick response from GitHub after raising a report and got my CNAME back after going through the domain ownership verification with them.

Re:Ask HN: Was GitHub Hacked or Me? by scottndecker on Wednesday April 03, 2019 @11:24PM (#19569071)
UPDATE: Github responded with the following...

(GitHub Developer Support)

Apr 4, 2:52 AM UTC

Hi Scott,

Thanks for reaching out, and sorry for the trouble!

GitHub Pages doesn't currently have a verification process when configuring a new custom domain. We chose this design due to its low friction, but unfortunately it also means that any GitHub user can claim any custom domain, so long as it isn't already in use on another repository.

When you downgraded your account to GitHub Free, GitHub Pages for your private repository was disabled, and this released your custom domain for potential use by other GitHub users. While the risk of another user accidentally claiming your specific custom domain is low, we've experienced trouble lately with opportunistic ne'er-do-wells strategically claiming custom domains they find to be available.

Our engineering team is currently investigating potential improvements to prevent this in future. In the meantime, we're taking the precaution of performing manual verification in any cases such as yours. A quick way we can verify your ownership of the domain would be for you to add a TXT record to your domain's DNS configuration.

When you create the TXT record, please include the following value:...

and from there gave me a value to put in my DNS to verify ownership.

Not a great experience today but at least they responded and are working to remedy the situation (which I still believe was a huge ball drop on their part in terms of both communication and implementation).

Re:Ask HN: Was GitHub Hacked or Me? by cypherpunks01 on Thursday April 04, 2019 @12:03AM (#19569219)
I had this exact same problem too on March 26th and my first response was poor, the rep said "I'm sorry to hear that your domain was taking [sic] over by another user" and tried to get me to verify my own domain with them. I told them that I was disappointed with the response and then another support rep wrote a much more helpful and detailed reply:

"Sorry for the trouble you've had with this.

GitHub Pages doesn't currently have a way of linking ownership of a domain to a GitHub account. When you point your domain's DNS records towards GitHub IPs all we can tell on our side is that the domain can be attached to a Pages site—but we can't tell which one, or which account it's owned by, until the domain is linked in the repository settings page.

When you leave your domain pointing towards GitHub, but don't attach it to a live Pages site, any other GitHub user can link your domain to a Pages site without any further verification. All we can see from your domain are the GitHub IPs listed in the DNS records, so we have no way of linking it to a specific account.

As this domain is now attached to a Pages site, we have to consider that the person currently using it is the legitimate owner, whether that be via a domain ownership transfer, the domain has expired and someone else has purchased it, or other means.

We use this setup to make it quick and easy to get started with GitHub Pages, without having to perform even more complex DNS verification steps or waiting for propagation time. We are aware that it can be abused however and are looking at possible solutions, but we don't have anything to announce at this time.

If you would like to use this domain with GitHub Pages again yourself then you will need to follow the verification process. If you don't want to use this domain with GitHub Pages then you can safely remove any DNS records that point towards GitHub to stop the malicious site displaying at your domain. However you may have to verify it with us again in future if you would like to use GitHub Pages again.

Let us know if you have any further questions, or would like to continue verifying your ownership of your domain with us."

Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Thursday April 04, 2019 @12:08AM (#19569240)
It's great to hear that at least they have some mitigation for this issue so it never happens again. It's nice that you brought awareness to this issue so a process change could be made at GH HQ.
Re:Ask HN: Was GitHub Hacked or Me? by fernandouhu on Wednesday April 03, 2019 @04:56PM (#19567201)
The same happened to me, I searched my CNAME on github and found that a user was "hijacking" some CNAMEs, pointing these domains to his own repos. This happened to me because I switched from PRO to Free and I didn't notice that the Free plan does not allow us to have a private repository with Github Pages. The end result in my case is that I migrated my blog to Netlify and used Hugo to generate my HTML site from Markdown files. It was very straightforward and I am satisfied with the end result.
Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @06:48PM (#19567872)
That’s exactly how I found the CNAME takeover in the case of OP. I guess if this happens to anyone, the first mitigation step would be to search all of GitHub for that CNAME.
Re:Ask HN: Was GitHub Hacked or Me? by techntoke on Wednesday April 03, 2019 @07:44PM (#19568183)
Migrating to GitLab would solve this issue.
Re:Ask HN: Was GitHub Hacked or Me? by mdeeks on Thursday April 04, 2019 @02:18AM (#19569751)
This reminds me of the awful Cloudfront vulnerability where any jerk can park your domain names in Cloudfront with no verification. One day you'll put one of your domains behind Cloudfront and suddenly they own your website.

Scenario:

1. Today your DNS records look like this because you aren't using Cloudfront:

  site.com -- A --> 1.2.3.4
  www.site.com -- CNAME --> site.com
2. Some jerk with an AWS account registers "www.site.com" in Cloudfront.

3. Tomorrow you create a cloudfront distribution for site.com and change site.com to a CNAME to "d12345abcdef.cloudfront.net". Instantly you're owned on WWW.site.com because it indirectly points to Cloudfront and you forgot to register that alias in AWS. Oh and guess what? The jerk can issue SSL certs for your domain name through Lets Encrypt because all they need to do is put a well-known file off your domain.

4. You have a bug bounty program (right?!) and pay quick, big money out to some researcher who is, thankfully, not a jerk.

Good times.

Re:Ask HN: Was GitHub Hacked or Me? by ChrisCinelli on Wednesday April 03, 2019 @06:13PM (#19567693)
The real problem here is that they do not notify people that on the Free plan, you can have Pages on a public repo, or a private repo without Pages. But you can’t have Pages on a private repo.
Re:Ask HN: Was GitHub Hacked or Me? by techntoke on Wednesday April 03, 2019 @07:44PM (#19568186)
With GitLab you can have a private repo for your Pages.
Re:Ask HN: Was GitHub Hacked or Me? by radicalriddler on Wednesday April 03, 2019 @07:49PM (#19568207)
That's nice.
Re:Ask HN: Was GitHub Hacked or Me? by ecabuk on Wednesday April 03, 2019 @06:09PM (#19567667)
I haven’t knew that Pro account is required to host static content for private repos. It’s better move to gitlab because my student pro account going to end soon.
Re:Ask HN: Was GitHub Hacked or Me? by JPLeRouzic on Wednesday April 03, 2019 @03:05PM (#19566220)
I am not an expert, but did you checked your domain authoritative DNS servers?
Re:Ask HN: Was GitHub Hacked or Me? by scottndecker on Wednesday April 03, 2019 @03:07PM (#19566237)
I've logged into my DNS provider and confirmed everything is set up the same as my other github pages which are working fine. Is that what you're asking?
Re:Ask HN: Was GitHub Hacked or Me? by JPLeRouzic on Wednesday April 03, 2019 @03:12PM (#19566287)
I checked your's and it is the same as for Aditya, so it might be OK. Weird stuff, I do not understand how it is possible.

host -t ns confidencetoexplore.com confidencetoexplore.com name server dns1.registrar-servers.com. confidencetoexplore.com name server dns2.registrar-servers.com.

Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @03:19PM (#19566349)
It's a malicious takeover of a domain due to a process oversight from GH. They should check if a person actually controls the domain before letting any GH user host a GH pages site on that domain.
Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @03:04PM (#19566211)
Nope. It seems to be just you. My website works https://adityar.me
Re:Ask HN: Was GitHub Hacked or Me? by scottndecker on Wednesday April 03, 2019 @03:06PM (#19566231)
As stated, it's not all my sites hosted on github. Just that one. But it's configured exactly the same as the others.
Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @03:10PM (#19566267)
There's a weird meta tag on that page, Googling it leads to more "hacked" pages:

<meta content="http://www ratiss org/ioport5.htm" property="og:url"> (spaces added to prevent it from linking)

Re:Ask HN: Was GitHub Hacked or Me? by applecrazy on Wednesday April 03, 2019 @06:42PM (#19567836)
Downvoters, scroll up. My comment is outdated, calm down.