Skip to contentSkip to conversation

openssh: fix GSSAPI CVE-2026-106555 and CVE-2026-106553

PATCH In review Benhur Tessele 2 participants 4 messages Oct 29 – Nov 20

lore
Share & tools
lore
#0 lore raw

cover openssh: fix GSSAPI CVE-2026-106555 and CVE-2026-106553

Backport two related upstream GSSAPIAuthentication fixes from OpenSSH 10.6p1 to openssh 9.6p1:

- CVE-2026-106555: reset GSSAPI client state before each authentication attempt (upstream 670510d1).
- CVE-2026-106553: only store GSSAPI credentials when authentication has succeeded (upstream 6f9cd19a).

The patches are ordered as upstream, as the second one applies on top of the helper function introduced by the first. The vulnerable code is only built when PACKAGECONFIG contains kerberos.

Tested by building openssh (bitbake openssh -c compile) for qemux86-64 with the default PACKAGECONFIG and with kerberos enabled (krb5 from meta-oe), confirming that GSSAPI support was compiled in.

Also ran the openssh ptest on qemux86-64 (core-image-ptest-openssh with PACKAGECONFIG kerberos, bitbake ... -c testimage): 82 PASS, 0 FAIL, 1 SKIP (agent-ptrace, gdb not installed). Note that the openssh regression suite has no GSSAPI tests, so this checks for general regressions only.

Benhur Tessele (2):
openssh: fix CVE-2026-106555
openssh: fix CVE-2026-106553

 .../openssh/openssh/CVE-2026-106553.patch     |  88 ++++++++++++++
 .../openssh/openssh/CVE-2026-106555.patch     | 109 ++++++++++++++++++
 .../openssh/openssh_9.6p1.bb                  |   2 +
 3 files changed, 199 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2026-106553.patch
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2026-106555.patch
#1 lore raw

PATCH 1/2 openssh: fix CVE-2026-106555

This patch applies the upstream fix that makes sshd reset the GSSAPI client state before each authentication attempt, so state from a partially-completed GSSAPIAuthentication attempt cannot be used by a later attempt. The upstream fix commit is referenced
in [1], and the public CVE advisory is referenced in [2].

The vulnerable code is only built when PACKAGECONFIG contains kerberos.

[1] https://github.com/openssh/openssh-portable/commit/670510d1e190b0f4e47066f24498c04ada1da0f0
[2] https://www.cve.org/CVERecord?id=CVE-2026-106555

---
 .../openssh/openssh/CVE-2026-106555.patch     | 109 ++++++++++++++++++
 .../openssh/openssh_9.6p1.bb                  |   1 +
 2 files changed, 110 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2026-106555.patch
