From owner-freebsd-security@freebsd.org Mon Aug 22 21:11:21 2016 Return-Path: Delivered-To: freebsd-security@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA83BC2654 for ; Mon, 22 Aug 2016 21:11:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3335B15AF; Mon, 22 Aug 2016 21:11:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 28059156D; Mon, 22 Aug 2016 21:11:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D537C234DD; Mon, 22 Aug 2016 21:11:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 67A8dGN8-sRA; Mon, 22 Aug 2016 21:11:14 +0000 (UTC) Subject: Re: svn commit: r304626 - head/lib/libpam/modules/pam_ssh DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 16892234D6 To: Eric van Gyzen , freebsd-security@FreeBSD.org References: <60cfbe14-5110-df59-29f3-2ede0fcf5456@FreeBSD.org> <26e1bd89-46c4-e1c1-4c2a-5ac9a830f0c7@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <6a114818-d4aa-6fd0-1770-22c8d6bed9e0@FreeBSD.org> Date: Mon, 22 Aug 2016 14:11:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <26e1bd89-46c4-e1c1-4c2a-5ac9a830f0c7@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="38cujjGuRhgUVucI9fmWsUo3hqMCbWwH2" X-Mailman-Approved-At: Mon, 22 Aug 2016 22:45:37 +0000 X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 21:11:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --38cujjGuRhgUVucI9fmWsUo3hqMCbWwH2 Content-Type: multipart/mixed; boundary="GQG4SG1ig2aUu6b4xI6tkbuxRBdMFQ1Lc" From: Bryan Drewery To: Eric van Gyzen , freebsd-security@FreeBSD.org Message-ID: <6a114818-d4aa-6fd0-1770-22c8d6bed9e0@FreeBSD.org> Subject: Re: svn commit: r304626 - head/lib/libpam/modules/pam_ssh References: <60cfbe14-5110-df59-29f3-2ede0fcf5456@FreeBSD.org> <26e1bd89-46c4-e1c1-4c2a-5ac9a830f0c7@FreeBSD.org> In-Reply-To: <26e1bd89-46c4-e1c1-4c2a-5ac9a830f0c7@FreeBSD.org> --GQG4SG1ig2aUu6b4xI6tkbuxRBdMFQ1Lc Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/22/2016 1:01 PM, Eric van Gyzen wrote: > I had never looked at pam_ssh before. Does it really ignore authorized= _keys and Yeah, that was the entire purpose! https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D15158 For its original purpose I can understand using it, to login *locally*...= I am surprised to find this too. > allow authentication using any of the default key file names? After a = quick > read of the code, that certainly seems to be the case. Does anyone els= e find > that alarming? Sure, it's in my ~/.ssh directory and has appropriate > permissions, but that doesn't mean I want to use it for authentication = to this > machine (or any machine sharing this home directory). That's what > authorized_keys is for. I might have created it only to authenticate f= rom this > machine to another one. I might have even given it an empty passphrase= because > that other machine is disposable and I don't really care about it. At least it is off-by-default: > # grep -r pam_ssh /etc/pam.d|grep auth > /etc/pam.d/system:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/ftp:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/ftpd:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/telnetd:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/xdm:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/imap:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/other:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/sshd:#auth sufficient pam_ssh.so = no_warn try_first_pass > /etc/pam.d/pop3:#auth sufficient pam_ssh.so = no_warn try_first_pass The implications of uncommenting these are not explained in the files though. The manpage has this gem: "nullok Normally, keys with no passphrase are ignored for authentication purposes. If this option is set, keys with no passphrase will be taken into consideration, allowing the user to log in with a blank password." Why would anyone ever use nullok and use the pam_ssh module? I don't know pam well but I'm sure there's another way to make a check always succeed without a password. So supporting nullok in pam_ssh is just asking for an unknown security bug. I would really like to see nullok support removed from pam_ssh. Why is it even in the remote service files as an example when it is dangerous in those contexts? I find the pam configuration files overly complex and error-prone to begin with, but to discover that there's such a bombshell sitting there is concerning. >=20 > Eric >=20 > On 08/22/2016 14:27, Ollivier Robert wrote: >> Author: roberto >> Date: Mon Aug 22 19:27:20 2016 >> New Revision: 304626 >> URL: https://svnweb.freebsd.org/changeset/base/304626 >> >> Log: >> Add support for Ed25519 keys. >> =20 >> Reported by: mwlucas >> MFH: 2 weeks >> >> Modified: >> head/lib/libpam/modules/pam_ssh/pam_ssh.8 >> head/lib/libpam/modules/pam_ssh/pam_ssh.c >> >> Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/libpam/modules/pam_ssh/pam_ssh.8 Mon Aug 22 19:05:11 2016= (r304625) >> +++ head/lib/libpam/modules/pam_ssh/pam_ssh.8 Mon Aug 22 19:27:20 2016= (r304626) >> @@ -137,6 +137,8 @@ SSH2 RSA key >> SSH2 DSA key >> .It Pa $HOME/.ssh/id_ecdsa >> SSH2 ECDSA key >> +.It Pa $HOME/.ssh/id_ed25519 >> +SSH2 Ed25519 key >> .El >> .Sh SEE ALSO >> .Xr ssh-agent 1 , >> >> Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 22 19:05:11 2016= (r304625) >> +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 22 19:27:20 2016= (r304626) >> @@ -81,6 +81,7 @@ static const char *pam_ssh_keyfiles[] =3D=20 >> ".ssh/id_rsa", /* SSH2 RSA key */ >> ".ssh/id_dsa", /* SSH2 DSA key */ >> ".ssh/id_ecdsa", /* SSH2 ECDSA key */ >> + ".ssh/id_ed25519", /* SSH2 Ed25519 key */ >> NULL >> }; >> =20 >> --=20 Regards, Bryan Drewery --GQG4SG1ig2aUu6b4xI6tkbuxRBdMFQ1Lc-- --38cujjGuRhgUVucI9fmWsUo3hqMCbWwH2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXu2pxAAoJEDXXcbtuRpfPGQYIAJjl9ZPETowtVFZb611X3zHu IkI6Dy+WCrVf0bhRL2gVaePBKGjcNNoO/uCr01ieierZwvsgmoABPtN2+m49rW1l cYVgTBt39mO9aUN+JzN+uSBT7BRzqW/eAJ07ECKGSQWK/9JXP8mK3i3MvJMOkzAl 8tlLrw+pMJaE9cEOUuhEqXvd5tZbzDl0YzEErzRh2dWLNYfFwHxAqNhbGRMcMWsx vEctg76H/u1zRqvkrg4q2eGAMYzBfqNeqbx84cJ7mI2zuZVvjI7Jlp3psKz/gWjo Bbchky6ADpd4mv2jEmTse1IUJUSm/xEOEhHPJOB30Bb+ByXrsgme24U+9zHuc+I= =Ldk3 -----END PGP SIGNATURE----- --38cujjGuRhgUVucI9fmWsUo3hqMCbWwH2--