[openssh-commits] [openssh] branch master updated: enable KDC authenticate against host keytab

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 27 07:17:38 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 9b515d66e enable KDC authenticate against host keytab
9b515d66e is described below

commit 9b515d66e579f05c00deb186c3dd64e1769c18a4
Author: Damien Miller <djm at mindrot.org>
AuthorDate: Fri Nov 27 07:14:38 2026 +1100

    enable KDC authenticate against host keytab
    
    Avoids attack where an attacker who can spoof KDC traffic can login
    as non-root. Affects MIT Kerberos only, aparently Heimdal enables this
    by default
    
    Anthropic ANT-2026-5T79MXLL
---
 auth-krb5.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/auth-krb5.c b/auth-krb5.c
index 99d425431..04fb3b34d 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -74,6 +74,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
 #ifndef HEIMDAL
 	krb5_creds creds;
 	krb5_principal server;
+	krb5_verify_init_creds_opt vopt;
 #endif
 	krb5_error_code problem;
 	krb5_ccache ccache = NULL;
@@ -150,8 +151,15 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
 		goto out;
 
 	restore_uid();
+	/*
+	 * Require the KDC to prove itself against the host keytab; by
+	 * default libkrb5 silently skips this when the keytab is missing
+	 * or has no key for the server principal.
+	 */
+	krb5_verify_init_creds_opt_init(&vopt);
+	krb5_verify_init_creds_opt_set_ap_req_nofail(&vopt, 1);
 	problem = krb5_verify_init_creds(authctxt->krb5_ctx, &creds, server,
-	    NULL, NULL, NULL);
+	    NULL, NULL, &vopt);
 	krb5_free_principal(authctxt->krb5_ctx, server);
 	temporarily_use_uid(authctxt->pw);
 	if (problem)

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


More information about the openssh-commits mailing list