News for hackers. Stuff that matters.
Re:The default OpenSSH key encryption is worse than plaintext by lvh on Friday August 03, 2018 @03:48PM (#17683020)
I wrote this; happy to answer questions.
Re:The default OpenSSH key encryption is worse than plaintext by wazoox on Friday August 03, 2018 @05:01PM (#17683575)
May I suggest that you change your blog colors? Light grey on dark beige is close to unreadable at any size without resorting to Firefox reading mode...
Re:The default OpenSSH key encryption is worse than plaintext by petee on Friday August 03, 2018 @07:29PM (#17684393)
and thin letters on my screen - my eyes are straining reading it
Re:The default OpenSSH key encryption is worse than plaintext by lvh on Saturday August 04, 2018 @12:46AM (#17685422)
I just spent a bit of time tweaking it; hopefully that's better :)
Re:The default OpenSSH key encryption is worse than plaintext by petee on Saturday August 04, 2018 @07:15AM (#17686370)
That makes a huge difference, thank you!
Re:The default OpenSSH key encryption is worse than plaintext by wazoox on Saturday August 04, 2018 @04:34PM (#17688332)
That's much better, thank you :)
Re:The default OpenSSH key encryption is worse than plaintext by pvg on Friday August 03, 2018 @04:04PM (#17683166)
Beside compatibility, is there any reason not to use Ed25519 keys for everything?
Re:The default OpenSSH key encryption is worse than plaintext by lvh on Friday August 03, 2018 @04:21PM (#17683303)
Nope! Ed25519 is great and honestly I think the compatibility concerns are overblown. It was introduced in 2014. If you are running four year old SSH you have other problems, like probably RHEL or some nonsense.

That said: Ed25519 is a local optimum: the bigger win is to not have long-held credentials at all, and instead use an SSH CA or something like Gravitational Teleport. Doesn't work for GitHub though.

Re:The default OpenSSH key encryption is worse than plaintext by glenjamin on Friday August 03, 2018 @04:32PM (#17683382)
In a world where you don’t have long held credentials - how do you get the short term credentials?
Re:The default OpenSSH key encryption is worse than plaintext by xyzzy123 on Friday August 03, 2018 @04:48PM (#17683488)
We do this:

Master user records in an identity/SSO system. We use ADFS.

Use a protocol which provides a portable “signed”, temporary credential. We use SAML but OIDC also works.

Have a command-line client which auths to the SSO and then relays an identity proof to a trusted component (lambda, cloud function, dedicated instance, whatever your policy says is ok). The identity proof is just a saml assertion or oidc token.

Have trusted component validate the identity proof from SSO and generate time limited credentials (we issue ssh, kube and iam). Our client then auto-xfers those creds up to jumpbox but you could drop them on workstation instead if your policy allows.

Re:The default OpenSSH key encryption is worse than plaintext by tptacek on Friday August 03, 2018 @05:26PM (#17683768)
This is roughly what I'm talking about when I bring up SSH CA short-lived credential workflows.
Re:The default OpenSSH key encryption is worse than plaintext by wvh on Friday August 03, 2018 @08:36PM (#17684686)
I currently work in academic environments and I don't have much faith in the SSO systems. I thought about this, but often the SSO credentials are also the email password – the one password that gets entered and stored just about everywhere for the average user. I'm not willing to bet the security on a user's main login/email password, which seems to be a common setup. With that password or even just access to a user's main mailbox, a smart attacker might get through multiple layers of security by simply convincing services or staff to reset credentials.

Though it might work with a second, more limited (not-so-)SSO system for specific users and environments.

Re:The default OpenSSH key encryption is worse than plaintext by lvh on Friday August 03, 2018 @09:11PM (#17684836)
You're right that shitty systems train users to be phishable -- by typing their password all over the place -- all the time, not even counting the poor default password hygiene most users have. This is one of the reasons U2F/WebAuthn is so incredibly valuable.
Re:The default OpenSSH key encryption is worse than plaintext by angry_octet on Saturday August 04, 2018 @12:21PM (#17687418)
Agree, SSO failures train people to type their domain password everywhere. Also used for proxy login, sent out via SMBv1 etc.

A jumpbox with 2FA might be workable. Servers only accept logins from the jumpboxes, but you don't have to get 2FA working on them. Essentially it's an internal VPN gateway. (Be on the lookout for the knobheads in IT that set up parallel login mechanisms without 2FA, like mounting the file share, virtual desktop logins from the hypervisor, Kerberos auth.)

Re:The default OpenSSH key encryption is worse than plaintext by amaccuish on Friday August 03, 2018 @09:30PM (#17684893)
I love SAML (not the XML part), it gives me one place where I can concentrate. My SSO first tries kerberos (if they've logged into their Windows machine using AD), x509 for smartcards, and if all that fails, username+password+totp. Password login is blocked without a TOTP token provisioned. Also it's one place I can stick fail2ban rules.
Re:The default OpenSSH key encryption is worse than plaintext by cbhl on Friday August 03, 2018 @04:45PM (#17683469)
If I understand correctly: with long-held credentials.

Basically, you use long-held credentials to generate short-term credentials, and then use the short-term credentials themselves to access whatever server or service you need.

Re:The default OpenSSH key encryption is worse than plaintext by guelo on Friday August 03, 2018 @05:14PM (#17683670)
You could have a key rotation process where you use the old key to install the new key and delete the old key. But it seems sketchy because if you don't rotate in time the old key expires and you're locked out. I think in practice you'll always end up with a super-duper secret, rarely used, long term key. Or have some other backdoor like root password, LDAP/Kerberos, ADFS, etc.
Re:The default OpenSSH key encryption is worse than plaintext by jakobdabo on Friday August 03, 2018 @04:25PM (#17683339)
RHEL 7 (and derivatives) do support Ed25519 keys.
Re:The default OpenSSH key encryption is worse than plaintext by leonlag on Friday August 03, 2018 @04:22PM (#17683309)
The only thing I can think of is that no smartcard/usb-key that I know of support them. Please if someone knows of any, let me know.
Re:The default OpenSSH key encryption is worse than plaintext by amaccuish on Friday August 03, 2018 @09:34PM (#17684903)
The OpenPGP 3.3 card has ECC but not Ed25519 :(

FYI it supports [0]: ansix9p256r1, ansix9p384r1, ansix9p521r1 and brainpoolP256r1, brainpoolP384r1, brainpoolP512r1

[0] https://gnupg.org/ftp/specs/OpenPGP-smart-card-application-3...

Re:The default OpenSSH key encryption is worse than plaintext by wahern on Friday August 03, 2018 @04:55PM (#17683533)
I think some OpenPGP smartcards like the GnuK might support it, but no PIV mode cards AFAIK. And I don't know if the components higher up the stack (gpg-agent, ssh-agent, PKCS#11 drivers, etc) can make use of those keys. Each new key type requires protocol support up and down the stack.
Re:The default OpenSSH key encryption is worse than plaintext by garmaine on Friday August 03, 2018 @07:09PM (#17684319)
Yes, Ed25519/Curve25519 has weird cryptographic choices that make it difficult to do certain things. I wouldn't use it for anything other than the specific use case it was designed for: key agreement and single signature authorization/verification.
Re:The default OpenSSH key encryption is worse than plaintext by tatersolid on Saturday August 04, 2018 @12:21PM (#17687421)
Elaborate? I thought Ed25519 was a general deterministic signature scheme, and Curve25519 a general key agreement scheme.
Re:The default OpenSSH key encryption is worse than plaintext by garmaine on Saturday August 04, 2018 @02:56PM (#17688023)
And yet people have used it for ring signature authorization schemes (CryptoNote/Monero) which has directly led to inflation bugs (permitted double-spends) and an inability to have key derivation for secure long lived wallets.

That’s due to Curve25519 having a non-unit co factor. There’s a half dozen other weird properties of the curve chosen for smal efficiency gains or whatnot which also might lead to security holes in any application which is not the single signer or 2 party key agreement use case.

Re:The default OpenSSH key encryption is worse than plaintext by tptacek on Friday August 03, 2018 @04:09PM (#17683210)
No, you should use Ed25519 keys wherever you can.
Re:The default OpenSSH key encryption is worse than plaintext by ascar on Friday August 03, 2018 @11:24PM (#17685211)
Could you maybe elaborate why this would make attacks better than pw brute-force feasible?

I get that this isn't a good practice, but plain brute-forcing a 20 character pw (~120 bits of entropy as alphanumeric, same as md5 hash size) is still impracticle even if it's a low cost md5 calculation.

Re:The default OpenSSH key encryption is worse than plaintext by lvh on Saturday August 04, 2018 @12:06AM (#17685326)
I’m not sure I understand the question: most places where you try a password you don’t get an offline MD5-speed oracle. So two ways: it’s faster than say cracking a PBKDF2 dump, and it’s offline, unlike, I dunno, a web password prompt.

You’re right that you can imagine passwords that you still can’t enumerate. But suggesting that people have a non-reused memorized 120 bit password is, uh, optimistic.

Re:The default OpenSSH key encryption is worse than plaintext by Dylan16807 on Saturday August 04, 2018 @12:21AM (#17685367)
The chances are a lot better among the list of people that actually use SSH keys.

And this should be one of the top priority passwords, so it's not too hard to imagine it being in a password manager or using a similar quality.

Re:The default OpenSSH key encryption is worse than plaintext by pvg on Saturday August 04, 2018 @12:31AM (#17685387)
Or it's just their local password with keychain-integrated ssh-agent so they never type anything. I think the chances of that (which is sort of the premise of this post) are much, much higher.
Re:The default OpenSSH key encryption is worse than plaintext by lvh on Saturday August 04, 2018 @12:33AM (#17685394)
I'm not saying it is literally impossible for this to be safe. I'm saying in pratcie, most of the time, it is not. A 120 bit password is not normal.
Re:The default OpenSSH key encryption is worse than plaintext by Dylan16807 on Saturday August 04, 2018 @01:10AM (#17685461)
A password manager is not 'normal' but it's common enough that you shouldn't be classifying it as negligible to conclude that these passwords are worse than nothing.

Also the 120 bits was an example and a good amount more than necessary. A 12 character password isn't exactly standard but it's not ridiculous to expect. Once you exclude the passwords that are so bad even bcrypt can't save them, the number of users where the password algorithm makes a difference starts to look a lot smaller than 100%.

Re:The default OpenSSH key encryption is worse than plaintext by ascar on Saturday August 04, 2018 @10:13AM (#17686915)
I wasn't sure I did understand the attack vector correctly and if there are some known vulnerabilities that make cracking this MD5 approach faster than brute-force.

In other words I wanted to know, if my SSH keys with md5 algorithm are fine, if I use a high entropy pw (which I do, especially for my ssh keys).

Sure some people will use short and reused passwords for ssh keys, but the persons using password protected ssh keys are way more informed about security than your average user. Password statistics are usually based on pw database leaks of your average user and/or sites that are not worth protecting.

There is an interesting short paper about password meters (I'm traveling without a laptoo right now, but can link it later) that found out people cared more about the strength of their password, if the login it's protecting is more important.

Combining these two points I think the percentage of ssh key users that use at least 12 character passwords is rather high, but of course I have no evidence. I spoke however about prod pws with some devs at my company and the answers ranged from 12 to ~20 chars and completely randomized 40chars in pw managers. Nothing especially short. You can also copy your ssh key pw from a pw manager.

You still make a good point in your article and using MD5 is not ideal, but I was missing information for the evaluation of risk I'm in. High enough entropy passwords seem not only better than plaintext, but actually still safe to me when MD5 is used.

Re:The default OpenSSH key encryption is worse than plaintext by angry_octet on Saturday August 04, 2018 @11:49AM (#17687289)
Why not uses a decent work function and not have to remember so many chars? I'm keeping track of >20 high complexity passwords that mostly rotate regularly, and my brain is full.

Anyway, it doesn't matter that your password is ygGucg,guc52f when your colleague's is bigbum99.

Re:The default OpenSSH key encryption is worse than plaintext by ascar on Saturday August 04, 2018 @11:26PM (#17689505)
If you have so many passwords, why not use a password manager?

Also there are some ways to create memorable and long passwords. E.g. I'm using short pictureable phrases and their translation in another language, sometimes adding a numeral if required. Example: "2YellowChopsticksZweiGelbeEssstäbchen" (even with spaces if allowed)

Very easy to remember for me, very high entropy, decent entropy if the pattern is known and requires a hand-crafted dictionary attack that even needs decent translation. E.g. in the example above chopsticks has two common German translations and the ä can also be written ae. Bonus points if you use it for a language you are currently learning.

Re:The default OpenSSH key encryption is worse than plaintext by angry_octet on Sunday August 05, 2018 @12:00AM (#17689594)
The passwords are on different systems, you sit at a console. You have to change them regularly. I can use long DICEWARE style passwords for SSH, but I'd rather just have it use scrypt.

Though I have thought of having a mechanical typing device, actuators for each key, that would just type them for me. But it would be conspicuous.

I do use keepass for all the hundreds of other passwords where possible.

Re:The default OpenSSH key encryption is worse than plaintext by maerF0x0 on Friday August 03, 2018 @06:51PM (#17684254)
Am I correct in my understanding that the vulnerability depends firstly on the leaking of the private RSA key? (as a rogue NPM module could do...)

How can I tell if my file is vulnerable once leaked?

Re:The default OpenSSH key encryption is worse than plaintext by angry_octet on Saturday August 04, 2018 @11:59AM (#17687327)
Did you use a simple password? It's vulnerable. If its semi-hard, and if you can't easily roll the key, try to crack it. Unless the attacker is targeting you specifically, they will give up after $x of cracking.

Switch to the newer format, roll your keys regularly, improve your logging, honeypot with the old keys, put AppArmor/SELinux controls on the .ssh directory.

Re:The default OpenSSH key encryption is worse than plaintext by lvh on Saturday August 04, 2018 @12:35AM (#17685399)
Yep; this is an attack on the password-encrypted file.

You can't tell if it's leaked or not unless osmeone starts using it. You can tell if it's in the safe format right now by looking at the first few lines of the file.

Re:The default OpenSSH key encryption is worse than plaintext by jwilk on Friday August 03, 2018 @05:27PM (#17683775)
Why the .singles TLD?
Re:The default OpenSSH key encryption is worse than plaintext by lvh on Friday August 03, 2018 @08:25PM (#17684636)
‘tqbf is responsible for that one :)