summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2011-12-06 20:42:46 +0000
committerTom Yu <tlyu@mit.edu>2011-12-06 20:42:46 +0000
commit8d6a83d1163fafb8e9308313c83ce0472864abbb (patch)
treea960b92ee93969365f937fa55b9f097648452928 /src
parent59666540607afb8a3c42738d0677ae2a3d4f88ce (diff)
downloadkrb5-8d6a83d1163fafb8e9308313c83ce0472864abbb.tar.gz
krb5-8d6a83d1163fafb8e9308313c83ce0472864abbb.tar.xz
krb5-8d6a83d1163fafb8e9308313c83ce0472864abbb.zip
SA-2011-007 KDC null pointer deref in TGS handling [CVE-2011-1530]
Fix a null pointer dereference condition that could cause a denial of service. ticket: 7042 target_version: 1.10 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25525 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/kdc/Makefile.in1
-rw-r--r--src/kdc/do_tgs_req.c3
-rw-r--r--src/kdc/t_emptytgt.py8
3 files changed, 11 insertions, 1 deletions
diff --git a/src/kdc/Makefile.in b/src/kdc/Makefile.in
index 118f8f780..8994a6a76 100644
--- a/src/kdc/Makefile.in
+++ b/src/kdc/Makefile.in
@@ -71,6 +71,7 @@ check-unix:: rtest
check-pytests::
$(RUNPYTEST) $(srcdir)/t_workers.py $(PYTESTFLAGS)
+ $(RUNPYTEST) $(srcdir)/t_emptytgt.py $(PYTESTFLAGS)
install::
$(INSTALL_PROGRAM) krb5kdc ${DESTDIR}$(SERVER_BINDIR)/krb5kdc
diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c
index 0f001d67c..56d9869c1 100644
--- a/src/kdc/do_tgs_req.c
+++ b/src/kdc/do_tgs_req.c
@@ -238,7 +238,8 @@ tgt_again:
if (!tgs_1 || !data_eq(*server_1, *tgs_1)) {
errcode = find_alternate_tgs(request, &server);
firstpass = 0;
- goto tgt_again;
+ if (errcode == 0)
+ goto tgt_again;
}
}
status = "UNKNOWN_SERVER";
diff --git a/src/kdc/t_emptytgt.py b/src/kdc/t_emptytgt.py
new file mode 100644
index 000000000..1760bcd5a
--- /dev/null
+++ b/src/kdc/t_emptytgt.py
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+from k5test import *
+
+realm = K5Realm(start_kadmind=False, create_host=False)
+output = realm.run_as_client([kvno, 'krbtgt/'], expected_code=1)
+if 'not found in Kerberos database' not in output:
+ fail('TGT lookup for empty realm failed in unexpected way')
+success('Empty tgt lookup.')