Slashdot Mirror


OpenSSH Will Feature Key Discovery and Rotation For Easier Switching To Ed25519

ConstantineM writes: OpenSSH developer Damien Miller has posted about a new feature he implemented and committed for the next upcoming 6.8 release of OpenSSH hostkeys@openssh.com — an OpenSSH extension to the SSH protocol for sshd to automatically send all of its public keys to the client, and for the client to automatically replace all keys of such server within ~/.ssh/known_hosts with the fresh copies as supplied (provided the server is trusted in the first place, of course). The protocol extension is simple enough, and is aimed to make it easier to switch over from DSA to the OpenSSL-free Ed25519 public keys. It is also designed in such a way as to support the concept of spare host keys being stored offline, which could then seamlessly replace main active keys should they ever become compromised.

88 comments

  1. Seamlessly replace keys? by Anonymous Coward · · Score: 1

    How about 'no'.

    1. Re:Seamlessly replace keys? by stoborrobots · · Score: 5, Insightful

      Agreed - this makes sense if you want to display a message to the user: "The server is advertising updated host keys via the trusted channel. Do you want to add them to your local host key list?"; but automatically replacing them without prompting seems overeager...

    2. Re:Seamlessly replace keys? by stoborrobots · · Score: 1

      Although, in hindsight - you've already authenticated the server, so you are going to treat it as a trusted party anyway...

    3. Re: Seamlessly replace keys? by Anonymous Coward · · Score: 1, Interesting

      Yeah, but it's also easier to compromise a host, send out fake server keys, and then patch things up so the server looks fine again but intercept targeted clients. Even if the server would push out only its current whitelisted keys and they completely replaced known_hosts, users who are already MitM'd wouldn't see that until they can establish a connection to the real server, which they might not even trust anymore due to known_hosts being changed by the MitM. In short, it sounds dangerous. By all means sign the ECDA25517 keys with existing trusted keys, but don't just overwrite anything.

    4. Re:Seamlessly replace keys? by Anonymous Coward · · Score: 2, Interesting

      Although, in hindsight - you've already authenticated the server, so you are going to treat it as a trusted party anyway...

      Agreed, but *I* would still like to be prompted anyways. The same way when it comes to things like windows or app "automatic updates" I always pick the "notify me, but don't download/update without asking" option. I like to *know* what's happening to my systems, and have the option to say NO, even if it's probably unlikely.

    5. Re:Seamlessly replace keys? by Anonymous Coward · · Score: 0

      It's one thing to trust the server to be who you expect it to be.

      It's something completely different to trust that server to tell you how to authenticate all the other servers that you know about. That requires a LOT more trust than "this server is the one I expected"

    6. Re: Seamlessly replace keys? by unrtst · · Score: 2, Insightful

      Yeah, but it's also easier to compromise a host, send out fake server keys, and then patch things up so the server looks fine again but intercept targeted clients. ...

      I didn't RTFA, but based on the summary it seems like this is unlikely.
      If you can compromise a host to the point that you have read access to the private host key, then your MITM can simply use that private key. No need to change to a new key to exploit that. AFAICT, you would need access to the existing host key pair in order to sign the new keys. If this was done right, then it seems like this would be adding very little (if any) additional risk.

      That said, I'd want to have the option of being prompted. I could set that for all my interactive shells (or it could be the default), and I could set my automated jobs to auto-sync the new keys.

    7. Re:Seamlessly replace keys? by paavo512 · · Score: 2

      It's one thing to trust the server to be who you expect it to be.

      It's something completely different to trust that server to tell you how to authenticate all the other servers that you know about. That requires a LOT more trust than "this server is the one I expected"

      This is not what this is about. TFA talks only about updating keys for the same server as far as I can see.

    8. Re:Seamlessly replace keys? by Anonymous Coward · · Score: 1

      Please educate yourself about the difference between a public key and a private key. The keys being talked about here are the server's public keys. This is about verifying who the SERVER is. This has ZERO to do with actual authentication, just verification that you are talking to who you think you are talking to.

    9. Re: Seamlessly replace keys? by Anonymous Coward · · Score: 0

      Notiffication: a String has been copied into your RAM. You are reading it right now

    10. Re:Seamlessly replace keys? by ToasterMonkey · · Score: 1

      How about 'no'.

      If you didn't trust your connection to the server in the first place, then what was the point of using SSH?

    11. Re: Seamlessly replace keys? by Anonymous Coward · · Score: 0

      Unless there are other holes in the host that allow remote addition of server keys, but not stealing them directly. Say some logging facility that can be abused to add but not overwrite files in /etc/ssh

    12. Re: Seamlessly replace keys? by unrtst · · Score: 1

      Unless there are other holes in the host that allow remote addition of server keys, but not stealing them directly. Say some logging facility that can be abused to add but not overwrite files in /etc/ssh

      Nope. The new keys would need to be signed by the original key. So, even if you can add new files to /etc/ssh, you'd still need read access to the private host key. If you have read access to that, you can just steal it carte blanche and use it on your MITM.

      Granted, I'd still probably keep the feature disabled [server side] until I needed to use it. For example, if you want to rotate your host key, then:
      1. make the new keys and sign them with the old key
      2. update sshd_config to enable the feature
      3. let it run like that for a week or so
      4. disable old keys and the config entry
      That should make it seemless for those that want it seemless and significantly reduce admin costs while not introducing significant risk (updating the host key cache on the client side of 100's/1000's of devices is bound to introduce more risk).

    13. Re:Seamlessly replace keys? by Anonymous Coward · · Score: 0

      And how exactly am I as a user supposed to respond to such a dialogue box? I cannot possibly know whether to click Yes or No. I might click either, and continue to work fearing I've made a horrible mistake, but it's much more likely that I'll simply switch to a competing piece of software that doesn't show the dialogue box.

    14. Re:Seamlessly replace keys? by BarbaraHudson · · Score: 1

      Although, in hindsight - you've already authenticated the server, so you are going to treat it as a trusted party anyway...

      There's trust, and then there's TRUST. Doing something like this automatically is like doing automatic updates ... not a good idea.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    15. Re:Seamlessly replace keys? by stoborrobots · · Score: 1

      You need slightly more understanding to go with your reading:

      "Authentication" means "verification that you are talking to who you think you are talking to".

      In SSH, before you send your authentication information to the server (for it to verify that it is talking to you), the server first sends it's own public key, and specific message signature with the corresponding private key. Your client checks if the public key is already known as belonging to the server (by checking known_hosts), and if not, asks if you are willing to trust the key. If you say yes, the client computes the same specific message, checks if the signature sent matches the message and public key. If this succeeds, then your client has successfully authenticated the server (verified that it is right server), and can trust that it is not a "man-in-the-middle" trying to steal your password.

      After this, your client sends your authentication information to the server, and the server looks up your password in the password database, or verifies your public key, or whatever, to check your info. If this succeds, the server has authenticated your client, (verifed that your client is under your control), and can trust your client to run commands under your user id.

    16. Re: Seamlessly replace keys? by Anonymous Coward · · Score: 0

      Id would wager a guess, >90% of people using or deploying ssh servers are not newbs. they know command line and can find their way around. This isnt winamp vs itunes. this is software that admins have used and trusted for years on end.

      also the people blindly clicking thru dialogs are not admins and are not the ones deployong these servers with this added feature. The people logging in and blindly clicking thru those dialogs have 0 say so and no input in what remote software gets used on ANY server. hell most of the time they dont get a say in what SW runs on their own dedicated work computer.

      your user scenario seems highly unlikely to me.

  2. Trust Noone by Anonymous Coward · · Score: 0

    Not sure I trust a central repository of trust.

    1. Re:Trust Noone by Anonymous Coward · · Score: 0

      The Git address of OpenSSH portable has also been spuriously set to "anongit.mindrot.org".

    2. Re:Trust Noone by Anonymous Coward · · Score: 0

      Uh, that's the correct address for the openssh git repository. I'm not clear on what you think is the problem.

    3. Re:Trust Noone by Anonymous Coward · · Score: 0

      A smart guy's alarm bell should ring when they see a hostname like that. Sure, it likely is the official address, but it looks precisely something like replaced by a cracker. Don't you think it would create more confidence if it was "anongit.openssh.com"? I certainly am tempted to verify if the domain "mindrot.org" actually belongs to the OpenSSH team before downloading anything from there.

    4. Re:Trust Noone by Anonymous Coward · · Score: 0

      wow.

      So, if a name sounds legit, you trust it? You are not a smart guy.

      You should know what the correct name is, and trust that.

      lick.your.mama might be the right address, but you.can.trust.me might be Russians stealing your credit card.

    5. Re:Trust Noone by Anonymous Coward · · Score: 0

      Not sure I trust a central repository of trust.

      But... the NSA... your country is relying on you to be a trusting "Patriot". (/sarcasm)

    6. Re:Trust Noone by Anonymous Coward · · Score: 0

      If I'm unfamiliar to the site, it's hard to tell which is the correct name. There's a higher chance that subdomains under openssh.com are properly maintained by OpenSSH, rather than the ones under mindrot.org.

    7. Re: Trust Noone by Anonymous Coward · · Score: 0

      ...No, you really are a fucking idiot. If you think a name and a .com at the end are enough to verify the identity or ownership of a given site, you're a fucking idiot so ignorant of how the internet works that you shouldn't be on it in the first place. Fucking tard.

  3. How about; by Anonymous Coward · · Score: 0

    How about you feature less bugs and better security before adding new stuff we aren't really ask for ....?

    1. Re:How about; by ThatsMyNick · · Score: 5, Informative

      OpenSSH is not buggy and has good security already. You must be thinking of the OpenSSL.

    2. Re:How about; by Anonymous Coward · · Score: 0

      You == idiot

    3. Re:How about; by IAMBatman · · Score: 0

      You have clearly never looked at OpenSSH code; it took me 5 minutes to find programming practices that only a novice programmer would use. They are using ancient development methodologies and as such they are an easy target for any modern crypto-department of some national security agency. If I had enough free time, I would blow a hole the size of the Titanic in OpenSSH just to make people like you shut up.

    4. Re:How about; by Anonymous Coward · · Score: 1

      total hogwash. examples please or you're just spouting nonsense like a raving lunatic.

    5. Re:How about; by Anonymous Coward · · Score: 0

      OpenSSH is not buggy and has good security already. You must be thinking of the OpenSSL.

      I guess you missed the news stories about NSA owning SSH and having great successes decrypting SSH traffic.

      Have fun going over these:

      http://www.spiegel.de/international/world/nsa-documents-attacks-on-vpn-ssl-tls-ssh-tor-a-1010525.html

    6. Re:How about; by fahrbot-bot · · Score: 1

      total hogwash. examples please or you're just spouting nonsense like a raving lunatic.

      Please note that he, apparently, is Batman so ...

      --
      It must have been something you assimilated. . . .
    7. Re:How about; by Anonymous Coward · · Score: 0

      1. Looking at code for five minutes indicates with certainty all the programming practices used in an OSS project.
      2. Development methodology age indicates how insecure software is that uses it.
      3. Someone has enough time to see that an OSS project has security issues and enough time to be petulant about it on slashdot in reply to a tangentially related post, yet does not have enough time to show why.

      All three of these are irrational at best.

    8. Re:How about; by Anonymous Coward · · Score: 0

      Mentions SSH only once.

      Source slide says "potentially recover users and passwords".

      That is NSA saying it. Does not look very insecure.

  4. NSA would have loved this ! by Taco+Cowboy · · Score: 1

    How can NSA not loving this feature?

    I mean, the two way encrypted channels between userA and serverA, if NSA would like to crack it, they would need to invest some crunch time just to take a peek

    With this new protocol all NSA needs to do is to perform a MITM act ... get the info needed and then tell the user (and the server) to update keys and such

    Mission accomplished !

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:NSA would have loved this ! by thegarbz · · Score: 5, Insightful

      Correct me if I'm wrong but this can only take place after a fully authenticated session.

      If the NSA is in a position to MITM this connection then they are likely already in the possession of all necessary keys at either end and gain nothing by being able to send the client and server new keys.

    2. Re:NSA would have loved this ! by Anonymous Coward · · Score: 4, Insightful

      How can NSA not loving this feature?

      I mean, the two way encrypted channels between userA and serverA, if NSA would like to crack it, they would need to invest some crunch time just to take a peek

      With this new protocol all NSA needs to do is to perform a MITM act ... get the info needed and then tell the user (and the server) to update keys and such

      Mission accomplished !

      Let's not go over the top with this. When you say "all NSA needs to do is to perform a MITM act" you are forgetting that the default for SSH is to abort during a MITM. That means they are back at needing "to invest some crunch time just to take a peek". The only loss is that, if they did compromise a server or manage to get into the encrypted channel they could potentially leverage that for a silent compromise of the client side key without thaat being visible on the host. It's still a pretty high risk attack for pretty low gain compared to what they have to already have (the ability to compromise some SSH connections).

      Firstly, let's not just talk about the NSA. There are plenty of other bad actors and don't forget the Chinese and Russians also have pretty hot capabilities. Weakening crypto helps the enemy of all kinds. People who suggest reducing encryption knowing that, and I think most of them do, are traitors.

      There should be a warning on key replacement or, better, a warning when the new key is taken into use. This would be important in the case where the enemy could compromise some connections but not others and then use key replacement to escalate that to all connections.

    3. Re:NSA would have loved this ! by DarkOx · · Score: 1

      Right, I don't see much risk here, and probably loads of to gain in terms of replacing old DSA keys. The only place where I see something like this complicating things in terms of security is now the key store might be changing without user awareness so if you are doing something like having the key store monitored with tripwire or the like you might have an issue.

      I suspect people who are going to those kind of lengths probably parse the change logs to security central items like openssh pretty carefully before updating and have the knowledge to develop appropriate solutions to cope with the change, even if that means a patch to reverse the behavior. I am not worried, I think this will make most folks better off.

      --
      Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
    4. Re:NSA would have loved this ! by Anonymous Coward · · Score: 0

      [the NSA] gain nothing by being able to send the client and server new keys.

      You are subtly wrong as mentioned in my other post. Crypto systems and crypto implemetnations break in many different ways. Also different systems have different levels of awar would eness.

      Let's say that the NSA is targeting a particular person but doesn't care aboiut other users using a particular server. Alternatively imagine the situation where they know that a compromise of the server is likely to be spotted but client security is much worse. In both of these cases they could replace the key on the client's laptop and then continue to do MITM attacks on the client without having to leave any trace on the server.

      An alternative attack would be in the situation where they can only occasionally compromise the session of a user. In this case, by replacing the key they could do further compromises in future on every session.

      Each of these attacks is quite dangerous and doesn't gain much. An exchanged key can be spotted; the MITM attack probaby has to be done every time the client connects in future; they would probably only work against users who are willing to password authenticate; However, as Bruce Schneier says "attacks always get better, they never get worse".

      The correct solution is to bring the security level up to the same one as normal by allowing the user (at least) an option of being notified on key changes. The paranoid among us could then verify and that protects everyone.

    5. Re:NSA would have loved this ! by Anonymous Coward · · Score: 1

      Until that one time they forget to MITM them, and suddenly the client talks directly to the server and throws an error or removes the rogue key because the server no longer advertises it. It still comes down to that in order to do your attack, they need to compromise the server in the first place and they gain little benefit for a lot of risk by injecting fake keys.

      As it stands, there is a very real risk posed by not being able to easily update keys. I have a lot of automated scripts that connect to remote servers where the admins are complete idiots and are constantly changing keys without warning. There is no way I can validate every key change, so I just blinding accept the new key. If this allows me to not have to take time out of my day and not have to just accept a new random key that has no relation to the last one, this is win win for me.

      As long as this is optional, I see no issue.

    6. Re:NSA would have loved this ! by Antique+Geekmeister · · Score: 1

      > ou are forgetting that the default for SSH is to abort during a MITM

      With stolen hostkeys on the same IP address? Or by presenting a new host IP in DNS with their own MITM keys, connecting to an unencrypted login transaction logger, and recording the user login attempt and passwords, then using them next time to connect to forward the connection to the relevant upstream host? Or any of a dozen other MITM approaches?

      I've been through just such an attack. Fortunately, the person doing the attack gave themselves away by failing to deal with 'ssh-agent' based connections, which is when I got called: key based access to the attacked server stopped working.

    7. Re:NSA would have loved this ! by Anonymous Coward · · Score: 0

      If they've stolen the hostkeys, then it's not MITM--they broke into your server. And if your users are sending their passwords to an unauthenticated MITM, then nothing has really changed.

      It sounds like your server clearly got p0wned. And it likely had nothing to do with MITM, anyhow.

      I disable password based authentication on all my servers. And use a crypto token (Yubikey NEO with built-in PGP Smart Card profile) to authenticate.

      Also, I would _never_ allow shell access, period, to a Linux server except for myself, because the Linux kernel is riddled with bugs and it's trivial to root a Linux box and _invariably_ one of yours dumb users will have their own computer or server p0wned, allowing an attacker to access your server (again without MITM) and install their root kit.

      If you're going to run a multi-user shell service, use OpenBSD. I've seen countless Linux servers get p0wned, but never once have I seen a similarly situated OpenBSD server get p0wned. Is it because OpenBSD has better programmers? Is it because most attacks are automated and hackers don't care to deal with OpenBSD? Is it because people who run OpenBSD servers actually have more experience keeping things clean and up-to-date? Is it because OpenBSD is simply less fancy, with simpler software that is easier to audit? I don't really care.

    8. Re:NSA would have loved this ! by thegarbz · · Score: 1

      If the NSA manages to MITM a session once, then they would already be past the point of encryption. At that point wouldn't they already a) be able to get the client key, and b) be able to get the server key, making it trivially easy to MITM again in the future?

      I don't understand how being able to change keys at either end if you are in possession of the correct ones makes it any easier to hide what you are doing or any easier to do it again in the future.

      It would seem like once you have the keys and are in position to use them the first time then the connection is forever broken unless the keys change manually.

    9. Re:NSA would have loved this ! by TechnoJoe · · Score: 0

      If the NSA is in a position to MITM this connection then they are likely already in the possession of all necessary keys at either end and gain nothing by being able to send the client and server new keys.

      Not true. There are a number of "poison the well" situations they could benefit from.

  5. yep, need "UpdateHostkeys Prompt". Damien? by raymorris · · Score: 1

    Agreed. I want to know if my servers' keys have changed unexpectedly. You can set UpdateHostkeys No to turn this off; I'd like the option of UpdateHostkeys Prompt.

    I do understand that having Prompt as the default would undermine the intended use case somewhat, but I think it would be good to have the option.

  6. Hope that code gets better by rippeltippel · · Score: 1

    Maybe it's off-topic, but is it just me who see potentially big problems with ed25519.c? e.g. http://bxr.su/OpenBSD/usr.bin/ssh/ed25519.c#25

    Hint: no input validation, hard-coded array offsets with no clue about their expected size, etc...

    I know, it's open-source (I should contribute, blablabla) but I see this kind of problems all over that code base.

    1. Re:Hope that code gets better by bmayer0122 · · Score: 2

      It is an internal function so the input validation should have already happened.
      The hard coded offsets look like they are part of how the crypto works.

    2. Re:Hope that code gets better by Anonymous Coward · · Score: 0

      As I wrote, it's not just that function.

      But maybe I'm just being paranoid.

      <paranoid_mode>
      After all anyone can inspect that code, and it's being used in a lot of systems, what can possibly go wrong?
      </paranoid_mode>

    3. Re:Hope that code gets better by Anonymous Coward · · Score: 0

      Well, if you do not bother to report it to them or work on fixing it, then why are you spreading FUD?

    4. Re:Hope that code gets better by Anonymous Coward · · Score: 1

      The OpenBSD/OpenSSH team is regarded as being considered paranoid to paranoid people. They have a long track record of great decisions, excellent design, and excellent code quality. They are known to error on the side of caution and are the standard for security.

    5. Re:Hope that code gets better by gurnec · · Score: 1

      Keep in mind that this is crypto code, which often has different properties and requirements than other types of code.

      For example, the count of bytes to store a private key, or a finite field element, or a hash output, etc. is hard coded and never changes. It would be akin to asserting that the sizeof a uint32_t is 4 somewhere in your code.... not very useful. Perhaps some defines would be nice from a documentation point of view, but that's more a style choice.

      Input validation must be handled very carefully due to the possibility of opening up side channel attacks (anywhere you see a piece of code which branches depending on its input is a potential vulnerability for a timing attack, and is intentionally avoided by this library).

      But the big reason I'm a lot less concerned than you are is simply the reputation of the authors, who are among the most talented cryptographers on the planet. It's not that they can do no harm (such hubris would be self-defeating), but rather that the likelihood of you or I finding some vulnerability with just a cursory glance seems extremely unlikely....

    6. Re:Hope that code gets better by rippeltippel · · Score: 1

      Thank you, I think you're right.
      My comments above were probably due mainly to ignorance.
      After all I've never bothered looking at that code before and should have studied the whole thing before judging... well... the whole thing.

    7. Re:Hope that code gets better by fahrbot-bot · · Score: 1

      It is an internal function so the input validation should have already happened.

      That's adorable.

      --
      It must have been something you assimilated. . . .
    8. Re:Hope that code gets better by TechyImmigrant · · Score: 1

      It's a signature algorithm. It should take any input and sign it.

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    9. Re:Hope that code gets better by Anonymous Coward · · Score: 0

      > The OpenBSD/OpenSSH team is regarded as being a whinging bunch of Theo de Raadt fan-boys who have a Not-Invented-Here stick shoved up their bottoms.

      Fixed that for you. The pretense that any of Theo's "security worshipping" fanboys actually wrote the original code is particularly amusing, it was Tatu Ylonen, now of F-Secure. They just inherited and revised the code: the churn needed to make it C++ and the original code importation of what was GPL code into their BSD licensed repository helps hide this. But I worked with the original code, and most of their work since then has been cosmetic.

      OK, 'sftp' they apparently added. But it was stupid: it's basically a broken command line interface to what is basically "scp", and still does not handle symlinks as symlinks that can be replicated on the client as symlinks.

  7. Attack surface by benjymouse · · Score: 1

    How about 'no'.

    Agreed.

    Consider the situation where an attacker has actually compromised a server key - either it was leaked, brute forces, a vulnerability exploited. It happens and big parts of the certificate system such as revocation lists, OCSP, validity periods etc are concerned with this. Or consider the situation where a vulnerability allows the attacker to *fake* the fact that he has the private key.

    Many systems are set up to warn or outright block if they are not able to check revocation for a certain time period. Seems to me, that with this extension an attacker can use the time from when the key is actually compromised until the breach is discovered/reported and gain permanent foothold instead of a temporary one.

    This capability seems too dangerous to even have in the protocol - even if one can argue that it is protected. It broadens the attack surface in a significant way.

    Of course, all security is a balance between risks, consequences and cost. Maybe, if this capability significantly lowers some other risk, it could outweigh the risk incurred by the increased attack surface. But color me skeptical.

    --
    Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
    1. Re:Attack surface by iggymanz · · Score: 1

      logic fails you. we're talking about public keys; after logging into a server via ssh you can already replace or change lines in .known_hosts anyway.

  8. Replace compromised keys by Anonymous Coward · · Score: 0

    So the server, whose key has been compromised, tells the client to replace keys? It's February 1st, not April 1st.

    1. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      If the host key has already been compromised, then the client is at no further risk. They've already accepted the compromised key as valid before this happens.
      S -> C: This is my host key
      C -> S: Yup, that matches what I already have saved for you
      -skipped messages-
      S -> C: Here's my current list of host keys

      Compared to:

      S -> C: This is my host key (but the audience knows that it's compromised!)
      C -> S: Yup, that matches what I already have saved for you
      -skipped-messages-

      So where is the additional vulnerability?

    2. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      First connection, host sends you information on keys A, B, and C. Key A gets compromised, host switches to key B. On next connection, it says "Hey, Key A is bad, take key D now" I'd imagine it still checks Key A to say it's bad, so what this means is that someone trying to impersonate you would need all three keys you previously sent. If they only have one of the three, that could be flagged.

    3. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      The connection is compromised at that moment. This can be used to make sure it stays compromised in the future.

    4. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      If the host key is compromised, then the attacker can introduce his own host key. The attacker can then MITM future connections. It doesn't matter whether the server is cleaned up and what public key it uses then, because the MITM is the only one who sees that key. To detect this, everybody who had keys added automatically would have to manually check those keys, which makes the feature moot.

    5. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      The host key is compromised already By changing nothing, any connection to that server is already compromised. There is no need to add more compromised host keys when the one the client authenticated already is.

      It's not like this extension allows the host to say "oh, by the way, this other super-secure server's host key is xxxx, you should definitely overwrite whatever you have saved for it"

    6. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      Let me point you to the part where any saved keys for the server are removed from known_hosts if they're not in the new list.

      Update: Two things that I neglected to mention in the above: 1) host keys that are not offered as part of the server->client notification are automatically removed from known_hosts, and 2) the updating of known_hosts can be disabled using a new UpdateHostkeys option in ssh_config and ~/.ssh/config.

    7. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      Let me point you to the part where nothing the server says matters after it has been successfully MITMd, because the client connects to the MITM and thinks it's the real thing since it got fed the fake server's key through this new feature while the real server's key was compromised and before it got replaced by a new key. Worse, the client user will get a wrong server key warning if the client ever manages to connect to the real server again without the MITM intercepting.

    8. Re:Replace compromised keys by Anonymous Coward · · Score: 0

      Exactly. If you rely on this feature for switching to a new server key, but don't bother the users with verifying over a secondary, secure channel that they got the correct new key, then you're imagining security where there is none. That's definitely a poorly thought out use of this feature, probably a rather desperate attempt to add a bullet point to a list of benefits why this immensely dangerous code should go into OpenSSH.

  9. How about a better feature? by thogard · · Score: 1

    We need keys and host passwords checked as authentication types without having to revert to PAM hackery. Just how many systems have been exploited because some root process found a way to read some .ssh/keys and then hopped to other systems with no human intervention.

  10. known_hosts only, not login keys by heikkile · · Score: 2

    If I read the article (or even the summary) correctly, this is about updating the known_hosts file, not authorized_keys. So, even with this enabled, this only affects the "The hostkey has changed" warning message, not who can log in with which keys. Although I am a tad uneasy about automatic key updates, this seems to be fairly safe, and it makes it so much easier to change a hostkey, without bothering all the users of a system.

    --

    In Murphy We Turst

  11. Dangerous overkill by drolli · · Score: 1

    Dangerous because automatic key updates should require a great deal of verification of the new keys. I could imagine some scenarios (e.g. cloned virtual machines), which lead to the authenticated key being correctly updated (e.g old instructions/documentation) by the admin, but the EC key not overwritten (since it's not in the standard procedure). If this EC key then is copied automatically to the client, any of the cloned machines would accepted as a verified server after the login.

    Overkill because exposing the public keys in terms of the sftp protocol would be less invasive and give the client full control what to do whith the keys.

    1. Re:Dangerous overkill by Anonymous Coward · · Score: 0

      It is dangerous because if you make up a situation where it will be dangerous then things can go wrong... no shit? Are you also saying that if the admin leaves outdated documentation around, it will only show up as an issue with this feature enabled? If you find yourself in the situation you came up with, then just disable this feature, getting butthurt over optional features just because you can't (see the) use (of) it is stupid.

    2. Re:Dangerous overkill by drolli · · Score: 1

      It is dangerous to have partially redundant mechanisms. If you have only explicit redundancy, then errors will show up.

      This tool automates an administrative task. But only one.

  12. What's so wrong with a USB stick? by buckfeta2014 · · Score: 1

    No thanks, I'll pass on this feature.

    --
    Buck Feta. You know what to do.
  13. SSH by ledow · · Score: 3, Insightful

    So, I have to trust a server to automatically replace a trusted key with a new trusted key.

    Yeah, this is the type of thing I'll try when it's been in the code for five, ten years.

    I'm perfectly sure, as a mathematician, that you can use some kind of secure exchange to make this work but - fuck - I won't be trusting implementations of it for a while.

    Isn't this exactly the sort of thing that, half-assed, will generate security problems for years to come and yet still seems to be outside the SSH protocol and has to be a custom extension? Is there an RFC for this?

    Sorry but as far as I'm concerned key management shouldn't be a part of the process that's handling connection authentications, etc. Why can't this be an outside protocol entirely? For decades, we've been waiting for some kind of automated decentralised, anonymised key-store and surely the effort going into securing this very dangerous piece of code would have been better put into moving the problem away from SSH and allowing multi-protocol use of such things.

    1. Re:SSH by QuietLagoon · · Score: 1

      So, I have to trust a server to automatically replace a trusted key with a new trusted key....

      You don't have to do anything. You can use this feature if it is suitable for your needs and security requirements. If it is not, then no one is forcing you to use it, so don't.

    2. Re:SSH by Anonymous Coward · · Score: 0

      Not the concern you responded to, but all code in a security critical application is a liability, even if it is "unused". At the very least you have to make sure that the feature is actually disabled and not automatically enabled by an update. But of course exploits are still a possibility and unused code could be abused in unexpected ways, especially if a feature turns out to find very limited use in the installed base. (Remember SSL heartbeats, the feature most people didn't even know existed?).

    3. Re:SSH by Anonymous Coward · · Score: 0

      So, I have to trust a server to automatically replace a trusted key with a new trusted key....

      You don't have to do anything. You can use this feature if it is suitable for your needs and security requirements. If it is not, then no one is forcing you to use it, so don't.

      I am not worried about me using it but somebody else. I don't want "find a key and rewrite it with a user-provided one forever" functionality in my executable. That's a far too valuable payload for exploit writers. It does all of the tricky work for them and is maintained by OpenSSH.

    4. Re:SSH by ledow · · Score: 1

      Exactly.

      And the ability to overwrite such a critical file should really be something huge and manual because it's so critical.

      I'm also thinking DDoS situations - malware replacing your SSH keys with their own, stopping you logging in at all or adding their public key to all your normal ones granting them a kind of hidden back door.

      Sure, they can do all that in other ways, but one way built-into the SSH protocol as an extension is something we can do without.

    5. Re:SSH by iggymanz · · Score: 1

      eh? you can already overrite known_hosts or put in any extra keys you want after logging in already. Really one could do such a thing as command argument to ssh already! there's not really much new risk introduced here

    6. Re:SSH by Anonymous Coward · · Score: 1

      I'm perfectly sure, as a mathematician, that you can use some kind of secure exchange to make this work but - fuck - I won't be trusting implementations of it for a while.

      If only SSH had some sort of way of, say, encrypting the channel over which you communicate. And if only there were some way to know that you previously acknowledged that you trusted the server.

      Maybe that would help?

    7. Re:SSH by ToasterMonkey · · Score: 1

      Sorry but as far as I'm concerned key management shouldn't be a part of the process that's handling connection authentications, etc. Why can't this be an outside protocol entirely? For decades, we've been waiting for some kind of automated decentralised, anonymised key-store and surely the effort going into securing this very dangerous piece of code would have been better put into moving the problem away from SSH and allowing multi-protocol use of such things.

      If you trust a server by accepting its public key, it is by definition, trusted, for as long as its private key is secure.
      Only the initial trust needs to be verified by humans, and with a chain of trust, even that can be nearly automated by adding your organization's CA key when systems are deployed (I'm in an imaginary world where SSH key management has caught up with the rest of the world).
      The older a private key gets, the more likely it has been compromised, maybe by VM cloning, backup media leaking, etc.

      To address that, you should change the keys periodically. Prompting the user is pointless, because the connection is trusted.

      WHOA, let me back up a minute, you did know your session data is actually encrypted with symmetric keys right? ... and those keys are in similar fashion changed on a regular basis without your knowledge?
      If you didn't know that, well.. that explains 99% of the ignorance I'm seeing on this page.

      SSH's key management is an absolute joke, but this is a step in the right direction at least. The only thing I can imagine is the authors figured people would be using kerberos in all but the smallest shops... and I'm being nice assuming SSH's kerberos integration is any good.

    8. Re:SSH by thegarbz · · Score: 1

      So, I have to trust a server to automatically replace a trusted key with a new trusted key.

      You have already trusted a server, and connected to it in a secure fashion, and authenticated. At that point why would you not trust it to replace the key?

  14. Re:Damien? by Eunuchswear · · Score: 0

    Wild Bill Donovan is a "faggoty European name"?

    --
    Watch this Heartland Institute video
  15. This is really, really bad by Anonymous Coward · · Score: 0

    Now the executable has code that will look up a particular key and replace it by something provided by the program.

    This is the perfect code to execute via a buffer overflow. It does all of the drudge work of compromising and is maintained by the OpenSSL developers, so will get updated to deal with whatever changes in the key files.

    So your attack kits just need to replace the call address to be used for "arbitrary code execution" for each new binary and are fit to go. You don't even need an executable stack. The code doing all the work is already there.

    1. Re:This is really, really bad by Anonymous Coward · · Score: 0

      OpenSSH != OpenSSL. Completely unrelated groups. OpenSSH is developed by the OpenBSD team. OpenSSL is developed by chimps with typewriters. FWIW OpenSSH is moving quickly towards removing any dependency on OpenSSL.

      Now would you FUD turds(or NSA agent) please stfu and go away.

  16. Problem is key clearing, not multiple keys by Anonymous Coward · · Score: 1

    This is so typical of the current OpenSSH maintainers, it actually hurts to watch.

    The actual problem is that there's no client tool for clearing replaced keys. You hve to open up your "authorized_keys" file with a text editor or the client keeps moaning "oh, no, the key doesn't match, boo-hoo-boo-hoo!!" even when you know damn well you rebuilt the host and it has new keys, or a dozen similar situations. If the software is smart enough to read and detect old and not matched recorded host keys, it should be intelligent enough to delete the old one if you say "ok, yes, I do want to replace that". But there's not even a tool to do it with. And you can't just use "ssh-keygen" to scan the relevant target and script it, because known_hosts entries are not in a canonical format or one that matches the output of 'ssh-keygen'. So scripting it turns into a right pain in the ass, partly because people ignore the RFC's about hostnames and now are using Unicode hostnames for things. (Check out Thailand and other Asia, non-compliant registrars for an introduction to non-compliant DNS).

    The result is that, if you have significant system churn, you set your client to ignore host key validation (Setting "CheckHostIP no") because you *do not have the time to waste with this*. This especially happens when you are building new hosts in a small DHCP assigned address space, or if you have non-registered DHCP for a bunch of development environments that all get built from scratch rather than using a deployed, locked set of standard SSH keys. When keys expire and a new host gets the same IP address, you're screwed.

    SSH hostkeys are, frankly, a joke in any case. They cannot be trusted for the initial host authentication because there is no default signature or verification method for the keys themselves. And the client behavior is so painfully awful that everyone who actually handles more than the machine room they built in their mom's basement has learned to just ignore the damn things and either set 'CheckHostIP no' or simply delete the $HOME/.ssh/known_hosts file on a regular basis, because the criping and whinging about accumulated discrepancies break things on an unpredictable basis. And yes, I reported the issue and tried to patch it with SSH 1, SSH 2, and OpenSSH, it's a fundamental architectural "practice".

    So basically, this is a complex and stupid answer to what is the wrong problem. It's not a server hostkey publication problem, it's a client "we're too stupid to know how to expire old or invalid hostkeys because we arrogantly assume all servers are complete stable and you should just be able to open 'vi' and fix it yourself" problem.

    1. Re:Problem is key clearing, not multiple keys by gweihir · · Score: 2

      Might be a canary, i.e. a test of how much stupidity and potentially insecure automation OpenSSH users are willing to accept. In that case the OpenSSH maintainers team is not stupid, but has been compromised. Would make sense...

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  17. ED25519? by Anonymous Coward · · Score: 0

    ED25519? That sounds good. I haven't upgraded to anywhere near the current version, I'm still running the ED209 for security. It's a bit buggy, but no one gets past it.