You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I reported this issue to "downstream" in Debian at https://bugs.debian.org/890508 but since depending on how large the buffer is it can be an issue for other distributions as well. Full quoting here:
Hi
The issue was found under the following precondition:
On Debian Stretch server, with pam configured to use pam_ldap from nss-pam-ldapd:
The sshd_config contains UseDNS=yes (changed from default).
A user now logging in from remote via SSH with a host resolving to a FQDN with
length longer than 64 bytes unsing password authentication triggers the
following:
Feb 12 16:41:30 XXXXXXXX sshd[5563]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=XXX.XXX.XXX.XXX.XXXXXXX.XXXXX.XXXXXXXXXXXXXX.XXX.XXXX.XXXXXXXX.XX user=XXXXX
Feb 12 16:41:30 XXXXXXXX nslcd[2282]: [54e2c3] client supplied argument 1 bytes too large
Feb 12 16:41:30 XXXXXXXX sshd[5563]: pam_ldap(sshd:auth): error reading from nslcd: Connection reset by peer
Feb 12 16:41:31 XXXXXXXX sshd[5563]: Failed password for XXXXX from XXX.XXX.XXX.XXX port 4324 ssh2
Feb 12 16:41:31 XXXXXXXX sshd[5563]: Connection closed by authenticating user XXXXX XXX.XXX.XXX.XXX port 4324 [preauth]
Looking closer on what happens the issue seem to raised in nslcd/pam.c:
Hi
I reported this issue to "downstream" in Debian at https://bugs.debian.org/890508 but since depending on how large the buffer is it can be an issue for other distributions as well. Full quoting here:
Hi
The issue was found under the following precondition:
On Debian Stretch server, with pam configured to use pam_ldap from nss-pam-ldapd:
The
sshd_config
containsUseDNS=yes
(changed from default).A user now logging in from remote via SSH with a host resolving to a FQDN with
length longer than 64 bytes unsing password authentication triggers the
following:
Looking closer on what happens the issue seem to raised in
nslcd/pam.c
:on line 279, where from
fp
therhost
is read into therhost
buffer. On Debiansystem that
BUFLEN_HOSTNAME
will be only 64 (nslcd/common.h
):In
pam/pam.c
itselfAnd in our case we had a FQDN hostname one byte larger as
nslcd_pam_authc
could handle for rhost.According at least to https://tools.ietf.org/html/rfc1035#section-2.3.1
and the further clarification
https://tools.ietf.org/html/rfc2181#section-11 rhost (considering full
domain names) should probably be limited to 255.
I'm not sure how to correctly fix it.
Regards,
Salvatore
The text was updated successfully, but these errors were encountered: