Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 496744 - net-misc/openssh uses insecure defaults
Summary: net-misc/openssh uses insecure defaults
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://bettercrypto.org/static/appli...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-02 10:27 UTC by Ortwin Glueck
Modified: 2014-01-03 18:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ortwin Glueck 2014-01-02 10:27:10 UTC
The current default /etc/sshd_config and /etc/ssh_config files have insecure defaults. The worst of which is a severe limitation of the used server key to 1024 bits.

See URL for safe recommendations. NB: The document assumes OpenSSH 6.1 which has not been stabilized yet. So adapt to older versions.

Reproducible: Always
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2014-01-02 15:47:20 UTC
Can you give examples of what you've like changed and what you have an issue with? As far as key size, from what I can tell our default DSA size is 1024 while RSA is 2048 and ECDSA is 256.
Comment 2 SpanKY gentoo-dev 2014-01-02 15:54:24 UTC
also note that the keys are presented in preferential order -- ecdsa, then rsa, then dsa.
Comment 3 Ortwin Glueck 2014-01-03 15:58:54 UTC
NB: I am not a crypto expert.

But looking at the referenced document, they suggest to use RSA only, because DSA key size of 1024 is insufficient. Even if DSA is tried last, I suggest to disable DSA explicitly in the default config:

Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
# 1024 bit DSA keys are not secure
#HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key

As far as I understand, any ECDSA key should be fine (as minimum key size is 256 bits, which is roughly equivalent to 128 bit symmetric keys).

The paper also restricts the available Ciphers, MACs and key exchange algorithms, which makes a lot of sense in my opinion: The default Ciphers include RC4, the default MACs includes MD5 (as first option!),  and the default KexAlgorithms list the (at least controversial) NIST curvers as first options. So the defaults allow downgrade attacks or directly result in easily broken encryption.

Thanks for yesterday's openssh bump by the way :-)

However, for curve25519-sha256@libssh.org to work, we need >=net-libs/libssh-0.6.0_rc1 stabilized!
Comment 4 SpanKY gentoo-dev 2014-01-03 17:19:21 UTC
(In reply to Ortwin Glueck from comment #3)

i don't think so.  DSA is tried last only when other key types are not available.  which means, the only things trying to use DSA are things that don't support ECDSA/RSA/etc... which means they don't get to even log in when DSA is off.

same goes for the ciphers.  the server says "i support these and this is the preference" but really it's up to the client to select the best possible.  if the client restricts itself to just RC4, then why is the client being dumb ?

if these defaults are good enough for the upstream openssh maintainers, i don't see a compelling reason to remove them in Gentoo today.  hand maintaining these lists is a pita because it means we have to re-evaluate the list every time we bump the package or add a patch (like hpn).
Comment 5 Ortwin Glueck 2014-01-03 18:10:38 UTC
(In reply to SpanKY from comment #4)
> which means they don't get to even log in when DSA is off.

Exactly, that's the intended behaviour. If someone needs DSA they are free to enable it. But then they should know that they create a vulnerability.

> same goes for the ciphers.  the server says "i support these and this is the
> preference" but really it's up to the client to select the best possible. 
> if the client restricts itself to just RC4, then why is the client being
> dumb ?

Because the security of the server should not depend on the client's choices! With the same argument you could install telnetd alongside with sshd and offer users to chose which to use... It's OBVIOUSLY dump to do that, right?

> if these defaults are good enough for the upstream openssh maintainers, i
> don't see a compelling reason to remove them in Gentoo today.

Well, the authors of that paper DO have a compelling reason to change defaults.

>  hand
> maintaining these lists is a pita 

Security is ALWAYS a pita.