Blame SOURCES/Fix-KDC-null-deref-on-TGS-inner-body-null-server.patch

6e573e
From 0a8dfc380fe3b210662ba1b1d452fcec2f84841b Mon Sep 17 00:00:00 2001
6e573e
From: Greg Hudson <ghudson@mit.edu>
6e573e
Date: Tue, 3 Aug 2021 01:15:27 -0400
6e573e
Subject: [PATCH] Fix KDC null deref on TGS inner body null server
6e573e
6e573e
After the KDC decodes a FAST inner body, it does not check for a null
6e573e
server.  Prior to commit 39548a5b17bbda9eeb63625a201cfd19b9de1c5b this
6e573e
would typically result in an error from krb5_unparse_name(), but with
6e573e
the addition of get_local_tgt() it results in a null dereference.  Add
6e573e
a null check.
6e573e
6e573e
Reported by Joseph Sutton of Catalyst.
6e573e
6e573e
CVE-2021-37750:
6e573e
6e573e
In MIT krb5 releases 1.14 and later, an authenticated attacker can
6e573e
cause a null dereference in the KDC by sending a FAST TGS request with
6e573e
no server field.
6e573e
6e573e
ticket: 9008 (new)
6e573e
tags: pullup
6e573e
target_version: 1.19-next
6e573e
target_version: 1.18-next
6e573e
6e573e
RHEL 7.9 backport of commit: d775c95af7606a51bf79547a94fa52ddd1cb7f49
6e573e
---
6e573e
 src/kdc/do_tgs_req.c | 5 +++++
6e573e
 1 file changed, 5 insertions(+)
6e573e
6e573e
diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c
6e573e
index 572a2c363..a9a3beb9d 100644
6e573e
--- a/src/kdc/do_tgs_req.c
6e573e
+++ b/src/kdc/do_tgs_req.c
6e573e
@@ -204,6 +204,11 @@ process_tgs_req(krb5_kdc_req *request, krb5_data *pkt,
6e573e
         status = "FIND_FAST";
6e573e
         goto cleanup;
6e573e
     }
6e573e
+    if (sprinc == NULL) {
6e573e
+        status = "NULL_SERVER";
6e573e
+        errcode = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;
6e573e
+        goto cleanup;
6e573e
+    }
6e573e
 
6e573e
     errcode = get_local_tgt(kdc_context, &sprinc->realm, header_server,
6e573e
                             &local_tgt, &local_tgt_storage);