16 comments

  • amluto 10 hours ago
    Wow, what a bug. I expect the exploit is literally as simple as trying to ssh in as a user with the password has ‘*’ in /etc/shadow and typing anything as the password.

    To the extent that systems that are configured in the vulnerable manner exist in the wild, I’m surprised they weren’t exploited years ago by trivial ssh bots.

    P.S. Wow, I’m reminded of just how awful traditional UNIX-y C APIs and code are.

    P.P.S. The musl code in question is nuts. The API it implements is awful. Seriously, here’s the manpage:

    https://man.archlinux.org/man/crypt.3.en

    You can’t call this function correctly. sshd’s “fix” is basically to assume that a too-short return is an error return instead of a success return.

    PAM is also awful, but this is worse.

    • dpoloncsak 6 hours ago
      Maybe I'm misunderstanding, but u/tonnydourado pointed out on another thread https://news.ycombinator.com/item?id=50378228#50380029

      "It starts with a bold claim: "ssh accounts that should not accept a password will accept any password between 256 and 1024 characters". But then it keeps adding qualifiers:

      - sshd compiled with musl

      - not using PAM

      - password logins enabled

      - at least one account with '*' as the password "hash"

      - at least one OTHER account with a valid password

      The conditions are all ANDed, miss a single one and you're fine."

      This doesn't seem to be nearly as big as an issue as they're making it out to be

      • bombcar 6 hours ago
        Alpine matches the first.

        Disabling PAM has been "generally good security advice" for decades; I remember suggestions to not use it in the 2000s.

        Password logins are often enabled, especially on multi-user and default setups.

        If alpine uses the * feature, it's going to be pretty common. Gentoo has it, as does Ubuntu.

        If password logins are enabled, you're almost guaranteed to have at least one user with a password (root on all my boxes has one, even if I never use it and it's random garbage).

        So the cheese lines up pretty well, this affects quite a bit.

        If password logins are enabled, someone almost certainly has a password.

        • dpoloncsak 6 hours ago
          So it's essentially one of the 'recommended configurations'?

          I'm seeing people I generally trust in the scene memeing on twitter, while others are freaking out. Its hard for me to tell how fucked we are, I guess

          • bombcar 1 hour ago
            It's always 50/50, you're either fucked or you ain't.

            I think this time around it's mainly Alpine Linux and a few custom-rollers (Gentoo with musl could easily get to this place).

            • dpoloncsak 1 hour ago
              Yeah, as the dust starts to settle a bit it seems this is the largest case. Many 'stock' Alpine images, Docker images built on those, and embedded systems seem to be the main candidates.
      • ferngodfather 6 hours ago
        No, no don't let all of that distract you. We gotta hype this. This is the new SSH2SHELL dude. Have we registered the domain yet? I'm scheduled on Fox News tomorrow.
    • amluto 4 hours ago
      FWIW, I made a bit of an error in my very quick analysis. See: https://news.ycombinator.com/item?id=50380581
  • dust42 8 hours ago
    > We are making this release as fast as possible (we learned of the problem yesterday) because we have recently observed multiple cases of rapid bug rediscovery by AI agents, sometimes within hours, and so now consider long embargo periods to be a dangerous practice that primarily benefits attackers.

    I think this will likely become standard. Nevertheless, a few stormy months are ahead.

  • throwa356262 11 hours ago
    musl only, the quick fix:

         PasswordAuthentication=no
    
    
    Which is a good advice in general.
    • solyin 10 hours ago
      How do you break back into your digital life? You wake up in a strange place. Something happened. Everything's gone. No wallet/keys/smartphone/tablet/laptop. How would you get back into your digital life given only a laptop with access to the Internet, unless something, somewhere is passwordauthenticate=yes.
      • jareklupinski 9 hours ago
        > You wake up in a strange place. Something happened. Everything's gone. No wallet/keys/smartphone/tablet/laptop.

        at this point the _last_ thing i care about is my email.

        where am i? am i ok? how are my friends/loved ones?

        once those are in place, it becomes clearer how to get back to "normal"

        • solyin 4 hours ago
          With nothing, how do you reach them? Your friends and loved ones are what's at the other end of the email/Internet access.
          • jareklupinski 3 hours ago
            i guess if i have some sort of internet access (otherwise why would i be worrying about passwords), i'd set up a new account(s) and message those friends
      • fn-mote 9 hours ago
        The somewhere for password authentication is a place you have physical access. Not ssh.
        • solyin 3 hours ago
          There's been a natural disaster and your home is now inaccessible. With global warming going the way it has, that's looking more and more likely each day. Fires, hurricanes, earthquakes, war, tsunami, etc.
      • gfv 8 hours ago
        PasswordAuthentication=no usually means that ssh stops directly reading /etc/passwd to authenticate, not that it stops accepting passwords completely. You'll still be able to log in with a correct password, provided KbdInteractiveAuthentication is still on, PAM is available, and the PAM policy allows for it.
      • nucleardog 8 hours ago
        The email at the root of my identity is tied to a country code domain in my country. There are robust legal processes for enforcing my status as the registrant and regaining control of it. Once I have access to that, I can use that to gain access to everything downstream.

        Is it fast? No, but that's a feature.

        But it does mean I get to lean on the existing processes and identity verification already part of the government bureaucracy and the courts as my backdoor.

      • viraptor 9 hours ago
        Remotely: An encrypted file with a seed / master passwords to all the other data, published under a public url you can remember, but not linked anywhere and not listed.

        Locally: Same, but printed out, laminated, in a safe place with other documents.

      • mr_mitm 9 hours ago
        I log in via console, either physical or virtual (the latter requires MFA though)
      • denkmoon 9 hours ago
        I walk to my pc and type ssh-keygen. If i can’t do that I’ve got bigger problems. “I must be able to recover remotely using a memorised credential” is a terrible requirement.
        • solyin 3 hours ago
          You go travelling in a foreign country and get mugged. You have no phone no wallet no keys, just something you know and the goodwill of strangers.
          • BigTTYGothGF 3 hours ago
            > goodwill of strangers

            Who can presumably get you in touch with the relevant embassy or consulate or, failing that, local authorities.

      • MPSimmons 8 hours ago
        Does this happen to you a lot? You may have other issues
      • INTPenis 9 hours ago
        Yeah your vault has password authentication. Your password manager in other words. Your vault is where you store your private ssh keys, and or the passwords for the keys.
      • worksonmine 8 hours ago
        A scenario where all the backups are gone and the server is somehow the only thing that survived is not a very plausible one.
        • pixl97 6 hours ago
          Depends if you're backing up somewhere else online (also is that protected by 2FA?). You must not be in a place with many huge natural disasters.

          And this is assuming the server is somewhere else on the cloud.

          • worksonmine 5 hours ago
            > You must not be in a place with many huge natural disasters.

            Or I have proper backups synced across the world on different providers. The likelihood of everything failing is not a vector I worry about. If that happens I have bigger problems to worry about.

      • petesergeant 9 hours ago
        1Password subscription and the memorized key. 1Password is the only place my ssh private keys are stored.
        • uresolame 9 hours ago
          [flagged]
          • illusive4080 8 hours ago
            Avoid this kind of behavior on HN; we are not the community for attacking each other. Your comment is not helpful to further the conversation. You could have made a point about subscriptions being antithetical to the ethos of open source culture, but instead you attacked the user and mocked him/her.
    • sva_ 7 hours ago
      Another thing I would recommend is having your servers in a wireguard net and only allowing ssh from inside that virtual network. There is no need to publicly expose ssh.
      • somat 7 hours ago
        Why is wireguards auth better than openssh auth?
        • TheDong 6 hours ago
          Wireguard allows effectively no configuration around auth, and so it's more likely that it is configured in a secure manner.

          Openssh allows: password auth with weak passwords, PAM with potentially insecure PAM modules, gssappi, configurable ciphers, etc. Wireguard has none of those.

          Each of those auth methods adds more possible vulnerable code paths and accidentally insecure configurations. It's very reasonable to believe that wireguard auth, since it has far fewer moving parts and configuration knobs, is likely to have fewer ways it can be insecure.

        • praash 6 hours ago
          Layered security is better (as long as their weaknesses don't overlap).
          • vadansky 6 hours ago
            Not only that, wireguard doesn't even reply if they don't have the right key, while SSH does so the attacker knows there is at least a target.
          • INTPenis 6 hours ago
            Yeah until they discover a vuln in wireguard.
            • sva_ 1 hour ago
              Then you still have your ssh safeguards
    • vadansky 6 hours ago
      I was always uncomfortable that it's on by default and surprised anyone uses it it. It's also more cumbersome compared to just using a key. I feel like using keys is the password manager analogue for SSH.
    • XorNot 3 hours ago
      It's irrelevant. There's no reason this should be any more effective in the face of software bugs then anything else.
    • patadura 9 hours ago
      imo this is a good advice only if the devices that connect to the server have their home encrypted and ssh private key protected.
  • MPSimmons 8 hours ago
    Is this actually effective against Alpine? The default install seems to use ! as the placeholder in /etc/shadow instead of * and trying the attack doesn't seem to work.
  • asdfsa32 10 hours ago
    Who does PasswordAuthentication=yes in this day and age anyway.
    • dspillett 8 hours ago
      We have clients (regulated banks and insurers of various sizes) that send us feeds via SFTP. You might be surprised what proportion of them ignore our “we strongly recommend key based authentication” and ask for password auth instead.
      • somat 6 hours ago
        When I set up a client sftp drop I had the luxury of saying "key based access only"

        Then it was a surprisingly customer service intensive process to get the keys from the customers. I never did manage to automate it fully. Weird enterprise systems I have never heard of with strange key formats. ssh1 keys, email mangling them. Their internal processes requiring a password.

        And way to many "I am sorry but that was the private key you sent me, That key is now compromised and you will need to remove it and generate new keys anywhere it was used"

        I almost regret not allowing passwords, almost, despite the headaches key based is still much better.

        • pixl97 6 hours ago
          About to say, users just drop the key on their desktop and then download random exe's from the internet and run them.

          Still safter in general, but not bulletproof.

          • dspillett 5 hours ago
            At least in that case, if the account is compromised we definitely didn't leak the credentials. That we don't have them to leak is one of the advantages of key-based auth.

            [of course not having the credentials to leak does not protect us from this sort of bug, it is just one factor in a multipart security stance]

      • dns_snek 7 hours ago
        If you refused, would you get overruled internally?
        • dspillett 5 hours ago
          Previous company: probably. It could be a dealbreaker for the client, and we bent over quite readily on a number of issues considered minor (keys are best practise, but passwords are so common it is difficult to argue that they are so bad they should be refused).

          Current state (now we have been bought and are effectively more than an order of magnitude bigger): I definitely don't have opportunity to make a unilateral decision like that. Even though the larger company has a more “fair enough, feel free to go elsewhere” attitude when a small client says “if you can support × that is a dealbreaker for us” then we could previously afford to take as our stance, some of the bigger clients are definitely paying us enough, and do use passwords, that someone above me would overrule a keys-only decision.

    • bombcar 6 hours ago
      Don't most cloud providers default to that? I know I had to force some to deploy with a key and even then PasswordAuth was often on and had to be disabled.
    • krystalgamer 9 hours ago
      it's the default for most systems. I can't remember a time I had to not turn it off.
    • ectospheno 9 hours ago
      People who use AuthenticationMethods "publickey,password"

      You must present a key first after which you must enter a password.

      • rvz 9 hours ago
        Just do no password at all.
        • ectospheno 9 hours ago
          Putting the one in 1fa? No thanks.
    • mhitza 9 hours ago
      If you run a cockpit service on your server you will need password authentication enabled, unfortunately.
      • Curufir 7 hours ago
        I went and checked this. I can admin my server with Cockpit using either the web service (using my username/password) or the desktop client (via private key) without issue even with SSH password authentication disabled. I do usually disable the web service so had to reconfigure to check.
    • walrus01 9 hours ago
      As this is apparently affecting openwrt, probably a fair number of openwrt users, if I had to guess
      • drdexebtjl 7 hours ago
        I thought OpenWrt used Dropbear by default?
  • aborsy 5 hours ago
    I often use "AuthenticationMethods publickey" which would disable all authentications except public key.

    Isn't this safer than "PasswordAuthentication no", even if it's a different setting?

  • zajio1am 8 hours ago
    I would say that PasswordAuthentication=yes is by itself a vulnerability.
  • crest 11 hours ago
    I'm sure some people running lightweight containers just had a heart attack.
    • smw 10 hours ago
      I would imagine the vast majority of lightweight containers don't contain an ssh server?
      • dormento 8 hours ago
        You'd be surprised by the amount of people using containers that don't know/care what is inside.
  • K0nserv 9 hours ago
    This looks terrible for musl, what a collection of terrible decisions on their part. I guess I'm staying away from it.
    • sheepscreek 9 hours ago
      To err is human. There’s no escaping it, I’m afraid.
      • K0nserv 8 hours ago
        I agree entirely, but I'm not sure changing `crypt` to return `"*"` instead of `NULL` on failure qualifies. It's much more of a considered decision, which happens to be very wrong.
  • jmclnx 9 hours ago
    >We consider the root cause of this bug to be outside OpenSSH itself, but we're in a good position to deliver a mitigation quickly.

    So not a ssh issue but an issue specific to Linux using "musl libc without PAM".

    • mpyne 7 hours ago
      Well, OpenSSH contributes to this by mixing hashes from the shadow file. The musl code would be correct if OpenSSH passed in the hash from the user account that is being logged-in.

      They instead pass in a different user’s hash (to avoid timing attacks) but end up comparing the result from musl against the actual user account, defeating musl’s simplistic safeguard to avoid this very issue.

      I’d probably still call this a musl thing. Errors should result in a NULL return even if the application crashes from there, but at the very least a return value intended to not match any actual hash in /etc/shadow should be a random string or predefined UUID or something other than *.

      • bombcar 6 hours ago
        Randomly using a different users's hash seems so wrong to me, but maybe I've just been too deep in PII stuff for too long.
  • phoronixrly 11 hours ago
    I presume Dropbear, thus musl-based OpenWrt routers are also not affected? Not that Dropbear has been an example in that regard.
    • mijoharas 9 hours ago
      There is this write-up/fancy page from the person who found the vulnerability[0] (HN discussion[1], how I found this thread).

      At the bottom of that it says dropbear is unaffected.

      > on debian, ubuntu, fedora or anything else with glibc? going through pam? dropbear? openbsd? you're fine

      [0] https://sshhole.com/

      [1] https://news.ycombinator.com/item?id=50378228

    • manwe150 11 hours ago
      Since after you posted, various people in the thread have reported dropbear is not affected
  • TZubiri 5 hours ago
    Here's an unrelated security issue I opened with Alpine earlier this year

    https://gitlab.alpinelinux.org/alpine/aports/-/work_items/16...

    It didn't give me the impression that I was dealing with a secure piece of software, it seemed like they were dealing with very complex issues while laughably failing at the industry basics that were settled years ago.

    Similarly Ubuntu was also the only other distro that fucked this simple permissions config up, and lately with the latency to fix the TCP vuln, it seems to confirm that these are not reliable distros for the coming security era.

  • entuno 10 hours ago
    Seems slightly confusing that the OpenSSH release notes page says:

    > This release contains a critical security workaround that affects Linux systems that use the musl libc and PAM disabled.

    But that there's nothing about it on their security page.

    Even if it's not technically a bug in their code, the fact that they've made a "critical" release to address it suggests that it should probably be listed on the security page as well. But maybe (hopefully) they just haven't updated the security page yet.

    • SAI_Peregrinus 6 hours ago
      musl libc violates the POSIX documented behavior of `crypt()`¹

      > Upon successful completion, crypt() shall return a pointer to the hashed password; the first two bytes of the returned value shall be those of the salt argument. Otherwise, it shall return a null pointer and set errno to indicate the error.

      Musl returns '!' or '*', not null.

      ¹https://pubs.opengroup.org/onlinepubs/9799919799/

  • tiffanyh 8 hours ago
    Since OpenSSH is included in the base install, and enabled on OpenBSD - is it correct that they will need to update the famous:

    “Only two remote holes in the default install, in a heck of a long time!”

    https://www.openbsd.org/

    • somat 7 hours ago
      OpenBSD is not affected, so apparently they are doing something right. But also glibc linux is not affected and pam linux is not affected, so it is only musl linux with the remote hole.
    • bigbadfeline 3 hours ago
      You became a victim of a very misleading post title. This isn't an OpenSSH problem at all, it's a musl problem.

      I'm pretty sure the misleading wording is deliberate, OpenSSH is an excellent but non-commercial project which a bunch of entities would love to gain control of, in order to bug it with their spyware - thus the constant nagging on the bot-infested web.

      The OP should be flagged.

    • mldbk 8 hours ago
      OpenBSD doesn't provide musl-linked OpenSSH by default, so not yet[x2]
    • rpicard 8 hours ago
      This vulnerability doesn’t exist on non-Linux systems, so not yet!
    • heavensteeth 8 hours ago
      No, the bug is in musl but manifests in OpenSSH when compiled against it.
  • jordiburgos 10 hours ago
    Workaround? Why not a fix?
    • ale42 10 hours ago
      AFAIU because the bug is in musl and not in OpenSSH
  • keepitupkitty 9 hours ago
    [flagged]