NetBSD Problem Report #61100

From www@netbsd.org  Tue Dec  1 08:43:49 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 000E71A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Dec 2026 08:43:48 +0000 (UTC)
Message-Id: <20261201084347.6B55A1A923D@mollari.NetBSD.org>
Date: Tue,  1 Dec 2026 08:43:47 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: openssh: various nonstandard krb5 issues
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         61100
>Category:       bin
>Synopsis:       openssh: various nonstandard krb5 issues
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 01 08:45:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Tue Dec 01 10:32:30 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, ...
>Organization:
The OpenSSH Kerberization, Inc.
>Environment:
>Description:

	We have local patches for a `KerberosAuthentication' option in
	ssh(1) and sshd(8).  This enables two different things:

	- Authenticating a client by having the client furnish a ticket
	  for host/${hostname}@${REALM} that the server verifies with
	  its service key if available.

	  This is roughly the intended way to use Kerberos, except it
	  uses the somewhat obscure `kerberos-2@ssh.com' framing
	  instead of standard `gssapi-with-mic' framing of RFC 4462 and
	  doesn't support, e.g., GSSAPIDelegateCredentials.  It was
	  implemented in upstream openssh in May 2003, and then deleted
	  in August 2003, but we've kept it around as a local patch
	  since then.

	- Authenticating a client by having the client furnish a
	  password that the sever verifies by
	  (a) acquiring a TGT from the KDC with it,
	  (b) acquiring a ticket for host/${hostname}@${REALM} from the
	      KDC with it, and
	  (c) verifying the ticket with the server's service key.
	  This is NOT the intended way to use Kerberos, but it is a way
	  to give users a familiar password-based experience that
	  happens to be backed by Kerberos -- much like pam_krb5(8).

	But there are various issues with this.

	1. `ssh -G' doesn't dump the krb5-related options on the client
	   side.

	2. The ssh_config(5) man page doesn't mention the krb5-related
	   options.

	3. The server side of kerberos-2@ssh.com has bitrotted over the
	   years:

	   (a) In the openssh-6.2 update in 2013, the logic for
	       handling AuthenticationMethods broke with
	       `kerberos-2@ssh.com' because in some places it is
	       spelled that way and in other places it is spelled as
	       `kerberos'.

	   (b) In the openssh-7.6 merge in 2017, when converting
	       packet_get_string/cstring to sshpkt_get_string/cstring,
	       the `string' and `cstring' versions got mixed up.

	   (c) In the openssh-9.8 import in 2024, the
	       kerberos-2@ssh.com method never got added to a new list
	       of authentication method configs, so it became
	       impossible to enable.

>How-To-Repeat:

	try to use KerberosAuthentication in openssh (and not
	GSSAPIAuthentication)

>Fix:

	Not entirely sure it was worthwhile but I already have patches
	to fix the server side, so might as well...

>Release-Note:

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61100 CVS commit: src/crypto/external/bsd/openssh/dist
Date: Tue, 1 Dec 2026 09:14:16 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Dec  1 09:14:16 UTC 2026

 Modified Files:
 	src/crypto/external/bsd/openssh/dist: auth2-krb5.c

 Log Message:
 sshd(8): Fix parsing of kerberos-2@ssh.com authentication packets.

 These are length-delimited byte strings, not NUL-delimited C strings.

 Fixes:

 userauth_kerberos: invalid format

 which had been broken since the openssh-7.6 import in 2017, when
 merge conflict resolution adapting the packet_get_string/cstring ->
 sshpkt_get_string/cstring change mixed up the `string' and `cstring'
 versions.

 https://mail-index.netbsd.org/source-changes/2017/10/07/msg088672.html

 PR bin/61100: openssh: various nonstandard krb5 issues


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.13 src/crypto/external/bsd/openssh/dist/auth2-krb5.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61100 CVS commit: src/crypto/external/bsd/openssh/dist
Date: Tue, 1 Dec 2026 09:14:43 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Dec  1 09:14:43 UTC 2026

 Modified Files:
 	src/crypto/external/bsd/openssh/dist: auth2-methods.c monitor.c

 Log Message:
 sshd(8): Fix kerberos-2@ssh.com configuration.

 This had bitrotted in the openssh-6.2 and openssh-9.8 updates.

 PR bin/61100: openssh: various nonstandard krb5 issues


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/auth2-methods.c
 cvs rdiff -u -r1.54 -r1.55 src/crypto/external/bsd/openssh/dist/monitor.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61100 CVS commit: src/crypto/external/bsd/openssh/dist
Date: Tue, 1 Dec 2026 10:24:56 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Dec  1 10:24:56 UTC 2026

 Modified Files:
 	src/crypto/external/bsd/openssh/dist: auth-krb5.c auth.h

 Log Message:
 sshd(8): Cull long-disused auth_krb5_tgt subroutine.

 This was used only in ssh protocol 1, which has been defunct since
 openssh-7.4.

 Cleanup prompted by:

 PR bin/61100: openssh: various nonstandard krb5 issues


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssh/dist/auth-krb5.c
 cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssh/dist/auth.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 01 Dec 2026 10:32:30 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-11 and pullup-10


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.