[openssh-commits] [openssh] branch master updated: harden password checking

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Nov 9 17:25:50 AEDT 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new 1d28115e0 harden password checking
1d28115e0 is described below

commit 1d28115e040b792075a391de01b0f0c033a4850a
Author: Damien Miller <djm at mindrot.org>
AuthorDate: Mon Nov 9 17:24:37 2026 +1100

    harden password checking
    
    Never allow an account that we couldn't find a salt for to pass password
    authentication, even if crypt() returns hash that matches what is in shadow.
---
 auth-passwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/auth-passwd.c b/auth-passwd.c
index 2fafba4fd..c5644f12e 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -228,7 +228,7 @@ sys_auth_passwd(struct ssh *ssh, const char *password)
 	 * Authentication is accepted if the encrypted passwords
 	 * are identical.
 	 */
-	ret = encrypted_password != NULL &&
+	ret = encrypted_password != NULL && salt != NULL &&
 	    strlen(pw_password) >= MIN_PASSWORD_HASH_LEN &&
 	    strcmp(encrypted_password, pw_password) == 0;
 	freezero(pw_password, strlen(pw_password));

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list