meta/recipes-connectivity/openssh/openssh/CVE-2026-106555.patch new file +109 -0
new file mode 100644
index 0000000000..f310525a79
@@ -0,0 +1,109 @@
+From 670510d1e190b0f4e47066f24498c04ada1da0f0 Mon Sep 17 00:00:00 2001
+From: "[email protected]" <[email protected]>
+Date: Wed, 16 Sep 2026 00:37:07 +0000
+Subject: [PATCH] upstream: Reset GSSAPI client state before authentication
+
+Avoids situation where a partially-completed GSSAPI authentication attempt
+can retain state that is subsequently used by a later attempt.
+
+Report and feedback Moritz Theile, also reported by several others.
+
+ok markus, deraadt
+
+OpenBSD-Commit-ID: 95758f23e358b7c19e6205ac1c979193a9145556
+
+CVE: CVE-2026-106555
+Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/670510d1e190b0f4e47066f24498c04ada1da0f0]
+
+Backport Changes:
+- Omitted the upstream OpenBSD RCS revision header updates in auth2.c,
+  gss-serv.c, monitor.c and ssh-gss.h because they do not apply to the
+  OpenSSH 9.6p1 source revision.
+
+(cherry picked from commit 670510d1e190b0f4e47066f24498c04ada1da0f0)
+Signed-off-by: Benhur Tessele <[email protected]>
+---
+ auth2.c    |  1 +
+ gss-serv.c | 19 ++++++++++++-------
+ monitor.c  |  2 ++
+ ssh-gss.h  |  1 +
+ 4 files changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/auth2.c b/auth2.c
+index 271789a7..ba5d9a78 100644
+--- a/auth2.c
++++ b/auth2.c
+@@ -332,6 +332,7 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
+ 	auth2_challenge_stop(ssh);
+ 
+ #ifdef GSSAPI
++	ssh_gssapi_cleanup_global_client();
+ 	/* XXX move to auth2_gssapi_stop() */
+ 	ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
+ 	ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
+diff --git a/gss-serv.c b/gss-serv.c
+index 00e3d118..dc6d0d8e 100644
+--- a/gss-serv.c
++++ b/gss-serv.c
+@@ -354,12 +354,21 @@ ssh_gssapi_do_child(char ***envp, u_int *envsizep)
+ 	}
+ }
+ 
++void
++ssh_gssapi_cleanup_global_client()
++{
++	OM_uint32 lmin;
++
++	gss_release_buffer(&lmin, &gssapi_client.displayname);
++	gss_release_buffer(&lmin, &gssapi_client.exportedname);
++	gss_release_cred(&lmin, &gssapi_client.creds);
++	explicit_bzero(&gssapi_client, sizeof(ssh_gssapi_client));
++}
++
+ /* Privileged */
+ int
+ ssh_gssapi_userok(char *user)
+ {
+-	OM_uint32 lmin;
+-
+ 	if (gssapi_client.exportedname.length == 0 ||
+ 	    gssapi_client.exportedname.value == NULL) {
+ 		debug("No suitable client data");
+@@ -370,11 +379,7 @@ ssh_gssapi_userok(char *user)
+ 			return 1;
+ 		else {
+ 			/* Destroy delegated credentials if userok fails */
+-			gss_release_buffer(&lmin, &gssapi_client.displayname);
+-			gss_release_buffer(&lmin, &gssapi_client.exportedname);
+-			gss_release_cred(&lmin, &gssapi_client.creds);
+-			explicit_bzero(&gssapi_client,
+-			    sizeof(ssh_gssapi_client));
++			ssh_gssapi_cleanup_global_client();
+ 			return 0;
+ 		}
+ 	else
+diff --git a/monitor.c b/monitor.c
+index b3ed515e..2d563197 100644
+--- a/monitor.c
++++ b/monitor.c
+@@ -1840,6 +1840,8 @@ mm_answer_gss_setup_ctx(struct ssh *ssh, int sock, struct sshbuf *m)
+ 	if (!options.gss_authentication)
+ 		fatal_f("GSSAPI authentication not enabled");
+ 
++	ssh_gssapi_cleanup_global_client();
++
+ 	if ((r = sshbuf_get_string(m, &p, &len)) != 0)
+ 		fatal_fr(r, "parse");
+ 	goid.elements = p;
+diff --git a/ssh-gss.h b/ssh-gss.h
+index a8af117d..082c77bc 100644
+--- a/ssh-gss.h
++++ b/ssh-gss.h
+@@ -133,6 +133,7 @@ void ssh_gssapi_do_child(char ***, u_int *);
+ void ssh_gssapi_cleanup_creds(void);
+ void ssh_gssapi_storecreds(void);
+ const char *ssh_gssapi_displayname(void);
++void ssh_gssapi_cleanup_global_client();
+ 
+ #endif /* GSSAPI */
+ 
meta/recipes-connectivity/openssh/openssh_9.6p1.bb +1 -0
index 6c8138ddd8..c2089f37dc 100644
@@ -47,6 +47,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
            file://CVE-2026-73283.patch \
            file://CVE-2026-73282.patch \
            file://CVE-2026-73281.patch \
+           file://CVE-2026-106555.patch \
            "
 SRC_URI[sha256sum] = "910211c07255a8c5ad654391b40ee59800710dd8119dd5362de09385aa7a777c"
 
#2 lore raw

PATCH 2/2 openssh: fix CVE-2026-106553

In reply to Benhur Tessele

This patch applies the upstream fix that makes sshd only store GSSAPI credentials when authentication has succeeded, so credentials from a failed GSSAPIAuthentication attempt cannot persist and be used after a later authentication succeeds. The upstream fix commit is referenced in [1], and the public CVE advisory is referenced in [2].

The vulnerable code is only built when PACKAGECONFIG contains kerberos.

[1] https://github.com/openssh/openssh-portable/commit/6f9cd19af05aa828d7778cfb047faaed1679e8b7
[2] https://www.cve.org/CVERecord?id=CVE-2026-106553

---
 .../openssh/openssh/CVE-2026-106553.patch     | 88 +++++++++++++++++++
 .../openssh/openssh_9.6p1.bb                  |  1 +
 2 files changed, 89 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2026-106553.patch
meta/recipes-connectivity/openssh/openssh/CVE-2026-106553.patch new file +88 -0
new file mode 100644
index 0000000000..02aea5b04a
@@ -0,0 +1,88 @@
+From 6f9cd19af05aa828d7778cfb047faaed1679e8b7 Mon Sep 17 00:00:00 2001
+From: "[email protected]" <[email protected]>
+Date: Wed, 16 Sep 2026 00:37:52 +0000
+Subject: [PATCH] upstream: Only store GSSAPI creds when authn succeeds
+
+Issue report and patch from Moritz Theile
+
+ok markus, deraadt
+
+OpenBSD-Commit-ID: 812bbd22b8dd5a1583094ab2b6ff0045e4088467
+
+CVE: CVE-2026-106553
+Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/6f9cd19af05aa828d7778cfb047faaed1679e8b7]
+
+Backport Changes:
+- Omitted the upstream OpenBSD RCS revision header updates in gss-serv.c
+  and ssh-gss.h because they do not apply to the OpenSSH 9.6p1 source
+  revision.
+- OpenSSH 9.6p1 does not have the server-side GSSAPIDelegateCredentials
+  check in ssh_gssapi_storecreds() (added upstream in 94bf1154), so the
+  new userok check is added at the start of the function without that
+  surrounding context.
+
+(cherry picked from commit 6f9cd19af05aa828d7778cfb047faaed1679e8b7)
+Signed-off-by: Benhur Tessele <[email protected]>
+---
+ gss-serv.c | 13 ++++++++++---
+ ssh-gss.h  |  1 +
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/gss-serv.c b/gss-serv.c
+index dc6d0d8e..817b8fe5 100644
+--- a/gss-serv.c
++++ b/gss-serv.c
+@@ -51,7 +51,7 @@ extern ServerOptions options;
+ 
+ static ssh_gssapi_client gssapi_client =
+     { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
+-    GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL, NULL}};
++    GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL, NULL}, 0};
+ 
+ ssh_gssapi_mech gssapi_null_mech =
+     { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL};
+@@ -279,6 +279,7 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
+ 
+ 	gss_buffer_desc ename;
+ 
++	client->userok = 0;
+ 	client->mech = NULL;
+ 
+ 	while (supported_mechs[i]->name != NULL) {
+@@ -331,6 +332,11 @@ ssh_gssapi_cleanup_creds(void)
+ void
+ ssh_gssapi_storecreds(void)
+ {
++	if (!gssapi_client.userok) {
++		debug_f("GSSAPI client was not authorized, doing nothing");
++		return;
++	}
++
+ 	if (gssapi_client.mech && gssapi_client.mech->storecreds) {
+ 		(*gssapi_client.mech->storecreds)(&gssapi_client);
+ 	} else
+@@ -375,9 +381,10 @@ ssh_gssapi_userok(char *user)
+ 		return 0;
+ 	}
+ 	if (gssapi_client.mech && gssapi_client.mech->userok)
+-		if ((*gssapi_client.mech->userok)(&gssapi_client, user))
++		if ((*gssapi_client.mech->userok)(&gssapi_client, user)) {
++			gssapi_client.userok = 1;
+ 			return 1;
+-		else {
++		} else {
+ 			/* Destroy delegated credentials if userok fails */
+ 			ssh_gssapi_cleanup_global_client();
+ 			return 0;
+diff --git a/ssh-gss.h b/ssh-gss.h
+index 082c77bc..9d90fe45 100644
+--- a/ssh-gss.h
++++ b/ssh-gss.h
+@@ -74,6 +74,7 @@ typedef struct {
+ 	gss_cred_id_t creds;
+ 	struct ssh_gssapi_mech_struct *mech;
+ 	ssh_gssapi_ccache store;
++	int userok;
+ } ssh_gssapi_client;
+ 
+ typedef struct ssh_gssapi_mech_struct {
meta/recipes-connectivity/openssh/openssh_9.6p1.bb +1 -0
index c2089f37dc..ac5294c29f 100644
@@ -48,6 +48,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
            file://CVE-2026-73282.patch \
            file://CVE-2026-73281.patch \
            file://CVE-2026-106555.patch \
+           file://CVE-2026-106553.patch \
            "
 SRC_URI[sha256sum] = "910211c07255a8c5ad654391b40ee59800710dd8119dd5362de09385aa7a777c"
 
#3 lore raw
In reply to Benhur Tessele
Quoted 26 lines · Benhur T via lists.openembedded.org

Backport two related upstream GSSAPIAuthentication fixes from OpenSSH 10.6p1 to openssh 9.6p1:

- CVE-2026-106555: reset GSSAPI client state before each authentication attempt (upstream 670510d1).
- CVE-2026-106553: only store GSSAPI credentials when authentication has succeeded (upstream 6f9cd19a).

The patches are ordered as upstream, as the second one applies on top of the helper function introduced by the first. The vulnerable code is only built when PACKAGECONFIG contains kerberos.

Tested by building openssh (bitbake openssh -c compile) for qemux86-64 with the default PACKAGECONFIG and with kerberos enabled (krb5 from meta-oe), confirming that GSSAPI support was compiled in.

Also ran the openssh ptest on qemux86-64 (core-image-ptest-openssh with PACKAGECONFIG kerberos, bitbake ... -c testimage): 82 PASS, 0 FAIL, 1 SKIP (agent-ptrace, gdb not installed). Note that the openssh regression suite has no GSSAPI tests, so this checks for general regressions only.

Benhur Tessele (2):
openssh: fix CVE-2026-106555
openssh: fix CVE-2026-106553

Quoted 6 lines
 .../openssh/openssh/CVE-2026-106553.patch     |  88 ++++++++++++++
 .../openssh/openssh/CVE-2026-106555.patch     | 109 ++++++++++++++++++
 .../openssh/openssh_9.6p1.bb                  |   2 +
 3 files changed, 199 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2026-106553.patch
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2026-106555.patch

Hello,

This whole series is blocked pending a fix for those 2 CVEs on blacksail. I will let this series open for a few days but barring a blacksail fix, I will have, then, to drop this.

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS