News for hackers. Stuff that matters.
Re:We updated our RSA SSH host key by yetanotherjosh on Friday March 24, 2023 @01:48AM (#35285492)
Please before replacing your local fingerprint with the new one, double check it is the expected value. This is an opportune time for man-in-the-middle attackers to strike, knowing everyone has to replace their stored signatures, and that some will be lazy about it with a blind "ssh-keygen -R github.com" command.
Re:We updated our RSA SSH host key by p-e-w on Friday March 24, 2023 @02:15AM (#35285630)
It never fails to amaze me how most incident mitigations seem completely oblivious to such security side effects.

"We have no reason to believe that the exposed key was abused, but out of an abundance of caution, we are going to expose 50 million users to a potential MITM attack unless they are extremely careful."

Not a single word in the post about whether this impact was even considered when making the decision to update the key. Just swap the key, and fuck the consequences. Same with the mass password resets after a compromise that some services have done in the past years. Each of those is any phishing operation's dream come true.

Re:We updated our RSA SSH host key by BHSPitMonkey on Friday March 24, 2023 @02:16AM (#35285637)
How is there an alternative here?
Re:We updated our RSA SSH host key by ansible on Friday March 24, 2023 @02:20AM (#35285653)
There isn't an alternative, really. The private key has been exposed, and presumably it is unknown if or how far it has spread. The SSH keys must be changed, and the sooner the better. All that can be done is to notify people after the change has occurred.
Re:We updated our RSA SSH host key by p-e-w on Friday March 24, 2023 @02:32AM (#35285724)
> and presumably it is unknown if or how far it has spread

Why would that be unknown? GitHub has HTTP and SSH access logs, right?

Re:We updated our RSA SSH host key by tgsovlerkhgsel on Friday March 24, 2023 @02:39AM (#35285764)
Since the post doesn't mention anything like "we reviewed logs and confirm the key was not accessed", it is very likely that they either don't have logs that are reliable enough to rule it out (e.g. they may be sampled or otherwise incomplete), or that the key was accessed.
Re:We updated our RSA SSH host key by renonce on Friday March 24, 2023 @03:09AM (#35285960)
Keeping a complete log of all GET requests to random files in a public repository in a reliable way would be insane.
Re:We updated our RSA SSH host key by otoolep on Friday March 24, 2023 @03:19AM (#35286034)
No, it wouldn’t be - assuming by “insane” you mean “silly to do”. I build systems at Google that do exactly that.

Whether it’s worth the cost is a decision each company makes. Also, you don’t need to keep the log forever. Max of a few weeks retention would be common.

Re:We updated our RSA SSH host key by pbhjpbhj on Friday March 24, 2023 @05:53AM (#35287003)
Presumably, keeping 'last remotely accessed' and 'last remotely modified' for every file (or other stats that are a digest of the logs) is sane for pretty much any system too. Having a handle on how much space one is dedicating to files that are never viewed and or never updated seems like something web companies that have public file access would all want?
Re:We updated our RSA SSH host key by tgsovlerkhgsel on Saturday March 25, 2023 @08:10PM (#35309018)
What guarantees do these systems provide? Are 100% of requests where data was served guaranteed to either end up in the log or at least create a detectable "logs may have been lost here" event?

Or does it log all the requests all the time as long as everything goes well, but if the wrong server crashes at the wrong time, a couple hundred requests may get lost because in the end who cares?

Re:We updated our RSA SSH host key by est31 on Friday March 24, 2023 @10:34AM (#35289573)
It's not just GET requests. Someone could have cloned/refreshed the repo using ssh. The repo might have been indexed by github's internal search daemon which might not use the public HTTP API but uses internal access ways however those might look like. You might have purged the database of that daemon but what about backups of it? What about people who have subscribed to public events happening in the github.com/github org via the API?

You'd have to have logging set up for all of these services and it would have to work over your entire CDN... and what if a CDN node crashed before it was able to submit the log entry to the log collector? You'll never know.

Re:We updated our RSA SSH host key by blitzar on Friday March 24, 2023 @04:59AM (#35286671)
One H4X0R gave it to four friends, who in turn gave it to between 9 and 14 friends, who in turn gave it to between one and 6 friends.

If train A leaves New York going 60 miles per hour with 167 people on board and train B leaves Chicago one hour later with 361 people on board going 85 miles per hour, how many people now have the key?

The answer is 31337.

Re:We updated our RSA SSH host key by p-e-w on Friday March 24, 2023 @02:27AM (#35285694)
Same as with any other decision: Do a cost/benefit analysis of whether the security risk created by rotating the key is actually outweighed by the security risk of doing nothing, taking into account logs that should tell you whether the exposed key was indeed accessed by unauthorized parties.

To be 100% clear: Both courses of action come with associated security risks. The problem is not choosing one course of action over the other, the problem is thinking you can just skip the cost/benefit analysis because the answer is somehow 'obvious'. It's not obvious at all.

Re:We updated our RSA SSH host key by johngalt_ on Friday March 24, 2023 @02:49AM (#35285835)
No, you cannot keep using an exposed key. You must replace it. There is no cost/benefit analysis needed in this situation.
Re:We updated our RSA SSH host key by p-e-w on Friday March 24, 2023 @02:57AM (#35285882)
Wrong. A CBA is always needed. If the potential damage from MITM attacks made possible by rotating the key is greater than the potential damage from a rogue key multiplied by the likelihood that someone actually accessed the key, then it is wrong to rotate the key. It's that simple.

The only way a CBA would be unnecessary is if rotating the key didn't have any security risks. But it does.

Re:We updated our RSA SSH host key by eyelidlessness on Friday March 24, 2023 @03:14AM (#35285998)
Here I’ll do the CBA:

- if they have evidence that the key was exposed to one person, even with zero usage of the key, failing to rotate the key is tantamount to knowingly accepting widespread compromise at a potential attacker’s whim. At GitHub’s scale, that’s untenable.

- rotating the key is the only correct reaction to that

- they should have better communications in place to help users mitigate MITM

- there really isn’t an option, because they’re critical infrastructure; I’m glad they know that and acted accordingly

- on principle this speculation makes sense, but understanding the threat makes it moot

- you hopefully know that, and it’s good to insist on thoughtful security practices but it’s important to also understand the actual risk

Re:We updated our RSA SSH host key by hnlmorg on Friday March 24, 2023 @03:30AM (#35286115)
There is a MITM risk regardless of whether they rotate the key. Except one is a one time risk and the other is a perpetual risk.

Thus rotating is the only logical course of action.

Re:We updated our RSA SSH host key by p-e-w on Friday March 24, 2023 @03:38AM (#35286170)
Only if you know for certain that the key has been accessed by a third party.

If you don't know for certain, you have to factor in the likelihood that it has been, and at that point, the two risks aren't equal anymore so that logic doesn't work.

Re:We updated our RSA SSH host key by unionpivo on Friday March 24, 2023 @05:36AM (#35286903)
What if you don't know for certain ?

You just ignore it and hope for the best ?

Only if you are certain (and better be really sure you haven't missed any cache/cdn, temp files backus etc.) it wasn't accessed you do nothing.

Re:We updated our RSA SSH host key by lazide on Friday March 24, 2023 @10:37AM (#35289615)
It was publicly exposed, and if they are making this announcement it’s essentially guaranteed they can’t rule out it was accessed.
Re:We updated our RSA SSH host key by msm_ on Friday March 24, 2023 @05:41AM (#35286933)
Are you arguing for the sake of arguing and technical correctness or do you actually believe Github shouldn't rotate their key in this situation?
Re:We updated our RSA SSH host key by xign on Saturday March 25, 2023 @01:28AM (#35299755)
What? This is a terrible way to reason about risks in general. If you don't know for certain, you should assume the worst case scenario, especially since it's impossible for you to calculate the probability distribution of the likelihood of a leak.

You should only keep moving along without key rotation if you know for 100% certainty a leak didn't happen and no one accessed the key (not theoretically impossible if they had the server logs to back it up), but anything minus that and you have to assume it's stolen.

Re:We updated our RSA SSH host key by rakoo on Friday March 24, 2023 @03:45AM (#35286199)
That's why you need certificates and not just a key pair. Certificates make key rotation easier, and you want key rotation to be easy.

I guess the proper way forward is a small utility that gets the latest signature through http+tls, and replaces the line in your known_hosts file, all in the background.

Looking long term, maybe we need to get rid of all the security stuff in ssh and just pipe the rest of its functionalities inside a TLS pipe. Let the os do its certificate management, reuse security bricks that are way more studied, ...

Re:We updated our RSA SSH host key by oleganza on Friday March 24, 2023 @04:51AM (#35286613)
Certificates just add more keys to worry about. The beauty of SSH is that it does not add hugely trusted parties in the name of convenience, while the UX of TOFU (trust on first use) is pretty decent.

The real solution to break out of these UX/security tradeoffs is to put domain names on a blockchain: then you can simply rotate the key in your DNS record, while the blockchain model is such that you need to compromise many parties, instead of "one out of many parties", as with CAs.

Tracking Bitcoin chain for DNS updates is lightweight enough that it can be built into OS alongside other modern components such as secure enclave, TCP/IP stack and WiFi/BT/5G radios.

Re:We updated our RSA SSH host key by hnfong on Friday March 24, 2023 @05:03AM (#35286695)
> The beauty of SSH is that it does not add hugely trusted parties in the name of convenience

Even with a certificate authority model, you don't have to trust any CAs if you don't want to. Not having the option to do so is more of a problem.

Re:We updated our RSA SSH host key by datadeft on Friday March 24, 2023 @07:05AM (#35287476)
We should use a separate system that could reliably verify which certs belong to which entity.

Blockchain is a perfect solution to this. I wonder why it is not considered yet.

Re:We updated our RSA SSH host key by jtsiskin on Friday March 24, 2023 @01:19PM (#35292350)
Re:We updated our RSA SSH host key by datadeft on Friday March 24, 2023 @05:09PM (#35295544)
Thanks, I was not aware!
Re:We updated our RSA SSH host key by megous on Friday March 24, 2023 @11:28AM (#35290335)
Those keys can be worried about on a better secured computer, and don't need to be spread out on every frontend ssh server. Also it allows you to have each machine have a different host key pair, so if one leaks, only that single machine may have some trust issues, and not the whole fleet.

Also it's way better than TOFU, you can just add the CA key to known_hosts and avoid TOFU for each machine.

(Nevermind that you'll probably not accidentally commit some semi-ephemeral host key that's rotated often somewhere, because it will not be some special snowflake key you care about, but something handled by your infrastructure software automatically for each machine)

Re:We updated our RSA SSH host key by leetrout on Friday March 24, 2023 @06:54AM (#35287395)
Are there any cert solutions that dont involve having to maintain a revocation list? I only used certs with openvpn years ago and the CRL was a potential footgun.
Re:We updated our RSA SSH host key by goalieca on Friday March 24, 2023 @08:00AM (#35287885)
This is one reason people are issuing certs with 2 week expiry.
Re:We updated our RSA SSH host key by marcosdumay on Friday March 24, 2023 @11:21AM (#35290234)
> Certificates make key rotation easier

How easy is it to rotate the keys of your CA?

Re:We updated our RSA SSH host key by ithkuil on Friday March 24, 2023 @03:58AM (#35286275)
The alternative would be to use certificate authorities (ssh has CA support) which allow to effectively have private keys at different levels and allow you to keep the root private key in a physical vault and use it very rarely to issue other private keys
Re:We updated our RSA SSH host key by terom on Friday March 24, 2023 @05:08AM (#35286717)
And then don't forget to setup key revocation as well, and make sure that an attacker in a position to MITM the connection cannot cause the revocation checks to fail-open.

I hope you don't need that SSH connection to fix your broken CRL endpoint!

Re:We updated our RSA SSH host key by datadeft on Friday March 24, 2023 @07:06AM (#35287484)
This would just offload the problem to a separate entity. CAs can be (and have been) compromised.
Re:We updated our RSA SSH host key by ithkuil on Friday March 24, 2023 @07:38AM (#35287722)
Sure, but isn't it more likely that a key that has to be shared by who knows how many ssh load balancer machines at GitHub and can't be easily rotated because it's pinned by millions of users, isn't it more likely that that private key gets eventually compromised or thought to be at risk at being compromised?

We need to compare the relative risks within the same context, namely within a company like GitHub

So it's not relevant to bring up failures of other CAs

Re:We updated our RSA SSH host key by michaelt on Friday March 24, 2023 @04:10AM (#35286354)
Jump into a time machine, go back to the creation of SSH, and adopt SSL-style trusted third-party certificate authorities. Somehow get it adopted anyway, even though loads of people use SSH on internal networks where host-based authentication is difficult; SSH is how many headless machines are bootstrapped; and that you've got to do it 19 years before Lets Encrypt.

Jump into a lesser time machine, go back to when Github were creating their SSH key, and put it into a hardware security module. Somehow share that hardware-backed security key to loads of servers over a network, without letting hackers do the same thing. Somehow get an HSM that isn't a closed-source black box from a huge defence contractor riddled with foreign spies. Somehow avoid vendor lock-in or the HSM becoming obsolete. Somehow do this when you're a scrappy startup with barely any free time.

Re:We updated our RSA SSH host key by nibbleshifter on Friday March 24, 2023 @05:23AM (#35286825)
Ssh certificate authorities are a thing that exists.

We also have a way to put SSH host key fingerprints in DNS records already.

Re:We updated our RSA SSH host key by Arch-TK on Friday March 24, 2023 @05:31AM (#35286874)
Yes but the option to do verify host keys using ("VerifyHostKeyDNS") is not enabled by default.
Re:We updated our RSA SSH host key by roblabla on Friday March 24, 2023 @06:37AM (#35287286)
DNS can trivially be mitm'd. DNS-stored fingerprints are strictly less secure than TOFU.
Re:We updated our RSA SSH host key by tialaramex on Friday March 24, 2023 @09:40AM (#35288923)
If you use DNSSEC (cue inevitable rant from Thomas) this just works. If you have DoH (and why wouldn't you?) and your trusted resolver uses DNSSEC (which popular ones do), you get the same benefits.

https://en.wikipedia.org/wiki/SSHFP_record

Re:We updated our RSA SSH host key by datadeft on Friday March 24, 2023 @07:03AM (#35287458)
Yeah like how HTTPS CAs exist. There are some very nice three letter ones who can issue any certificate and your browser / OS happily accepts it.
Re:We updated our RSA SSH host key by BenjiWiebe on Friday March 24, 2023 @08:31AM (#35288154)
SSH doesn't have any CAs that it trusts out of the box. It's up to you to tell it which one to trust.
Re:We updated our RSA SSH host key by prussian on Friday March 24, 2023 @08:32AM (#35288170)
Unless it has changed recently, you can't have a trust chain of OpenSSH certs though so it's cumbersome that your signing key is not only the root ca but also basically has to be 24/7 accessible to sign any server/client you want to bring up.
Re:We updated our RSA SSH host key by lxgr on Friday March 24, 2023 @09:41AM (#35288931)
This just kicks the can down the road to DNS.

I'd guess that most systems aren't using DoH/DoT or end-to-end DNSSEC yet. Some browsers do, but that doesn't help tooling frequently used on the command line.

Re:We updated our RSA SSH host key by tptacek on Friday March 24, 2023 @11:15AM (#35290138)
No browser uses DNSSEC.
Re:We updated our RSA SSH host key by lxgr on Friday March 24, 2023 @11:40AM (#35290544)
That was in reference to the former, i.e. in-browser DoH/DoT lookups.
Re:We updated our RSA SSH host key by nibbleshifter on Saturday March 25, 2023 @10:43AM (#35303107)
Thank god. Someone needs to take that protocol out back and give it the old yeller treatment.
Re:We updated our RSA SSH host key by tinus_hn on Friday March 24, 2023 @07:31AM (#35287655)
There could be an update to the protocol that enables certified keys to be used and allows them to be accepted without warning or with less of a warning.

There could be a well known URL that enables people to fetch ssh keys automatically in a safe manner.

Re:We updated our RSA SSH host key by marcosdumay on Friday March 24, 2023 @11:17AM (#35290163)
> and adopt SSL-style trusted third-party certificate authorities

So that any large entity can own your servers with easy. (Well, they already can, but not through this vulnerability.)

Anyway, the only thing CAs do is to move that prompt into another, earlier time. It's the same prompt, the same possibility for MITM, and the same amount of shared trust to get wrong. You just add a 3rd party that you have to trust.

SSH does have a CA system. Anybody that isn't managing a large datacenter will avoid it, for good reason.

Re:We updated our RSA SSH host key by michaelt on Friday March 24, 2023 @12:03PM (#35291005)
> So that any large entity can own your servers with easy.

Eh, let's not pretend existing SSL certificate validation is anything to write home about.

Even without any ephemeral servers involved, barely anybody is validating cert fingerprints on first use.

And among people using ephemeral servers, 99% of applications have either baked a certificate into their image (so that any compromised host means a compromise of the critical, impossible-to-revoke-or-rotate key) - or every new server gets a new cert and users have either been trained to ignore certificate warnings, or they've disabled strict host key checking and their known hosts file.

The existing SSL cert validation options are perfect if you're a home gamer or you're running a few dozen bare metal servers with all your SSL users within yelling distance in the same office. But we all know it's a joke beyond that.

Re:We updated our RSA SSH host key by pid-1 on Friday March 24, 2023 @06:45AM (#35287343)
Clone repos using oauth2 with two factor enabled - both GitHub and GitLab support that though their CLIs.
Re:We updated our RSA SSH host key by marcosdumay on Friday March 24, 2023 @11:25AM (#35290292)
Well, at least SSH could allow for signing a new key with the old one. So they could say it's signed, and people would know to accept only a different prompt.

There is DNS verification, but people have been trained all their lives to accept insecure DNS information (and set their systems accordingly), and I really doubt the SSH client checks the DNSSEC data.

Re:We updated our RSA SSH host key by dheera on Friday March 24, 2023 @03:07AM (#35285951)
How would one stage a MITM attack without knowing the private key corresponding to the old key?
Re:We updated our RSA SSH host key by edp on Friday March 24, 2023 @03:16AM (#35286011)
The fact that users have to delete the old Github key from their systems and accept a new one is what could lead to a MITM attack.

If your system doesn't know the public key of an SSH server, when you connect the first time, the SSH client will display a warning and ask you if you accept the server key. An attacker could be between you and Github and if you accept without checking it's the correct key, you would be toast.

Re:We updated our RSA SSH host key by pbhjpbhj on Friday March 24, 2023 @05:56AM (#35287023)
Would it be more secure to access a https secured server to get the keyfile then?
Re:We updated our RSA SSH host key by tialaramex on Friday March 24, 2023 @09:59AM (#35289157)
Yes, GitHub's announcement provides the correct new public RSA key, and it also provides instructions for a curl invocation which does all the work if you don't trust yourself to copy-paste text or don't understand how.
Re:We updated our RSA SSH host key by dheera on Friday March 24, 2023 @12:38PM (#35291656)
Only if the https server cert wasn't compromised at the same time as the ssh key.
Re:We updated our RSA SSH host key by p-e-w on Friday March 24, 2023 @03:13AM (#35285985)
By pretending to be the host that the user is trying to connect to. You can then present the client with a key you generated yourself. Of course, SSH will warn the user that the fingerprint has changed, but they'll just think "Ah yes, GitHub changed their keys so it's probably fine." This is why updating the key creates a potential MITM risk, unless people actually bother to verify that the fingerprint is correct.
Re:We updated our RSA SSH host key by cogogo on Friday March 24, 2023 @07:13AM (#35287515)
What specifically can you verify that cannot also be spoofed? If I go do this now I (and I’m sure millions of others) have no idea what to look for. I’d be blindly accepting like a sheep if it weren’t for this thread.

edit: I found this helpful and honestly had no idea I should be doing this (I’m a hobbiest not a professional) https://bitlaunch.io/blog/how-to-check-your-ssh-key-fingerpr...

Re:We updated our RSA SSH host key by Karliss on Friday March 24, 2023 @03:20AM (#35286042)
The key has changed, meaning that every user has to accept a new key.

Meaning that a lot of users will blindly accept whatever new key (even when it might be the one owened by attacker doing MITM) because Github, their college or random person on internet said that that's what you have to do to get rid of error.

Re:We updated our RSA SSH host key by iso1631 on Friday March 24, 2023 @05:50AM (#35286992)
Fortunately this will become evident once they connect from elsewhere and the key changes again
Re:We updated our RSA SSH host key by macintux on Friday March 24, 2023 @07:29AM (#35287636)
Not strongly evident. I suspect most users would assume they did something wrong, or that GitHub was still making changes.
Re:We updated our RSA SSH host key by tialaramex on Friday March 24, 2023 @10:03AM (#35289199)
> Meaning that a lot of users will blindly accept whatever new key (even when it might be the one owened by attacker doing MITM)

This is less likely because unlike for TOFU the SSH client just rejects the mismatch and insists you take manual action, and the likely manual action will be "Paste this stuff from the announcement".

So an adversary needs to either subvert whatever messaging you see (which is tricky, likely impossible for a random user visiting the github web site wondering what's wrong) or hope that you just try to muddle along and do TOFU again, putting you in the same spot as a whole bunch of users every day at GitHub.

Re:We updated our RSA SSH host key by ZiiS on Friday March 24, 2023 @03:14AM (#35285995)
if you run a MITM attack today the victim gets the warning in the blog post. Thier most likly action is to google the blog post and see it is expected and and so accept your fake key. Having said that I dont see what choice Github had, they can't continue to use a leeked key.
Re:We updated our RSA SSH host key by ddtaylor on Friday March 24, 2023 @05:19AM (#35286802)
Their solution is the second thing in the blog post which is demand into your known host file.

The problem here is that their first command that they advise using is the one that removes the old key and most users are just going to stop right there because it solves the problem of getting the key warning.

The right solution here is to provide a command that most users are going to copy and paste that deletes the old key and adds the new key all at once.

Re:We updated our RSA SSH host key by stouset on Friday March 24, 2023 @03:13AM (#35285984)
They don’t need it. Millions of users are going to blindly trust the “new” GitHub public SSH key they see the next time they connect without checking to see if it matches the published signature.
Re:We updated our RSA SSH host key by faeriechangling on Friday March 24, 2023 @04:37AM (#35286522)
While their reaction is more likely to cause a security breach, consider the psychology.

If the key was breached and Github just didn't know it, then a breach happened, then only Github would be to blame. If Github rotates its key, and somebody suffers a MITM attack, the blame is more diffuse. Why didn't you verify the key out of band?

Re:We updated our RSA SSH host key by justeleblanc on Friday March 24, 2023 @04:54AM (#35286631)
I'm always amazed at this kind of posts. Did these 50 million users (surely none of them use git+https!) check the host key the first time they connected to github? Did you?
Re:We updated our RSA SSH host key by arianvanp on Friday March 24, 2023 @05:29AM (#35286863)
It doesn't matter because it didn't change! That's the beauty of TOFU.
Re:We updated our RSA SSH host key by msm_ on Friday March 24, 2023 @05:33AM (#35286887)
The point is, what if it you were MITMed from the beginning?
Re:We updated our RSA SSH host key by emn13 on Friday March 24, 2023 @07:57AM (#35287864)
Sure, but the difference is that it's now both a plausible moment to go MITM (because they got that key), and furthermore the hypothetical attacker now has good reason to believe users won't be scared by a host-key-change warning, and the hypothetical attacker would know this opportunity exists for a large set of users simultaneously. If some malicious network operator were to try and exploit users, now would be a good moment - they'd likely catch many more people in the time it takes to be discovered than on an average day.

The MITM-at-the-start risk is of course real, but I think this new everyone -restarts-simultaneously risk is qualitatively different enough to be worth at least considering.

Re:We updated our RSA SSH host key by lxgr on Friday March 24, 2023 @04:46PM (#35295220)
Much more concerningly, there is an activated-by-default OpenSSH extension (`UpdateHostKeys`) that allows the server to install new host keys into `.ssh/known_hosts` after every successful server authentication.
Re:We updated our RSA SSH host key by tlb on Friday March 24, 2023 @09:51AM (#35289080)
The bad guys would also have to have MITMed it every time I connected for the last 15 years, or I would have seen authentication failures when it connected to the real thing. MITMing someone once isn't that hard, but doing it consistently is.
Re:We updated our RSA SSH host key by arianvanp on Friday March 24, 2023 @05:31AM (#35286876)
It doesn't matter because it didn't change! That's the beauty of TOFU.

One way to solve this in TOFU is to have a time window where both keys are presented.

Re:We updated our RSA SSH host key by justeleblanc on Friday March 24, 2023 @07:48AM (#35287792)
If we're starting from the assumption that the first key was compromised, then you're still vulnerable to MITM. The only solution is communicating the key through a different, trusted way. Which is exactly what github did - inasmuch you can trust that github.com is github.
Re:We updated our RSA SSH host key by 1317 on Friday March 24, 2023 @07:59AM (#35287879)
> (surely none of them use git+https!)

well, yes

github doesn't accept https push any more

Re:We updated our RSA SSH host key by akerl_ on Friday March 24, 2023 @08:58AM (#35288427)
Not sure what you mean. You can push via HTTPS: https://docs.github.com/en/get-started/getting-started-with-...

Maybe you’re referring to how they no longer accept passwords for HTTPS auth? You have to auth for HTTPS push with a personal access token.

Re:We updated our RSA SSH host key by tracker1 on Friday March 24, 2023 @09:51AM (#35289071)
That's funny, I do it every day. It's frankly easier to install git credential manager (even integrate into WSL) for 2FA authentication on Github (and other git hosts).

I get a bit paranoid when having to deal with Tokens on various CI/CD environments as it stands. And the things that start breaking every year when I forget to update them. Note: this is personal/hobby projects, not corporate stuff, where I'm strictly in the codebase and try to keep my fingers out of CI/CD beyond getting a Docker image built, and someone else configures the keys/auth.

Re:We updated our RSA SSH host key by akerl_ on Friday March 24, 2023 @10:16AM (#35289349)
How are you using git credential manager for 2fa on GitHub? They stopped supporting user/password auth for HTTPS git access a while back, and started requiring personal access tokens (which do not require a 2nd factor)
Re:We updated our RSA SSH host key by tracker1 on Friday March 24, 2023 @10:52AM (#35289811)
GCM will use an embedded browser so you can authenticate with the UI including your second factor, which will then give you a credential/token that can be used in the git environment over HTTPS. It's still a (differt, oath vs reference generation) token, but you aren't having to go generate, configure and update it yourself.
Re:We updated our RSA SSH host key by eadmund on Friday March 24, 2023 @07:21PM (#35297027)
> Did you?

I sure did. Doesn’t everyone?

Re:We updated our RSA SSH host key by xign on Saturday March 25, 2023 @01:20AM (#35299711)
The point being made here is that because there are millions of users forced to change keys now all at around the same time, and because they are doing so due to seeing an error in Git, this creates a good opportunity to strike. Normally, most users would have connected to GitHub before and a MITM attack has a high chance of failure.
Re:We updated our RSA SSH host key by tomp on Friday March 24, 2023 @04:58AM (#35286661)
Don't trust corporate PR. They're obviously lying when they say "out of an abundance of caution". The private key was exposed in a public GitHub repo, it could literally be anywhere.

So MITM for some of 50m users is strictly better than MITM for all of 50m users.

Re:We updated our RSA SSH host key by the_other on Friday March 24, 2023 @05:38AM (#35286916)
It could be, but also GH might be logging inbound requests long enough to see whether the file was requested.
Re:We updated our RSA SSH host key by theteapot on Friday March 24, 2023 @06:29AM (#35287230)
> The private key was exposed in a public GitHub repo.

How do you know this?

Github runs scanner for private keys in public and private repos and notifies owner (I did it once so I know ... ;)). So some Github engineer likely would have received such an email if what you say is true. Hilarious.

Re:We updated our RSA SSH host key by Veen on Friday March 24, 2023 @06:31AM (#35287249)
It says exactly that in the article:

> This week, we discovered that GitHub.com’s RSA SSH private key was briefly exposed in a public GitHub repository

Hilarious.

Re:We updated our RSA SSH host key by theteapot on Friday March 24, 2023 @06:56AM (#35287418)
I didn't read it fully before commenting. I'm sorry.
Re:We updated our RSA SSH host key by comprev on Saturday March 25, 2023 @09:43AM (#35302544)
If everyone read the entire article of each HN submission the comments section would be wildly different :-)
Re:We updated our RSA SSH host key by adrr on Friday March 24, 2023 @08:06AM (#35287938)
I can’t see that could ever happen. Is the key just floating around on their employees computers and skeins accidentally committed it?
Re:We updated our RSA SSH host key by roblabla on Friday March 24, 2023 @06:34AM (#35287262)
Maybe because the article says so?

> This week, we discovered that GitHub.com’s RSA SSH private key was briefly exposed in a public GitHub repository

Re:We updated our RSA SSH host key by 3np on Friday March 24, 2023 @06:31AM (#35287248)
From the OP:

> This week, we discovered that GitHub.com’s RSA SSH private key was briefly exposed in a public GitHub repository.

Re:We updated our RSA SSH host key by new2yc on Friday March 24, 2023 @08:10AM (#35287981)
After reading first paragraph, I was sure they don't have any specific reason to replace it.

> leaked in public repo

Me: Yeah, that's why they are doing it.

Re:We updated our RSA SSH host key by mihaaly on Friday March 24, 2023 @05:30AM (#35286871)
Is there a benefit (and practicality) in recording encrypted traffic by an adverse intermediary waiting for keys being exposed sometime? Like now?
Re:We updated our RSA SSH host key by KAMSPioneer on Friday March 24, 2023 @05:34AM (#35286891)
No, the risk of losing an SSH host key is less this (because of forward secrecy), rather impersonation of the server.
Re:We updated our RSA SSH host key by tgsovlerkhgsel on Friday March 24, 2023 @02:37AM (#35285751)
They provide convenient commands to import the correct keys. It would probably be better to only include the block that contains both the -R and the update command, but at least they do provide them.
Re:We updated our RSA SSH host key by brabel on Friday March 24, 2023 @02:43AM (#35285785)
I've updated the key in known_hosts, then was able to connect successfully.

What do I have to do to ensure I connected to the right server?? I thought just making sure the correct RSA key was in known_hosts would be enough?

Re:We updated our RSA SSH host key by snorremd on Friday March 24, 2023 @04:11AM (#35286363)
That is enough, given that you've fetched or compared the key from a trusted GitHub.com server.
Re:We updated our RSA SSH host key by nirimda on Friday March 24, 2023 @04:58AM (#35286662)
It depends on how you found out what the new key value is. By the sounds of your description, you're fine. But in principle there's more than one way people could proceed from here.

If you read the blog post on a verified domain and saw the new key and updated manually, or you deleted the known key and verified the key fingerprint when it warned you about an unknown key, you should be good to go. Here, you trust the people who issue TLS certificates and you trust github to be in control of their domain name, so you can be reasonably confident that the key they advertised on their website is the correct key. If your internet connection was compromised, you would have got an error message when you connected to https://github.blog (because they wouldn't have a certificate from a trusted certificate issuer) or when you connected to the git server (because they wouldn't have the key you just trusted).

If you saw the blog post and then removed the old key and told ssh to save the new key it's receiving without checking it matches the value on the webpage, you might have a problem. The connection to github's ssl could have been compromised, and if you just accepted whatever it told you, you have no trusted intermediate to verify that the key is trustworthy. All you know is that each time you connect to github's server hereafter, you're either connecting to a server with the same key (no error), or you're connecting to one that doesn't have the same key (error message). But whether you can trust that key? You don't know that. You just know it's the same key.

But even if you did the latter, all is not lost. You can look at the known_hosts file (on Linux and MacOS it's ~/.ssh/known_hosts) and check the fingerprint. If it's what they advertise, then you're good to go. If it's different, you should fix it and find people who can help you deal with a security incident.

The reason people are raising a flag is that today, lots of people will be rotating their key. That means if you're looking to target someone, today is the day to do it. Even if 90% of people do it the proper way, by manually verifying the key, that still means there's going to be a lot of people who could be victimised today.

Re:We updated our RSA SSH host key by defanor on Friday March 24, 2023 @02:48AM (#35285822)
Here are the expected fingerprints (since they don't publish those via SSHFP RRs): https://docs.github.com/en/authentication/keeping-your-accou...

    SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s (RSA)
    SHA256:br9IjFspm1vxR3iA35FWE+4VTyz1hYVLIE2t1/CeyWQ (DSA - deprecated)
    SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM (ECDSA)
    SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU (Ed25519)
Re:We updated our RSA SSH host key by cwillu on Friday March 24, 2023 @03:03AM (#35285921)
Note the MITM here :)

We humans really aren't cut out for this, are we.

Re:We updated our RSA SSH host key by darthrupert on Friday March 24, 2023 @04:45AM (#35286587)
What MITM? What are you talking about?
Re:We updated our RSA SSH host key by fulafel on Friday March 24, 2023 @04:52AM (#35286622)
The poster of the fingerprints is in the middle, you are not getting them from GH if you use them instead of going to the linked page.
Re:We updated our RSA SSH host key by vxNsr on Friday March 24, 2023 @04:52AM (#35286624)
This is literally a man in the middle between you and GitHub.
Re:We updated our RSA SSH host key by nicky0 on Friday March 24, 2023 @04:57AM (#35286658)
If someone wanted to trick HN users into trusting a phoney key, one way to do that would be to post the phoney fingerprint on HN claiming it to be the real one.
Re:We updated our RSA SSH host key by iso1631 on Friday March 24, 2023 @05:51AM (#35286997)
And within a few seconds someone will have called this out in a reply
Re:We updated our RSA SSH host key by macintux on Friday March 24, 2023 @07:30AM (#35287650)
Assuming the person doesn’t have some back door access to HN as well.
Re:We updated our RSA SSH host key by detrites on Friday March 24, 2023 @07:57AM (#35287862)
Or they don't simply wait a while and edit it when it's not under high scrutiny.
Re:We updated our RSA SSH host key by iso1631 on Tuesday March 28, 2023 @04:24AM (#35337426)
You can only edit for a certain amount of time
Re:We updated our RSA SSH host key by pferde on Friday March 24, 2023 @06:03AM (#35287066)
And if someone would actually fall for this, they deserve to be fired, and/or never allowed anywhere near anything related to computer security. :)
Re:We updated our RSA SSH host key by misnome on Friday March 24, 2023 @06:40AM (#35287309)
I mean, yes, but you'd also have to have a way to actually MITM the person you are targeting via HN comment, before anyone pointed out it was wrong. It'd be much easier to just use the MITM you already have and not raise the suspicion of posting in a comment.
Re:We updated our RSA SSH host key by nicky0 on Friday March 24, 2023 @01:05PM (#35292103)
Don't overthink this.
Re:We updated our RSA SSH host key by coryfklein on Friday March 24, 2023 @11:36AM (#35290484)
Why downvote this person! The parent post left plenty of ambiguity in their comment. Are they saying that an actual MITM attack is happening? That the fingerprints shared are actually the wrong ones?

Generally speaking, one would not consider an internet comment directing folks to GitHub's actual SSH fingerprints a "man in the middle" as the phrase in this context usually has a negative implication, where in this case defanor is in fact simply mirroring the actual information that GitHub has officially posted in a way that is much more helpful than yetanotherjosh's "double check it is the expected value". For most of us idiots, we don't know what the expected value is!

So thank you defanor for sharing, and thank you darthrupert for asking for clarification. Y'all contributed to educating myself and others and now we know more because of it.

Re:We updated our RSA SSH host key by darthrupert on Friday March 24, 2023 @01:17PM (#35292313)
Ah, okay. I thought this was obvious that the keys in the comment were just for show, and if anyone would need the actual keys, they would be looked via the GH link anyway.

Good clarifications everywhere, yes.

Re:We updated our RSA SSH host key by cesarb on Friday March 24, 2023 @10:07AM (#35289239)
On the other hand, this is a nice TOFU-style double check. The first time HN user "defanor" went to that page, these were the fingerprints; if later someone somehow invades the github documentation server (or somehow MITMs your HTTPS connection to it), and changes the fingerprints there, they will no longer match the ones saved in the comment above.
Re:We updated our RSA SSH host key by NelsonMinar on Friday March 24, 2023 @11:28AM (#35290329)
Well, "defanor" says these were the fingerprints. Perhaps they are the MITM.

(Not genuinely concerned about this risk, but "Reflections on Trusting Trust" reverberates.)

Re:We updated our RSA SSH host key by defanor on Friday March 24, 2023 @11:50AM (#35290737)
Indeed, at least for verification. I didn't mean for HN users to trust those, but perhaps should have warned about it: copied the fingerprints primarily for people searching on this page, so that they can follow the link to GitHub (and rely on PKIX to build a trust chain). I did `ssh-keygen -R github.com` myself, and saw the ECDSA key's fingerprint while connecting (which wasn't mentioned in the linked post, and wasn't on this page either), so figured it would be somewhat helpful for others following the same route.
Re:We updated our RSA SSH host key by yosito on Friday March 24, 2023 @02:54AM (#35285862)
> double check it is the expected value

Not all of us are familiar enough with the SSH protocol to understand how to "double check the expected value"? Where can I determine what the expected value should be?

Re:We updated our RSA SSH host key by Gravyness on Friday March 24, 2023 @03:01AM (#35285907)
Run "ssh -T [email protected]" command.

It should error like this:

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
    Please contact your system administrator.
Note that the SHA256 present there matches perfectly the one github send. If you don't remember the very first time you connected to github you also had to accept the key. The warning above shows up because the server is saved as a different RSA, for the SSH client it seems that someone setup a server for github but has a different key, which could mean someone is trying to trick you into connecting into the wrong server. This could also mean that github changed their RSA key which is why they published this article.
Re:We updated our RSA SSH host key by pbhjpbhj on Friday March 24, 2023 @06:03AM (#35287063)
The fingerprint is a hash of the key, so in theory -- say with a quantum computer -- I could create a key that's different and provides a hash-collision. Is that right?

It would just take many ages of the universe, at present, to calculate a collision, right?

Re:We updated our RSA SSH host key by 8organicbits on Friday March 24, 2023 @07:49AM (#35287802)
There's a narrow window for that attack. The fingerprint is only used on the first connection, for manual verification. Any later connections would check the ~/.ssh/known_hosts which has the full public key.

If you somehow can MITM an SSH connection on the first connection, you can probably use any key. Most people don't check the fingerprint.

But you are correct, computing an SSH key with a collisionwis expected to take an infeasible amount of time/energy with current understanding of crypto and available computers.

Re:We updated our RSA SSH host key by Dylan16807 on Friday March 24, 2023 @03:03AM (#35285923)
Look for the part of the article that says "the following message"

Or the parts below it about updating and verifying in other ways.

Re:We updated our RSA SSH host key by yetanotherjosh on Friday March 24, 2023 @11:23AM (#35290261)
A key part of avoiding MITM is to get the values from an authoritative origin, not comments on HN, so the link is here:

https://docs.github.com/en/authentication/keeping-your-accou...

Yes, this assumes the github-hosted docs and your SSL connection to them are not also compromised, but it's far better than not checking at all.

Re:We updated our RSA SSH host key by datadeft on Friday March 24, 2023 @07:01AM (#35287446)
Certificate pinning check built in when?

We should have a blockchain for certificates btw. That would be such an amazing solution to this problem. You could advertise ahead of the time that you are changing certificates and we could verify that it was in fact you.

Re:We updated our RSA SSH host key by rpigab on Friday March 24, 2023 @07:14AM (#35287525)
Double-check with what source? The one mentionned in docs.github.com?

I assume it's safe because the SSL cert for docs.github.com is probably not compromised, so it's giving us the right key, and compromising docs.github.com would be extra effort and is unlikely to happen.

However, I wonder what kind of steps an MITM attack would have to perform, I assume one of the easiest would be compromising my local DNS server, since regular DNS does not offer a high level of security, then github.com resolves to the attacker's IP and the attack works. Do you have examples of such attacks that don't involve a virus already active on the end user's PC? Maybe if someone owns an IP previously owned by Github that is still somehow advertised as being Github by some DNS lagging behing?

Re:We updated our RSA SSH host key by 8organicbits on Friday March 24, 2023 @07:34AM (#35287698)
This is always a concern with SSH as it uses trust on first use. The first time you connect it shows you the fingerprint for out of band verification. That manual step is on you to perform, but most people skip it. Future visits check against the saved fingerprint.

The best practice is to verify the fingerprint out of band using a secure channel. In this case, that's HTTPS and docs.github.com. If (hypothetically) docs.github.com was also compromised, then you don't have a secure channel.

https://en.m.wikipedia.org/wiki/Man-in-the-middle_attack has some MITM examples.

Re:We updated our RSA SSH host key by bityard on Friday March 24, 2023 @11:15AM (#35290126)
SSH host certs would make this a non-issue, and I've often wondered why GitHub doesn't use them.
Re:We updated our RSA SSH host key by aidenn0 on Saturday March 25, 2023 @01:33AM (#35299776)
Or just use the posted command to fetch the fingerprint over ssh and automatically add it to your known hosts?
Re:We updated our RSA SSH host key by devenvdev on Wednesday March 29, 2023 @05:45AM (#35354788)
There should be a StackOverflow Streisand effect, at first, I peeked at the end of your comment to copy-paste the ssh-keygen string "solution".