summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Moise <alexandru.moise@windriver.com>2016-08-26 12:22:57 +0300
committerMartin Jansa <Martin.Jansa@gmail.com>2016-09-05 13:30:50 +0200
commit19dc7117fd0e95d1477eb5797fbe2a3cca8f7760 (patch)
tree8cdbb5e0937e2bc010b64ab680fdbfb4ee45fda6
parent0887841f141359acda72a5e8584bfe953bb24cdc (diff)
downloadmeta-openembedded-19dc7117fd0e95d1477eb5797fbe2a3cca8f7760.tar.gz
krb5: Fix S4U2Self KDC crash when anon is restricted
This is CVE-2016-3120 The validate_as_request function in kdc_util.c in the Key Distribution Center (KDC) in MIT Kerberos 5 (aka krb5) before 1.13.6 and 1.4.x before 1.14.3, when restrict_anonymous_to_tgt is enabled, uses an incorrect client data structure, which allows remote authenticated users to cause a denial of service (NULL pointer dereference and daemon crash) via an S4U2Self request. Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-connectivity/krb5/krb5/krb5-CVE-2016-3120.patch63
-rw-r--r--meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb1
2 files changed, 64 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/krb5/krb5/krb5-CVE-2016-3120.patch b/meta-oe/recipes-connectivity/krb5/krb5/krb5-CVE-2016-3120.patch
new file mode 100644
index 000000000..dbc46bb79
--- /dev/null
+++ b/meta-oe/recipes-connectivity/krb5/krb5/krb5-CVE-2016-3120.patch
@@ -0,0 +1,63 @@
1From 5b9b82d0696f1ffd4e693c1f8eafc0915b15e85b Mon Sep 17 00:00:00 2001
2From: Greg Hudson <ghudson@mit.edu>
3Date: Tue, 19 Jul 2016 11:00:28 -0400
4Subject: [PATCH] Fix S4U2Self KDC crash when anon is restricted
5
6cherry-picked from 93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7 upstream
7
8In validate_as_request(), when enforcing restrict_anonymous_to_tgt,
9use client.princ instead of request->client; the latter is NULL when
10validating S4U2Self requests.
11
12CVE-2016-3120:
13
14In MIT krb5 1.9 and later, an authenticated attacker can cause krb5kdc
15to dereference a null pointer if the restrict_anonymous_to_tgt option
16is set to true, by making an S4U2Self request.
17
18 CVSSv2 Vector: AV:N/AC:H/Au:S/C:N/I:N/A:C/E:H/RL:OF/RC:C
19
20ticket: 8458 (new)
21target_version: 1.14-next
22target_version: 1.13-next
23
24Upstream-Status: Backport
25
26Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
27---
28 src/kdc/kdc_util.c | 2 +-
29 src/tests/t_pkinit.py | 5 +++++
30 2 files changed, 6 insertions(+), 1 deletion(-)
31
32diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c
33index 48be1ae..10daec4 100644
34--- a/src/kdc/kdc_util.c
35+++ b/src/kdc/kdc_util.c
36@@ -700,7 +700,7 @@ validate_as_request(kdc_realm_t *kdc_active_realm,
37 return(KDC_ERR_MUST_USE_USER2USER);
38 }
39
40- if (check_anon(kdc_active_realm, request->client, request->server) != 0) {
41+ if (check_anon(kdc_active_realm, client.princ, request->server) != 0) {
42 *status = "ANONYMOUS NOT ALLOWED";
43 return(KDC_ERR_POLICY);
44 }
45diff --git a/src/tests/t_pkinit.py b/src/tests/t_pkinit.py
46index 762e322..d27d05b 100644
47--- a/src/tests/t_pkinit.py
48+++ b/src/tests/t_pkinit.py
49@@ -94,6 +94,11 @@ out = realm.run([kvno, realm.host_princ], expected_code=1)
50 if 'KDC policy rejects request' not in out:
51 fail('Wrong error for restricted anonymous PKINIT')
52
53+# Regression test for #8458: S4U2Self requests crash the KDC if
54+# anonymous is restricted.
55+realm.kinit(realm.host_princ, flags=['-k'])
56+realm.run([kvno, '-U', 'user', realm.host_princ])
57+
58 # Go back to a normal KDC and disable anonymous PKINIT.
59 realm.stop_kdc()
60 realm.start_kdc()
61--
622.5.0
63
diff --git a/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb b/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb
index 3a3886bce..12d35319c 100644
--- a/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb
+++ b/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb
@@ -36,6 +36,7 @@ SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}-signed.tar
36 file://krb5-admin-server.service \ 36 file://krb5-admin-server.service \
37 file://krb5-CVE-2016-3119.patch;striplevel=2 \ 37 file://krb5-CVE-2016-3119.patch;striplevel=2 \
38 file://0001-Work-around-uninitialized-warning-in-cc_kcm.c.patch;striplevel=2 \ 38 file://0001-Work-around-uninitialized-warning-in-cc_kcm.c.patch;striplevel=2 \
39 file://krb5-CVE-2016-3120.patch;striplevel=2 \
39" 40"
40SRC_URI[md5sum] = "f7ebfa6c99c10b16979ebf9a98343189" 41SRC_URI[md5sum] = "f7ebfa6c99c10b16979ebf9a98343189"
41SRC_URI[sha256sum] = "e528c30b0209c741f6f320cb83122ded92f291802b6a1a1dc1a01dcdb3ff6de1" 42SRC_URI[sha256sum] = "e528c30b0209c741f6f320cb83122ded92f291802b6a1a1dc1a01dcdb3ff6de1"