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

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