]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
9 years agoUpdate for krb5-1.12.5-postrelease krb5-1.12
Tom Yu [Wed, 16 Dec 2015 21:59:25 +0000 (16:59 -0500)] 
Update for krb5-1.12.5-postrelease

9 years agoUpdates for krb5-1.12.5 krb5-1.12.5-final
Tom Yu [Mon, 14 Dec 2015 21:23:34 +0000 (16:23 -0500)] 
Updates for krb5-1.12.5

9 years agoUpdate supported releases list
Tom Yu [Tue, 15 Dec 2015 23:13:22 +0000 (18:13 -0500)] 
Update supported releases list

Update the supported releases list in mitK5features.rst.

9 years agoDocument 1.12 changes in MIT Kerberos Features doc
Zhanna Tsitkov [Fri, 14 Feb 2014 21:17:47 +0000 (16:17 -0500)] 
Document 1.12 changes in MIT Kerberos Features doc

(cherry picked from commit 5489cb326bc5b13c9dcb0f76228cc964dd9fdb5d)

ticket: 8328 (new)
version_fixed: 1.12.5
status: resolved

9 years agomake update-po
Tom Yu [Mon, 14 Dec 2015 20:35:09 +0000 (15:35 -0500)] 
make update-po

9 years agoUpdate man pages
Tom Yu [Mon, 14 Dec 2015 20:34:47 +0000 (15:34 -0500)] 
Update man pages

9 years agoCheck output params on GSS OID set functions
Tomas Kuthan [Wed, 30 Sep 2015 13:18:05 +0000 (15:18 +0200)] 
Check output params on GSS OID set functions

Add sanity checks for the output parameters of
generic_gss_create_empty_oid_set() and
generic_gss_add_oid_set_member(), which are used directly by the API
functions gss_create_empty_oid_set() and gss_add_oid_set_member().

[ghudson@mit.edu: edit commit message]

(cherry picked from commit c9e035794caa784b6cdf416e2b3f1d641d011390)

ticket: 8325 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix gss_inquire_names_for_mech() on MS krb5 mech
Tomas Kuthan [Wed, 30 Sep 2015 13:24:24 +0000 (15:24 +0200)] 
Fix gss_inquire_names_for_mech() on MS krb5 mech

Allow the krb5 mech to query names for the gss_mech_krb5_wrong OID
(the erroneous OID used in old Microsoft SPNEGO implementations).

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 95736f7d51cce7551c3c20450ff56831a71043df)

ticket: 8324 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix typo in GSS_S_UNAUTHORIZED error message
Tomas Kuthan [Wed, 30 Sep 2015 13:14:40 +0000 (15:14 +0200)] 
Fix typo in GSS_S_UNAUTHORIZED error message

Remove an erroneous double space in the gss_display_status() result
for GSS_S_UNAUTHORIZED.

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 36732bf2084803eef52ad56576e5a50f37ccd115)

ticket: 8323 (new)
version_fixed: 1.12.5
status: resolved

9 years agoDefine error status GSS_S_BAD_MIC
Tomas Kuthan [Wed, 30 Sep 2015 13:11:03 +0000 (15:11 +0200)] 
Define error status GSS_S_BAD_MIC

RFC 2743 adds GSS_S_BAD_MIC as an alias for GSS_S_BAD_SIG.

[ghudson@mit.edu: edit commit messsage]

(cherry picked from commit be87852a12737eed448032875fb74f23e9cbf26b)

ticket: 8322 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix minor utf8-to-ucs2s read overrun bug
Greg Hudson [Fri, 25 Sep 2015 21:31:53 +0000 (17:31 -0400)] 
Fix minor utf8-to-ucs2s read overrun bug

k5_utf8s_to_ucs2s() reads and ignores one extra byte from the input
string before terminating its loop, possibly overrunning the input
buffer of its caller.  This overrun is typically without consequence,
but can show up in tools like asan or valgrind during RC4
string-to-key operations.  Fix the bug by swapping the order of the
loop conditions.

(cherry picked from commit eb52da21d72faa3d00b1205a5a0fdbabc45c9e6d)

ticket: 8321 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix error mappings for IOV MIC mechglue funcs
Tomas Kuthan [Wed, 16 Sep 2015 10:13:26 +0000 (12:13 +0200)] 
Fix error mappings for IOV MIC mechglue funcs

The mechglue functions gss_get_mic_iov(), gss_get_mic_iov_length(),
and gss_verify_mic_iov() don't call map_error() to map
mechanism-specific error codes.  As a result, a subsequent call to
gss_display_status() fails with GSS_S_BAD_MECH, because no translation
for the error code is found in the error table.

This patch adds the missing map_error call.

[ghudson@mit.edu: correct a whitespace issue, edit commit message]

(cherry picked from commit 969c976ff021db7e409ce9a38d28316d9acfa2cc)

ticket: 8320 (new)
version_fixed: 1.12.5
status: resolved

9 years agoUntabify kerberos.schema and kerberos.ldif
Greg Hudson [Wed, 16 Sep 2015 16:06:08 +0000 (12:06 -0400)] 
Untabify kerberos.schema and kerberos.ldif

Tabs are not equivalent to spaces in LDIF.

(cherry picked from commit dd2baa849b00fa1f26d722450f22f13e34e71af4)

ticket: 8319 (new)
version_fixed: 1.12.5
status: resolved

9 years agoRemove ksu -D flag documentation
Remi Ferrand [Sat, 15 Nov 2014 10:40:11 +0000 (11:40 +0100)] 
Remove ksu -D flag documentation

ksu -D does not work in the default build, so we should not document
it.  Remove any mention of it from the usage message and from ksu.rst.

[ghudson@mit.edu: edited commit message; omit change to generated man
page]

(cherry picked from commit f4e3e096af73254f208d0fc0632db12fc559e1ad)

ticket: 8318 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix compatibility with pre-1.11 iprop dump files
Greg Hudson [Fri, 17 Jul 2015 17:03:35 +0000 (13:03 -0400)] 
Fix compatibility with pre-1.11 iprop dump files

Ticket #7223 added new policy fields and a new dump format version to
marshal them, but did not add a new iprop dump format version.  As a
result, slave KDCs running 1.11 or later cannot receive full resyncs
from master KDCs running 1.10 or earlier.  (Reported by John
Devitofranceschi.)

Retroactively add support for pre-1.11 policy entries by making
process_r1_11_policy() read the first ten fields, check whether the
next whitespace character is a newline, and then read the rest if it
is not.

(back ported from commit 3c9ab5220bcc3f57641f6f4b6942b17aadb6613d)
(cherry picked from commit 6f1b25097969b4685263639a5214d440ce233793)

ticket: 8317 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix SPNEGO context import
Greg Hudson [Mon, 2 Nov 2015 03:46:56 +0000 (22:46 -0500)] 
Fix SPNEGO context import

The patches for CVE-2015-2695 did not implement a SPNEGO
gss_import_sec_context() function, under the erroneous belief that an
exported SPNEGO context would be tagged with the underlying context
mechanism.  Implement it now to allow SPNEGO contexts to be
successfully exported and imported after establishment.

(cherry picked from commit 222b09f6e2f536354555f2a0dedfe29fc10c01d6)

ticket: 8316
version_fixed: 1.12.5
status: resolved

9 years agoFix IAKERB context export/import [CVE-2015-2698]
Greg Hudson [Mon, 2 Nov 2015 03:45:21 +0000 (22:45 -0500)] 
Fix IAKERB context export/import [CVE-2015-2698]

The patches for CVE-2015-2696 contained a regression in the newly
added IAKERB iakerb_gss_export_sec_context() function, which could
cause it to corrupt memory.  Fix the regression by properly
dereferencing the context_handle pointer before casting it.

Also, the patches did not implement an IAKERB gss_import_sec_context()
function, under the erroneous belief that an exported IAKERB context
would be tagged as a krb5 context.  Implement it now to allow IAKERB
contexts to be successfully exported and imported after establishment.

CVE-2015-2698:

In any MIT krb5 release with the patches for CVE-2015-2696 applied, an
application which calls gss_export_sec_context() may experience memory
corruption if the context was established using the IAKERB mechanism.
Historically, some vulnerabilities of this nature can be translated
into remote code execution, though the necessary exploits must be
tailored to the individual application and are usually quite
complicated.

    CVSSv2 Vector: AV:N/AC:H/Au:S/C:C/I:C/A:C/E:POC/RL:OF/RC:C

(back ported from commit 3db8dfec1ef50ddd78d6ba9503185995876a39fd)

ticket: 8316 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix build_principal memory bug [CVE-2015-2697]
Greg Hudson [Fri, 25 Sep 2015 16:51:47 +0000 (12:51 -0400)] 
Fix build_principal memory bug [CVE-2015-2697]

In build_principal_va(), use k5memdup0() instead of strdup() to make a
copy of the realm, to ensure that we allocate the correct number of
bytes and do not read past the end of the input string.  This bug
affects krb5_build_principal(), krb5_build_principal_va(), and
krb5_build_principal_alloc_va().  krb5_build_principal_ext() is not
affected.

CVE-2015-2697:

In MIT krb5 1.7 and later, an authenticated attacker may be able to
cause a KDC to crash using a TGS request with a large realm field
beginning with a null byte.  If the KDC attempts to find a referral to
answer the request, it constructs a principal name for lookup using
krb5_build_principal() with the requested realm.  Due to a bug in this
function, the null byte causes only one byte be allocated for the
realm field of the constructed principal, far less than its length.
Subsequent operations on the lookup principal may cause a read beyond
the end of the mapped memory region, causing the KDC process to crash.

CVSSv2: AV:N/AC:L/Au:S/C:N/I:N/A:C/E:POC/RL:OF/RC:C

(cherry picked from commit f0c094a1b745d91ef2f9a4eae2149aac026a5789)

ticket: 8315 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix IAKERB context aliasing bugs [CVE-2015-2696]
Nicolas Williams [Mon, 14 Sep 2015 16:28:36 +0000 (12:28 -0400)] 
Fix IAKERB context aliasing bugs [CVE-2015-2696]

The IAKERB mechanism currently replaces its context handle with the
krb5 mechanism handle upon establishment, under the assumption that
most GSS functions are only called after context establishment.  This
assumption is incorrect, and can lead to aliasing violations for some
programs.  Maintain the IAKERB context structure after context
establishment and add new IAKERB entry points to refer to it with that
type.  Add initiate and established flags to the IAKERB context
structure for use in gss_inquire_context() prior to context
establishment.

CVE-2015-2696:

In MIT krb5 1.9 and later, applications which call
gss_inquire_context() on a partially-established IAKERB context can
cause the GSS-API library to read from a pointer using the wrong type,
generally causing a process crash.  Java server applications using the
native JGSS provider are vulnerable to this bug.  A carefully crafted
IAKERB packet might allow the gss_inquire_context() call to succeed
with attacker-determined results, but applications should not make
access control decisions based on gss_inquire_context() results prior
to context establishment.

    CVSSv2 Vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:POC/RL:OF/RC:C

[ghudson@mit.edu: several bugfixes, style changes, and edge-case
behavior changes; commit message and CVE description]

(cherry picked from commit e04f0283516e80d2f93366e0d479d13c9b5c8c2a)

ticket: 8313
version_fixed: 1.12.5
status: resolved

9 years agoFix mechglue gss_acquire_cred_impersonate_name
Simo Sorce [Fri, 13 Nov 2015 19:44:54 +0000 (14:44 -0500)] 
Fix mechglue gss_acquire_cred_impersonate_name

Checking for the generic gss_acquire_cred() function is no guarantee
that gss_acquire_cred_impersonate_name() is also implemented.

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 46a4e225d2ecaa4077aa65f12f64273bf4911d3a)

ticket: 8314 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix SPNEGO context aliasing bugs [CVE-2015-2695]
Nicolas Williams [Mon, 14 Sep 2015 16:27:52 +0000 (12:27 -0400)] 
Fix SPNEGO context aliasing bugs [CVE-2015-2695]

The SPNEGO mechanism currently replaces its context handle with the
mechanism context handle upon establishment, under the assumption that
most GSS functions are only called after context establishment.  This
assumption is incorrect, and can lead to aliasing violations for some
programs.  Maintain the SPNEGO context structure after context
establishment and refer to it in all GSS methods.  Add initiate and
opened flags to the SPNEGO context structure for use in
gss_inquire_context() prior to context establishment.

CVE-2015-2695:

In MIT krb5 1.5 and later, applications which call
gss_inquire_context() on a partially-established SPNEGO context can
cause the GSS-API library to read from a pointer using the wrong type,
generally causing a process crash.  This bug may go unnoticed, because
the most common SPNEGO authentication scenario establishes the context
after just one call to gss_accept_sec_context().  Java server
applications using the native JGSS provider are vulnerable to this
bug.  A carefully crafted SPNEGO packet might allow the
gss_inquire_context() call to succeed with attacker-determined
results, but applications should not make access control decisions
based on gss_inquire_context() results prior to context establishment.

    CVSSv2 Vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:POC/RL:OF/RC:C

[ghudson@mit.edu: several bugfixes, style changes, and edge-case
behavior changes; commit message and CVE description]

(cherry picked from commit b51b33f2bc5d1497ddf5bd107f791c101695000d)

ticket: 8313 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix KDC client referrals
Greg Hudson [Thu, 3 Sep 2015 16:38:44 +0000 (12:38 -0400)] 
Fix KDC client referrals

Although our built-in KDB modules do not support client referrals for
AS requests, the KDC is supposed to return one if a third-party module
returns a DB entry containing a principal in a foreign realm.
Unfortunately, this code has never worked; in prepare_error_as(), we
erroneously compare the protocol code errcode against the com_err code
KRB5KDC_ERR_WRONG_REALM; as a result, we never supply the canonical
client principal.  Fix this by comparing errcode against the protocol
code KDC_ERR_WRONG_REALM instead.

Discovered by Alexander Bokovoy and Simo Sorce.

(cherry picked from commit 4e036ef4127a9b09d1a567472da1df24c55cdb89)

ticket: 8312 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix error handling in gss_export_sec_context()
Nicolas Williams [Tue, 1 Sep 2015 23:42:58 +0000 (19:42 -0400)] 
Fix error handling in gss_export_sec_context()

In the mechglue gss_export_sec_context(), make sure to delete the
union context if the underlying mech context has been deleted.  This
can happen if the mech's gss_export_sec_context() returns a failure
and deletes the context (not a behavior exhibited by any of our
in-tree mechanisms, but an allowed behavior for other mechs), or if we
fail to allocate space for the wrapped token.

[ghudson@mit.edu: commit message; rename exit label to "cleanup" and
make it valid for all exit cases]

(cherry picked from commit 4f35b27a9ee38ca0b557ce8e6d059924a63d4eff)

ticket: 8311 (new)
version_fixed: 1.12.5
status: resolved

9 years agoCheck for null name_type in gss_display_name_ext
Solly Ross [Thu, 27 Aug 2015 19:55:35 +0000 (15:55 -0400)] 
Check for null name_type in gss_display_name_ext

It is possible for the input name's name_type to be GSS_C_NO_OID.
g_OID_equal() does not account for GSS_C_NO_OID, so we have to
manually check before use to prevent null pointer dereferences.

(cherry picked from commit 3fdf09ac9a36581b47f40c9d177e463cc12687ff)

ticket: 8310 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix gss_inquire_name() name_is_MN result
Isaac Boukris [Wed, 12 Aug 2015 23:28:36 +0000 (02:28 +0300)] 
Fix gss_inquire_name() name_is_MN result

Currently name_is_MN is left uninitialized for non-mechanism names due
to a typo.

[ghudson@mit.edu: edited commit message]

(cherry picked from commit a3f3f4069858ea795b732ec1d96fae20d5fafe24)

ticket: 8308 (new)
version_fixed: 1.12.5
status: resolved

9 years agoDo not allow stream socket retries in libkrad
Nathaniel McCallum [Fri, 7 Aug 2015 19:35:58 +0000 (15:35 -0400)] 
Do not allow stream socket retries in libkrad

Before this patch, libkrad would follow the same exact logic for all
socket types when the retries parameter was non-zero.  This meant that
when connecting with SOCK_STREAM, multiple requests were sent in case
of packet drops, which, of course, cannot happen for SOCK_STREAM.

Instead, just disable retries for SOCK_STREAM sockets.

[ghudson@mit.edu: minor wording edits]

(cherry picked from commit 25e0656fdf9862faf9aa91288023776e9a47caad)

ticket: 8307 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix uncommon leak in krb5_init_creds_step()
Greg Hudson [Sun, 26 Jul 2015 17:21:47 +0000 (13:21 -0400)] 
Fix uncommon leak in krb5_init_creds_step()

Release any previous value of ctx->err_padata before setting it in
init_creds_step_reply().  It could have a prior value after a realm
referral or retriable error.

(cherry picked from commit 997eb174f5fd81747ad0ecb671f00c25951931b1)

ticket: 8306 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix uncommon null dereference in PKINIT client
Greg Hudson [Fri, 3 Jul 2015 23:34:46 +0000 (19:34 -0400)] 
Fix uncommon null dereference in PKINIT client

crypto_retrieve_cert_sans() is allowed to set its princs output to
NULL, although the OpenSSL implementation rarely does.  Fix the
TRACE_PKINIT_CLIENT_SAN_KDCCERT_PRINC for loop to allow this like other
parts of the function do, and also get rid of the unnecessary princptr
variable by using an integer index like other parts of the function.

Based on a patch from Daniel Deptula.

(cherry picked from commit 47b37b9e13ca1456ba6710f31bc41012d050dd07)

ticket: 8305 (new)
version_fixed: 1.12.5
status: resolved

9 years agoFix leak in gss_acquire_cred_with_password
Greg Hudson [Fri, 19 Jun 2015 21:16:52 +0000 (17:16 -0400)] 
Fix leak in gss_acquire_cred_with_password

The target_mechs array needs to be freed on successful return.

(cherry picked from commit 02a85d73c4548d27dcbc1c1681b4bf1370b03632)

ticket: 8304 (new)
version_fixed: 1.12.5
status: resolved

9 years agoTolerate null oid pointer in gss_release_oid()
Greg Hudson [Wed, 10 Jun 2015 23:48:51 +0000 (19:48 -0400)] 
Tolerate null oid pointer in gss_release_oid()

Under some circumstances, gss_inquire_name() can call
gss_release_oid() with a null oid pointer, which currently causes a
null dereference.  The least invasive fix is for gss_release_oid() to
check for the invalid null pointer and return an error, like other
GSS-API functions do.

(cherry picked from commit 4676e823e6ee9a5731872b31c5588c1b5932e0a3)

ticket: 8303 (new)
version_fixed: 1.12.5
status: resolved

9 years agoDocument multi-component profile paths
Greg Hudson [Thu, 23 Oct 2014 19:06:13 +0000 (15:06 -0400)] 
Document multi-component profile paths

In env_variables.rst and krb5_conf.rst, document that KRB5_CONFIG can
contain multiple colon-separated pathnames.

(cherry picked from commit 28dc817d2a065f5e0ab73377350a0529b2f4aa48)

ticket: 8302 (new)
version_fixed: 1.12.5
status: resolved

10 years agoUpdate for krb5-1.12.4-postrelease
Tom Yu [Fri, 29 May 2015 22:49:22 +0000 (18:49 -0400)] 
Update for krb5-1.12.4-postrelease

10 years agoUpdates for krb5-1.12.4 krb5-1.12.4-final
Tom Yu [Fri, 29 May 2015 19:15:55 +0000 (15:15 -0400)] 
Updates for krb5-1.12.4

10 years agomake update-po
Tom Yu [Fri, 22 May 2015 19:19:55 +0000 (15:19 -0400)] 
make update-po

10 years agoUpdate manpages
Tom Yu [Thu, 21 May 2015 22:02:55 +0000 (18:02 -0400)] 
Update manpages

10 years agoFix minor documentation errors
Michael Mattioli [Thu, 23 Apr 2015 05:39:37 +0000 (01:39 -0400)] 
Fix minor documentation errors

Fix typos, remove excess header underlines, and remove trailing
whitespace.

[ghudson@mit.edu: squashed several commits, summarized commit
messages]

(cherry picked from commit 4ad099d28437b542b76053f44f18f763bdcd5152)
(cherry picked from commit 2c31abee54d193a007d2f170d6b6746ce277146f)

ticket: 8195 (new)
version_fixed: 1.12.4
status: resolved

10 years agoPrevent requires_preauth bypass [CVE-2015-2694]
Greg Hudson [Tue, 24 Mar 2015 16:02:37 +0000 (12:02 -0400)] 
Prevent requires_preauth bypass [CVE-2015-2694]

In the OTP kdcpreauth module, don't set the TKT_FLG_PRE_AUTH bit until
the request is successfully verified.  In the PKINIT kdcpreauth
module, don't respond with code 0 on empty input or an unconfigured
realm.  Together these bugs could cause the KDC preauth framework to
erroneously treat a request as pre-authenticated.

CVE-2015-2694:

In MIT krb5 1.12 and later, when the KDC is configured with PKINIT
support, an unauthenticated remote attacker can bypass the
requires_preauth flag on a client principal and obtain a ciphertext
encrypted in the principal's long-term key.  This ciphertext could be
used to conduct an off-line dictionary attack against the user's
password.

    CVSSv2 Vector: AV:N/AC:M/Au:N/C:P/I:P/A:N/E:POC/RL:OF/RC:C

(cherry picked from commit e3b5a5e5267818c97750b266df50b6a3d4649604)
(cherry picked from commit df8afc60d970a7176a55ffe7ce21cfd57ba423cd)

ticket: 8194 (new)
version_fixed: 1.12.4
status: resolved

10 years agoFix LDAP ticket policies on big-endian LP64
Greg Hudson [Mon, 13 Apr 2015 17:09:20 +0000 (13:09 -0400)] 
Fix LDAP ticket policies on big-endian LP64

krb5_ldap_get_value() takes a pointer to int, and should not be passed
a pointer to any integral type which might have a different width.
Use an intermediate variable for each call.

The erroneous calls in ldap_misc.c were passing pointers to int32_t,
which is harmless on all common platforms.  The calls in
ldap_tkt_policy.c were passing pointers to long; on big-endian LP64
platforms, the result would be written to the high 32 bits of the long
value.

(cherry picked from commit 7fbc092107298bded216fbce4cff6592275bff03)
(back ported from commit 50913c7372c5c13a1270d6823f914e07ce0563ba)

ticket: 8193 (new)
version_fixed: 1.12.4
status: resolved

10 years agoDisable principal renames for LDAP
Greg Hudson [Thu, 26 Mar 2015 16:47:06 +0000 (12:47 -0400)] 
Disable principal renames for LDAP

The current principal rename procedure does not work with the LDAP KDB
module, instead having the effect of deleting the principal.  The fix
is not easy and requires amending the DAL (see issue #8065).  For now,
detect LDAP and error out when a rename operation is attempted.

(cherry picked from commit 8483243664a289fea142d8a9de61eba30d713871)
(cherry picked from commit 338cf20b3df6d30a8fe4c4d8c8e3b718edbf35a4)

ticket: 8186 (new)
version_fixed: 1.12.4
status: resolved

10 years agoLog invalid restrictions strings
Greg Hudson [Fri, 13 Mar 2015 17:30:49 +0000 (13:30 -0400)] 
Log invalid restrictions strings

In kadm5int_acl_parse_restrictions(), output a log message if we break
out of the parsing loop with an error.  The current structure of the
loop makes it difficult to pinpoint the bad restrictions field, so
just output the whole string.

(cherry picked from commit e9eaafeab12b2b62595f4dff2fca3345b2d95b4a)
(cherry picked from commit 1ff2ecc7890ae4b843c77c2ba68f5a152806bf05)

ticket: 8185 (new)
version_fixed: 1.12.4
status: resolved

10 years agoDocument correct flag names for kadm5.acl
Greg Hudson [Fri, 13 Mar 2015 16:45:27 +0000 (12:45 -0400)] 
Document correct flag names for kadm5.acl

kadm5.acl entries can include restrictions which can force flag values
on or off.  These flag values are parsed with krb5_string_to_flags(),
which means the flag names are the ones for default_principal_flags,
not the ones for kadmin addprinc/modprinc.

(cherry picked from commit ef21069070c1eb2ab1ade1d1406f5cd3920c83a9)
(cherry picked from commit 185114aa35508e46c90354d8ddea76f65fe556d8)

ticket: 8184 (new)
version_fixed: 1.12.4
status: resolved

10 years agoFix scope of kadmind ACL wildcard back-references
Greg Hudson [Thu, 12 Mar 2015 20:36:33 +0000 (16:36 -0400)] 
Fix scope of kadmind ACL wildcard back-references

In kadm5int_acl_find_entry(), clear the wildcard back-references list
for each acl entry.  Otherwise the wildcards we process can affect
back-references for later entries.

(cherry picked from commit d3d18b8d8d7a47766fd4e9667d045035f43d90ef)
(cherry picked from commit 8e67dce9379c0f50bdccc12619fecad423aa5384)

ticket: 8183
version_fixed: 1.12.4
status: resolved

10 years agoAdd another kadmin ACL test for backreferences
Greg Hudson [Thu, 21 Nov 2013 21:18:27 +0000 (16:18 -0500)] 
Add another kadmin ACL test for backreferences

Add a test using backreferences which don't correspond directly to
principal components, to verify that *N refers to the Nth wildcard and
not the Nth component.

(cherry picked from commit 119281156097a9da659ce5a7c06f0d517994781c)

ticket: 8183 (new)
version_fixed: 1.12.4

10 years agoImport names immediately with COMPOSITE_EXPORT
Solly Ross [Thu, 5 Mar 2015 18:22:58 +0000 (13:22 -0500)] 
Import names immediately with COMPOSITE_EXPORT

RFC 6680 specifies that GSS_Export_name_composite() "outputs a token that
"can be imported with GSS_Import_name(), using GSS_C_NT_COMPOSITE_EXPORT
as the name type...".  Therefore, in the gss_import_name mechglue, we
should perform the import process imediately when either
GSS_C_NT_COMPOSITE_EXPORT or GSS_C_NT_EXPORT_NAME are used (not just
for the later, as is the current functionality).

The naming extension test was also updated to display the result
of importing with GSS_C_NT_COMPOSITE_EXPORT in addition to
GSS_C_NT_EXPORT_NAME.

[ghudson@mit.edu: minor style changes]

(cherry picked from commit 29dec110c43ae9cebdcd935906a3131ca9ac0c99)
(cherry picked from commit f2302383dd3a32bf22f437c4e1d10533323db5dc)

ticket: 8182 (new)
version_fixed: 1.12.4
status: resolved

10 years agoAdd formats section to documentation
Greg Hudson [Fri, 20 Feb 2015 17:56:17 +0000 (12:56 -0500)] 
Add formats section to documentation

Add a new "formats" section to the RST documentation and populate it
with documentation of the credential cache and keytab file formats.

(cherry picked from commit 68ac7ac1f1a1d2939a2c99fa49cecd734614d16d)
(cherry picked from commit 37c02e7fc50a9633b639cbf3daeaeaf1c9c75724)

ticket: 8181 (new)
version_fixed: 1.12.4
status: resolved

10 years agoFix krb5_read_message handling [CVE-2014-5355]
Greg Hudson [Tue, 9 Dec 2014 17:37:44 +0000 (12:37 -0500)] 
Fix krb5_read_message handling [CVE-2014-5355]

In recvauth_common, do not use strcmp against the data fields of
krb5_data objects populated by krb5_read_message(), as there is no
guarantee that they are C strings.  Instead, create an expected
krb5_data value and use data_eq().

In the sample user-to-user server application, check that the received
client principal name is null-terminated before using it with printf
and krb5_parse_name.

CVE-2014-5355:

In MIT krb5, when a server process uses the krb5_recvauth function, an
unauthenticated remote attacker can cause a NULL dereference by
sending a zero-byte version string, or a read beyond the end of
allocated storage by sending a non-null-terminated version string.
The example user-to-user server application (uuserver) is similarly
vulnerable to a zero-length or non-null-terminated principal name
string.

The krb5_recvauth function reads two version strings from the client
using krb5_read_message(), which produces a krb5_data structure
containing a length and a pointer to an octet sequence.  krb5_recvauth
assumes that the data pointer is a valid C string and passes it to
strcmp() to verify the versions.  If the client sends an empty octet
sequence, the data pointer will be NULL and strcmp() will dereference
a NULL pointer, causing the process to crash.  If the client sends a
non-null-terminated octet sequence, strcmp() will read beyond the end
of the allocated storage, possibly causing the process to crash.

uuserver similarly uses krb5_read_message() to read a client principal
name, and then passes it to printf() and krb5_parse_name() without
verifying that it is a valid C string.

The krb5_recvauth function is used by kpropd and the Kerberized
versions of the BSD rlogin and rsh daemons.  These daemons are usually
run out of inetd or in a mode which forks before processing incoming
connections, so a process crash will generally not result in a
complete denial of service.

Thanks to Tim Uglow for discovering this issue.

CVSSv2: AV:N/AC:L/Au:N/C:N/I:N/A:P/E:POC/RL:OF/RC:C

[tlyu@mit.edu: CVSS score]

(cherry picked from commit 102bb6ebf20f9174130c85c3b052ae104e5073ec)
(cherry picked from commit 21e4e653d8258d525f4b6ca87797d42a8bccc282)

ticket: 8180 (new)
version_fixed: 1.12.4
status: resolved

10 years agoUpdate for krb5-1.12.3-postrelease
Tom Yu [Wed, 18 Feb 2015 23:11:18 +0000 (18:11 -0500)] 
Update for krb5-1.12.3-postrelease

10 years agoUpdates for krb5-1.12.3 krb5-1.12.3-final
Tom Yu [Wed, 18 Feb 2015 21:23:49 +0000 (16:23 -0500)] 
Updates for krb5-1.12.3

10 years agomake update-po
Tom Yu [Tue, 17 Feb 2015 21:20:49 +0000 (16:20 -0500)] 
make update-po

10 years agoUpdate manpages
Tom Yu [Tue, 17 Feb 2015 21:20:25 +0000 (16:20 -0500)] 
Update manpages

10 years agomake depend
Tom Yu [Tue, 17 Feb 2015 21:19:50 +0000 (16:19 -0500)] 
make depend

10 years agoSupport keyless principals in LDAP [CVE-2014-5354]
Ben Kaduk [Wed, 19 Nov 2014 17:04:46 +0000 (12:04 -0500)] 
Support keyless principals in LDAP [CVE-2014-5354]

Operations like "kadmin -q 'addprinc -nokey foo'" or
"kadmin -q 'purgekeys -all foo'" result in principal entries with
no keys present, so krb5_encode_krbsecretkey() would just return
NULL, which then got unconditionally dereferenced in
krb5_add_ber_mem_ldap_mod().

Apply some fixes to krb5_encode_krbsecretkey() to handle zero-key
principals better, correct the test for an allocation failure, and
slightly restructure the cleanup handler to be shorter and more
appropriate for the usage.  Once it no longer short-circuits when
n_key_data is zero, it will produce an array of length two with both
entries NULL, which is treated as an empty list by the LDAP library,
the correct behavior for a keyless principal.

However, attributes with empty values are only handled by the LDAP
library for Modify operations, not Add operations (which only get
a sequence of Attribute, with no operation field).  Therefore, only
add an empty krbprincipalkey to the modlist when we will be performing a
Modify, and not when we will be performing an Add, which is conditional
on the (misspelled) create_standalone_prinicipal boolean.

CVE-2014-5354:

In MIT krb5, when kadmind is configured to use LDAP for the KDC
database, an authenticated remote attacker can cause a NULL
dereference by inserting into the database a principal entry which
contains no long-term keys.

In order for the LDAP KDC backend to translate a principal entry
from the database abstraction layer into the form expected by the
LDAP schema, the principal's keys are encoded into a
NULL-terminated array of length-value entries to be stored in the
LDAP database.  However, the subroutine which produced this array
did not correctly handle the case where no keys were present,
returning NULL instead of an empty array, and the array was
unconditionally dereferenced while adding to the list of LDAP
operations to perform.

Versions of MIT krb5 prior to 1.12 did not expose a way for
principal entries to have no long-term key material, and
therefore are not vulnerable.

    CVSSv2 Vector: AV:N/AC:M/Au:S/C:N/I:N/A:P/E:H/RL:OF/RC:C

(cherry picked from commit 04038bf3633c4b909b5ded3072dc88c8c419bf16)

ticket: 8138 (new)
version_fixed: 1.12.3
subject: kadmind with ldap backend crashes when putting keyless entries [CVE-2014-5354]
status: resolved

10 years agoAdd tests for LDAP ticket/policy name misuse
Greg Hudson [Fri, 5 Dec 2014 19:02:04 +0000 (14:02 -0500)] 
Add tests for LDAP ticket/policy name misuse

(cherry picked from commit e8df0458673071e56346730fa843c83aca88631f)

ticket: 8137
version_fixed: 1.12.3
status: resolved

10 years agoFix LDAP misused policy name crash [CVE-2014-5353]
Greg Hudson [Fri, 5 Dec 2014 19:01:39 +0000 (14:01 -0500)] 
Fix LDAP misused policy name crash [CVE-2014-5353]

In krb5_ldap_get_password_policy_from_dn, if LDAP_SEARCH returns
successfully with no results, return KRB5_KDB_NOENTRY instead of
returning success with a zeroed-out policy object.  This fixes a null
dereference when an admin attempts to use an LDAP ticket policy name
as a password policy name.

CVE-2014-5353:

In MIT krb5, when kadmind is configured to use LDAP for the KDC
database, an authenticated remote attacker can cause a NULL dereference
by attempting to use a named ticket policy object as a password policy
for a principal.  The attacker needs to be authenticated as a user who
has the elevated privilege for setting password policy by adding or
modifying principals.

Queries to LDAP scoped to the krbPwdPolicy object class will correctly
not return entries of other classes, such as ticket policy objects, but
may return success with no returned elements if an object with the
requested DN exists in a different object class.  In this case, the
routine to retrieve a password policy returned success with a password
policy object that consisted entirely of zeroed memory.  In particular,
accesses to the policy name will dereference a NULL pointer.  KDC
operation does not access the policy name field, but most kadmin
operations involving the principal with incorrect password policy
will trigger the crash.

Thanks to Patrik Kis for reporting this problem.

CVSSv2 Vector: AV:N/AC:M/Au:S/C:N/I:N/A:C/E:H/RL:OF/RC:C

[kaduk@mit.edu: CVE description and CVSS score]

(cherry picked from commit d1f707024f1d0af6e54a18885322d70fa15ec4d3)

ticket: 8137 (new)
version_fixed: 1.12.3
status: resolved

10 years agoUpdate example enctypes in kdc_conf.rst
Tom Yu [Wed, 5 Nov 2014 20:57:51 +0000 (15:57 -0500)] 
Update example enctypes in kdc_conf.rst

Use modern enctypes for values of master_key_type and
supported_enctypes in the example kdc.conf in kdc_conf.rst.

(cherry picked from commit 3eeb1a7eaa6757502d73944b7694405cdd571e1c)

ticket: 8136 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix input race condition in t_skew.py
Greg Hudson [Wed, 5 Nov 2014 19:12:35 +0000 (14:12 -0500)] 
Fix input race condition in t_skew.py

In two of the kinit tests run by t_skew.py, we expect kinit to exit
before reading the password.  If we supply a password input for those
commands, we can fail with a broken pipe exception if the master
process tries to write the password after the slave process exits.

Also correctly check the output of the last kinit invocation.

(cherry picked from commit 2457bf66c466321dd36cd3c76bc36bb589d31587)

ticket: 8135 (new)
version_fixed: 1.12.3
status: resolved

10 years agoRemove length limit on PKINIT PKCS#12 prompt
Greg Hudson [Wed, 29 Oct 2014 16:16:40 +0000 (12:16 -0400)] 
Remove length limit on PKINIT PKCS#12 prompt

Long pathnames can trigger the 128-byte prompt length limit in
pkinit_get_certs_pkcs12.  Use asprintf instead of snprintf.  Also
check the result of the prompter invocation.

(cherry picked from commit 3c330ea5846ca02da36a0cb5a5c879364d28a267)

ticket: 8134 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix cursor leak in krb5_verify_init_creds
Greg Hudson [Mon, 20 Oct 2014 17:19:26 +0000 (13:19 -0400)] 
Fix cursor leak in krb5_verify_init_creds

In copy_creds_except, call krb5_cc_end_seq_get so we don't leak the
ccache cursor.

(cherry picked from commit 62894f854daa8251554376b6b6810fd0e9fecb7f)

ticket: 8133 (new)
version_fixed: 1.12.3
status: resolved

10 years agoReport output ccache errors getting initial creds
Greg Hudson [Mon, 20 Oct 2014 16:52:45 +0000 (12:52 -0400)] 
Report output ccache errors getting initial creds

In init_creds_step_reply, if we get an error storing output
credentials, do set ctx->complete (since retrieving creds or times
will work at this point) but don't suppress the error code.

(cherry picked from commit feeddfb78ca5de066a509b6be8551d036e0f2c8a)

ticket: 8132 (new)
version_fixed: 1.12.3
status: resolved

10 years agoParse "ktadd -norandkey" in remote kadmin client
Tom Yu [Thu, 16 Oct 2014 19:40:33 +0000 (15:40 -0400)] 
Parse "ktadd -norandkey" in remote kadmin client

The remote kadmin client would not parse the "-norandkey" option to
the ktadd subcommand, terminating option parsing and possibly causing
options to be interpreted as principal names.

(cherry picked from commit 13e9694b17945d43d0cfc203b2645204f2d87086)

ticket: 8131 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix typo in doc for krb5_get_init_creds_keytab()
Tom Yu [Tue, 14 Oct 2014 18:40:34 +0000 (14:40 -0400)] 
Fix typo in doc for krb5_get_init_creds_keytab()

(cherry picked from commit 49f8ec5975df3cb5f204444df2a284b2e662df85)

ticket: 8130 (new)
version_fixed: 1.12.3
status: resolved

10 years agoUse gssalloc_malloc for GSS error tokens
Greg Hudson [Wed, 8 Oct 2014 00:22:52 +0000 (20:22 -0400)] 
Use gssalloc_malloc for GSS error tokens

In kg_accept_krb5, use gssalloc_malloc when allocating space for the
error token, since it will be freed with gssalloc_free.  Using malloc
can cause heap corruption on Windows.  This bug was masked by #1445
before 1.12.

(cherry picked from commit 68cfc8b4e6338b78dce5a960ce47974a73906fac)

ticket: 8129 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix OTP tests with pyrad 2.x
Greg Hudson [Mon, 22 Dec 2014 23:37:36 +0000 (18:37 -0500)] 
Fix OTP tests with pyrad 2.x

Declare User-Password as having type "octets" instead of "string" or
pyrad 2.x will throw a decoding error when retrieving it.

(cherry picked from commit 57dc24093015d292189ef23313ef8ff2a81431e4)

ticket: 8128 (new)
version_fixed: 1.12.3
status: resolved

10 years agoCheck for null *iter_p in profile_iterator()
Greg Hudson [Wed, 14 Jan 2015 18:10:39 +0000 (13:10 -0500)] 
Check for null *iter_p in profile_iterator()

In profile_iterator(), return PROF_MAGIC_ITERATOR if *iter_p is NULL,
instead of dereferencing a null pointer, as we did prior to 1.10.
Correct calling code will not trigger this case, but incorrect code
has been reported in the field.

(cherry picked from commit 9a343200d305e7c8df6e556d63afaee42194175f)

ticket: 8127 (new)
version_fixed: 1.12.3
status: resolved

10 years agoExport function gss_add_cred_with_password
Robbie Harwood (frozencemetery) [Tue, 20 Jan 2015 20:43:40 +0000 (15:43 -0500)] 
Export function gss_add_cred_with_password

This function is already present in gssapi_ext.h, but without
exporting it, a link error will be produced every time it is used.

(cherry picked from commit 266cce14ee39f6d11b186ee988cffd0c2a119f3d)

ticket: 8126 (new)
version_fixed: 1.12.3
status: resolved

10 years agoAdd test for kinit -C WRONG_REALM response
Greg Hudson [Fri, 23 Jan 2015 17:52:31 +0000 (12:52 -0500)] 
Add test for kinit -C WRONG_REALM response

(cherry picked from commit c0778ab2252ece4c3510788d9b72f7f5e3bb05dd)

ticket: 8125
version_fixed: 1.12.3
status: resolved

10 years agoDo not loop on principal unknown errors
Simo Sorce [Tue, 20 Jan 2015 18:48:34 +0000 (13:48 -0500)] 
Do not loop on principal unknown errors

If the canonicalize flag is set, the MIT KDC always return the client
principal when KRB5_KDC_ERR_C_PRICIPAL_UNKNOWN is returned.

Check that this is really a referral by testing that the returned
client realm differs from the requested one.

[ghudson@mit.edu: simplified and narrowed is_referral() contract.
Note that a WRONG_REALM response with e-data or FAST error padata
could now be passed through k5_preauth_tryagain() if it has an empty
crealm or a crealm equal to the requested client realm.  Such a
response is unexpected in practice and there is nothing dangerous
about handling it this way.]

(cherry picked from commit d5755694b620570defeecee772def90a2733c6cc)

ticket: 8125 (new)
version_fixed: 1.12.3
status: resolved

10 years agoAdd missing salt from enctype in t_kdb.py test
Patrik Kis [Fri, 24 Oct 2014 14:15:05 +0000 (16:15 +0200)] 
Add missing salt from enctype in t_kdb.py test

In commit 78a7f2a02b82bf297817cd717f092ead40b575b2, which added a test
for bug #7980, some command invocations used new syntax that omitted
salt types from the keysalt list.  This omission of salt types is not
supported on krb5-1.12, resulting in test failures.  Update to use the
valid (old) key salt syntax.

[tlyu@mit.edu: commit message]

ticket: 8071 (new)
version_fixed: 1.12.3
status: resolved

10 years agoAdd test program for gss_process_context_token
Tom Yu [Wed, 4 Feb 2015 21:14:04 +0000 (16:14 -0500)] 
Add test program for gss_process_context_token

Add a new test program t_pcontok to exercise
gss_process_context_token, and run it from t_gssapi.py.

(back ported from commit bfb472ff67c00da2f2b0d0ada1af57a2c4493a11)

ticket: 8067
version_fixed: 1.12.3
status: resolved

10 years agoFix gssrpc data leakage [CVE-2014-9423]
Greg Hudson [Mon, 29 Dec 2014 18:17:56 +0000 (13:17 -0500)] 
Fix gssrpc data leakage [CVE-2014-9423]

[MITKRB5-SA-2015-001] In svcauth_gss_accept_sec_context(), do not copy
bytes from the union context into the handle field we send to the
client.  We do not use this handle field, so just supply a fixed
string of "xxxx".

In gss_union_ctx_id_struct, remove the unused "interposer" field which
was causing part of the union context to remain uninitialized.

(cherry picked from commit 5bb8a6b9c9eb8dd22bc9526751610aaa255ead9c)

ticket: 8070 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix kadmind server validation [CVE-2014-9422]
Greg Hudson [Mon, 29 Dec 2014 18:27:42 +0000 (13:27 -0500)] 
Fix kadmind server validation [CVE-2014-9422]

[MITKRB5-SA-2015-001] In kadmind's check_rpcsec_auth(), use
data_eq_string() instead of strncmp() to check components of the
server principal, so that we don't erroneously match left substrings
of "kadmin", "history", or the realm.

(cherry picked from commit 6609658db0799053fbef0d7d0aa2f1fd68ef32d8)

ticket: 8069 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix kadm5/gssrpc XDR double free [CVE-2014-9421]
Greg Hudson [Sat, 27 Dec 2014 19:16:13 +0000 (14:16 -0500)] 
Fix kadm5/gssrpc XDR double free [CVE-2014-9421]

[MITKRB5-SA-2015-001] In auth_gssapi_unwrap_data(), do not free
partial deserialization results upon failure to deserialize.  This
responsibility belongs to the callers, svctcp_getargs() and
svcudp_getargs(); doing it in the unwrap function results in freeing
the results twice.

In xdr_krb5_tl_data() and xdr_krb5_principal(), null out the pointers
we are freeing, as other XDR functions such as xdr_bytes() and
xdr_string().

(cherry picked from commit a197e92349a4aa2141b5dff12e9dd44c2a2166e3)

ticket: 8068 (new)
version_fixed: 1.12.3
status: resolved

10 years agoFix gss_process_context_token() [CVE-2014-5352]
Tom Yu [Wed, 4 Feb 2015 21:09:16 +0000 (16:09 -0500)] 
Fix gss_process_context_token() [CVE-2014-5352]

[MITKRB5-SA-2015-001] The krb5 gss_process_context_token() should not
actually delete the context; that leaves the caller with a dangling
pointer and no way to know that it is invalid.  Instead, mark the
context as terminated, and check for terminated contexts in the GSS
functions which expect established contexts.  Also add checks in
export_sec_context and pseudo_random, and adjust t_prf.c for the
pseudo_random check.

(back ported from commit 82dc33da50338ac84c7b4102dc6513d897d0506a)

ticket: 8067 (new)
version_fixed: 1.12.3
status: resolved

10 years agoUpdate copyright years
Tom Yu [Wed, 4 Feb 2015 21:07:31 +0000 (16:07 -0500)] 
Update copyright years

10 years agoRemove rtm_type_name()
Ben Kaduk [Fri, 1 Nov 2013 19:12:33 +0000 (15:12 -0400)] 
Remove rtm_type_name()

It has been unused since 2009 when Ken decided that the routing log
messages were too verbose (commit 91fc077c96926dd60).

(back ported from bcc91c8d8b3d5b775cfde1ee461d7e0394070852)

ticket: 8036 (new)
version_fixed: 1.12.3

10 years agoLet libgssapi see TGTs in the MSLSA cache
Ben Kaduk [Thu, 21 Aug 2014 22:56:24 +0000 (18:56 -0400)] 
Let libgssapi see TGTs in the MSLSA cache

When the current user is a local administrator of a windows machine
where User Account Control (UAC) is enabled, the Windows LSA will
return a block of zeros as the session key for any TGT entry in the
MSLSA: cache.  The lcc_retrieve() implementation checks for such
"null" session keys and prevents them from escaping to callers (as
attempts to use them would encounger strange errors).  However,
when the TGT is the only entry in the cache, this filtering prevents
scan_ccache() from detecting that the cache contains non-expired
credentials (and that there is a TGT present).

Since scan_ccache() is only looking at metadata in the cache entries,
and does not need to actually use any tickets or session keys, set
the KRB5_TC_NOTICKET flag on the ccache before scanning it.  This
will allow the MSLSA implementation to return a cred for the TGT
entry and cause the GSSAPI credential selection algorithm to function
properly.

(cherry picked from commit 0794746f8d8e6b8ce3748d442d2bc1faecf960ce)

ticket: 8013 (new)
version_fixed: 1.12.3
subject: gssapi.dll fails to detect TGTs in the MSLSA cache when UAC is enabled
status: resolved

10 years agoAdd some KDC entries to the registry via WiX
Ben Kaduk [Thu, 21 Aug 2014 21:33:11 +0000 (17:33 -0400)] 
Add some KDC entries to the registry via WiX

Though our library happily uses DNS, I can't get Windows to
successfully contact KDCs found through the SRV records.
So, we do need to stay in the business of shipping around
KDC entries, after all.

(cherry picked from commit d2b76e1ba0f4bb0ec7e560a9a681d938f45f950c)

ticket: 7999

10 years agoTry to scan_ccache() after leash picks a cache
Ben Kaduk [Thu, 21 Aug 2014 16:48:39 +0000 (12:48 -0400)] 
Try to scan_ccache() after leash picks a cache

We need to call scan_ccache() in order to notice that there
are credentials and read their expire time.

The call to scan_ccache() in the Leash case was inadvertently
removed as part of commit 8651f3339ccc5a623172a8edfb9cf522883acacd.

(cherry picked from commit 674f7d7abe2d4f8bc3fe791e4347a332e3ccfd41)

ticket: 8012 (new)
version_fixed: 1.12.3
subject: gssapi.dll tries to get initial creds even when some are present
status: resolved

10 years agokrb5-1.12.2-postrelease
Tom Yu [Mon, 11 Aug 2014 22:24:45 +0000 (18:24 -0400)] 
krb5-1.12.2-postrelease

10 years agoUpdates for krb5-1.12.2 krb5-1.12.2-final
Tom Yu [Mon, 11 Aug 2014 20:58:08 +0000 (16:58 -0400)] 
Updates for krb5-1.12.2

10 years agoMake tcl_kadm5.c work with Tcl 8.6
Greg Hudson [Wed, 28 May 2014 22:06:59 +0000 (18:06 -0400)] 
Make tcl_kadm5.c work with Tcl 8.6

Directly accessing the result field of Tcl_Interp has been deprecated
for a long time, requires a special define in Tcl 8.6, and will be
impossible in Tcl 9.  Use Tcl_SetResult instead.  The new error
messages are less helpful than the old ones, but this is just support
infrastructure for old tests, so it isn't important.

(cherry picked from commit b63496d7b44f090ea5d300dc09b4fc043138ae38)

ticket: 7924
version_fixed: 1.12.2
status: resolved

11 years agoAdd regression test for LDAP key fencepost bug
Greg Hudson [Sat, 2 Aug 2014 02:10:35 +0000 (22:10 -0400)] 
Add regression test for LDAP key fencepost bug

(cherry picked from commit 0d78da225612e13d0b1cf515987305535d2f9dce)

ticket: 7980
status: resolved

11 years agoFix LDAP key data segmentation [CVE-2014-4345]
Tomas Kuthan [Fri, 1 Aug 2014 13:25:50 +0000 (15:25 +0200)] 
Fix LDAP key data segmentation [CVE-2014-4345]

For principal entries having keys with multiple kvnos (due to use of
-keepold), the LDAP KDB module makes an attempt to store all the keys
having the same kvno into a single krbPrincipalKey attribute value.
There is a fencepost error in the loop, causing currkvno to be set to
the just-processed value instead of the next kvno.  As a result, the
second and all following groups of multiple keys by kvno are each
stored in two krbPrincipalKey attribute values.  Fix the loop to use
the correct kvno value.

CVE-2014-4345:

In MIT krb5, when kadmind is configured to use LDAP for the KDC
database, an authenticated remote attacker can cause it to perform an
out-of-bounds write (buffer overrun) by performing multiple cpw
-keepold operations.  An off-by-one error while copying key
information to the new database entry results in keys sharing a common
kvno being written to different array buckets, in an array whose size
is determined by the number of kvnos present.  After sufficient
iterations, the extra writes extend past the end of the
(NULL-terminated) array.  The NULL terminator is always written after
the end of the loop, so no out-of-bounds data is read, it is only
written.

Historically, it has been possible to convert an out-of-bounds write
into remote code execution in some cases, though the necessary
exploits must be tailored to the individual application and are
usually quite complicated.  Depending on the allocated length of the
array, an out-of-bounds write may also cause a segmentation fault
and/or application crash.

    CVSSv2 Vector: AV:N/AC:M/Au:S/C:C/I:C/A:C/E:POC/RL:OF/RC:C

[ghudson@mit.edu: clarified commit message]
[kaduk@mit.edu: CVE summary, CVSSv2 vector]

(cherry picked from commit 81c332e29f10887c6b9deb065f81ba259f4c7e03)

ticket: 7980
version_fixed: 1.12.2
status: resolved

11 years agoUse zapfree in krb5_decrypt_tkt_part
Andreas Schneider [Wed, 6 Aug 2014 14:06:54 +0000 (16:06 +0200)] 
Use zapfree in krb5_decrypt_tkt_part

(cherry picked from commit 18333f731b8cb3b4610b1d623caef9347c785f7b)

ticket: 7982
version_fixed: 1.12.2
status: resolved

11 years agoFix creation/rename of top-level profile sections
Greg Hudson [Wed, 16 Jul 2014 20:30:26 +0000 (16:30 -0400)] 
Fix creation/rename of top-level profile sections

profile_rename_section should demand only one name.

profile_add_relation should demand only one name if it is creating a
new section.  It aso needs to reset state before calling
profile_find_node for the section, in case it didn't look up any
parent sections previously.

(cherry picked from commit 590df2f41f84e0f9492e08f7dbd26fbcd3118ea0)

ticket: 7972
version_fixed: 1.12.2
status: resolved

11 years agoFix deleted node handling in libprofile
Greg Hudson [Wed, 16 Jul 2014 20:02:21 +0000 (16:02 -0400)] 
Fix deleted node handling in libprofile

In profile_find_node, skip deleted nodes when finding the second
match.  Otherwise, profile_clear_nodes could return an error if a node
has some values to clear but the last one is deleted.

In profile_node_iterator, skip deleted nodes when looking up the
section names.  Otherwise we could iterate over a deleted section
and/or ignore its replacement.

(cherry picked from commit e7f50a1c11845ba73ce4ffa4729d10113563a247)

ticket: 7971
version_fixed: 1.12.2
status: resolved

11 years agoUse system dictionary for db2 tests again
Greg Hudson [Tue, 18 Feb 2014 06:14:01 +0000 (01:14 -0500)] 
Use system dictionary for db2 tests again

The built-in word list is not long enough for all of the libdb2 tests
to run properly.  Revert d21a86e47a7cda29225013e08d060095b94b2ee7 and
go back to using the system dictionary if we find one.  However, omit
any lines from the chosen word list which contain non-alphabetical
characters.

(cherry picked from commit dba768e873d3ae34cfb2ff9d9c2d3644981f23a5)

ticket: 7860
version_fixed: 1.12.2
status: resolved

11 years agoUse TAILQ macros instead of CIRCLEQ in libdb2
Greg Hudson [Mon, 17 Feb 2014 05:18:41 +0000 (00:18 -0500)] 
Use TAILQ macros instead of CIRCLEQ in libdb2

The optimizer in gcc 4.8.1 (but not the current gcc head revision)
breaks the queue.h CIRCLEQ macros, apparently due to an overzealous
strict aliasing deduction.  Use TAILQ macros in the libdb2 mpool code
instead.

(cherry picked from commit 26d874412983c4c9979a9f5e7bec51834ad4cda5)

ticket: 7860
version_fixed: 1.12.2
status: resolved

11 years agoRemove indent workaround in man page RST sources
Greg Hudson [Thu, 12 Jun 2014 18:34:26 +0000 (14:34 -0400)] 
Remove indent workaround in man page RST sources

docutils 0.10 properly adds indentation to example blocks in man
pages, so we do not need to force an extra indentation level.  Get rid
of the workaround wherever we use it.

(back ported from 4bd50f73c80a86852ec0879abdf52202be40892b)

ticket: 7954
version_fixed: 1.12.2
status: resolved

11 years agoFix null deref in SPNEGO acceptor [CVE-2014-4344]
Greg Hudson [Tue, 15 Jul 2014 16:56:01 +0000 (12:56 -0400)] 
Fix null deref in SPNEGO acceptor [CVE-2014-4344]

When processing a continuation token, acc_ctx_cont was dereferencing
the initial byte of the token without checking the length.  This could
result in a null dereference.

CVE-2014-4344:

In MIT krb5 1.5 and newer, an unauthenticated or partially
authenticated remote attacker can cause a NULL dereference and
application crash during a SPNEGO negotiation by sending an empty
token as the second or later context token from initiator to acceptor.
The attacker must provide at least one valid context token in the
security context negotiation before sending the empty token.  This can
be done by an unauthenticated attacker by forcing SPNEGO to
renegotiate the underlying mechanism, or by using IAKERB to wrap an
unauthenticated AS-REQ as the first token.

    CVSSv2 Vector: AV:N/AC:L/Au:N/C:N/I:N/A:C/E:POC/RL:OF/RC:C

[kaduk@mit.edu: CVE summary, CVSSv2 vector]

(cherry picked from commit 524688ce87a15fc75f87efc8c039ba4c7d5c197b)

ticket: 7970
version_fixed: 1.12.2
status: resolved

11 years agoFix double-free in SPNEGO [CVE-2014-4343]
David Woodhouse [Tue, 15 Jul 2014 16:54:15 +0000 (12:54 -0400)] 
Fix double-free in SPNEGO [CVE-2014-4343]

In commit cd7d6b08 ("Verify acceptor's mech in SPNEGO initiator") the
pointer sc->internal_mech became an alias into sc->mech_set->elements,
which should be considered constant for the duration of the SPNEGO
context.  So don't free it.

CVE-2014-4343:

In MIT krb5 releases 1.10 and newer, an unauthenticated remote
attacker with the ability to spoof packets appearing to be from a
GSSAPI acceptor can cause a double-free condition in GSSAPI initiators
(clients) which are using the SPNEGO mechanism, by returning a
different underlying mechanism than was proposed by the initiator.  At
this stage of the negotiation, the acceptor is unauthenticated, and
the acceptor's response could be spoofed by an attacker with the
ability to inject traffic to the initiator.

Historically, some double-free vulnerabilities can be translated into
remote code execution, though the necessary exploits must be tailored
to the individual application and are usually quite
complicated. Double-frees can also be exploited to cause an
application crash, for a denial of service.  However, most GSSAPI
client applications are not vulnerable, as the SPNEGO mechanism is not
used by default (when GSS_C_NO_OID is passed as the mech_type argument
to gss_init_sec_context()).  The most common use of SPNEGO is for
HTTP-Negotiate, used in web browsers and other web clients.  Most such
clients are believed to not offer HTTP-Negotiate by default, instead
requiring a whitelist of sites for which it may be used to be
configured.  If the whitelist is configured to only allow
HTTP-Negotiate over TLS connections ("https://"), a successful
attacker must also spoof the web server's SSL certificate, due to the
way the WWW-Authenticate header is sent in a 401 (Unauthorized)
response message.  Unfortunately, many instructions for enabling
HTTP-Negotiate in common web browsers do not include a TLS
requirement.

    CVSSv2 Vector: AV:N/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C

[kaduk@mit.edu: CVE summary and CVSSv2 vector]

(cherry picked from commit f18ddf5d82de0ab7591a36e465bc24225776940f)

ticket: 7969
version_fixed: 1.12.2
status: resolved

11 years agoFix leak on GSS module symbol resolution error
Simo Sorce [Thu, 10 Jul 2014 14:04:06 +0000 (10:04 -0400)] 
Fix leak on GSS module symbol resolution error

If krb5int_get_plugin_func fails, errinfo may contain an allocated
error message.  Free it on error when loading GSS modules.

[ghudson@mit.edu: also fix GSS_ADD_DYNAMIC_METHOD; clarify commit
message]

(cherry picked from commit 53362ba69fb5a60386dd358c3450bfcf4f6b7346)

ticket: 7966
version_fixed: 1.12.2
status: resolved

11 years agoFix calloc check in krb5_authdata_context_init
Greg Hudson [Fri, 18 Jul 2014 18:51:13 +0000 (14:51 -0400)] 
Fix calloc check in krb5_authdata_context_init

(cherry picked from commit 4abfd7bc3819a66f77a1cf121b7608af624ecb6e)

ticket: 7973
version_fixed: 1.12.2
status: resolved

11 years agoFix race in util/profile/Makefile.in
Greg Hudson [Thu, 17 Oct 2013 18:02:14 +0000 (14:02 -0400)] 
Fix race in util/profile/Makefile.in

$(BUILDTOP)/include/profile.h was being updated by two different
rules, which could collide with make -j.  Use a dependency from
includes instead of a redundant rule.

(cherry picked from commit 4d3827ac1b0e9e6447a132c57f3e2d74d3dfe8a9)

ticket: 7967
version_fixed: 1.12.2
status: resolved

11 years agoFix several memory leaks in LDAP KDB modules
Greg Hudson [Wed, 11 Jun 2014 03:53:31 +0000 (23:53 -0400)] 
Fix several memory leaks in LDAP KDB modules

Fix memory leaks discovered by running valgrind over kdbtest, and some
related leaks.  Many of them result from not calling ldap_msgfree
after an unsuccessful search (as the OpenLDAP documentation requires)
or after an exception following a search, so many of the fixes move or
add ldap_msgfree calls to cleanup labels.

ldap_osa_free_princ_ent was not used, and could not be used because it
frees the container while krb5_lookup_tl_kadm_data uses a
caller-allocated container.  Change it to leave the container alone,
but to correctly destroy xdrs.  Use it in krb5_ldap_put_principal
where princ_ent was leaked.

In krb5_ldap_put_principal, subtreelist is declared twice in interior
scopes and not properly freed; move it to function scope and free it
up in the cleanup label.  Also in krb5_ldap_put_principal, avoiding
decoding multiple KBR5_TL_KADM_DATA values (which we don't expect to
see) as later decodes would cause earlier decodes to leak.

In krb5_encode_krbsecretkey, fix a leak of the krb5_data container and
also add an error check when calling asn1_encode_sequence_of_keys;
otherwise we would dereference a null pointer if we run out of memory
encoding keys (very unlikely).

(cherry picked from commit bfd2a69193ddc1b324d48a7da6455cfbda54fc09)

ticket: 7941
version_fixed: 1.12.2
status: resolved

11 years agoFix build on systems without RTM_OLD*
Ben Kaduk [Thu, 3 Jul 2014 14:42:21 +0000 (10:42 -0400)] 
Fix build on systems without RTM_OLD*

For example, FreeBSD has removed RTM_OLDADD and RTM_OLDDEL from its API
in March 2014, with the message:
Garbage collect long time obsoleted (or never used) stuff from routing API

Only attempt to define behavior for these cases if they are defined.

(cherry picked from commit fd352d41a79013114708e99510b6be3836200237)

ticket: 7955
version_fixed: 1.12.2
status: resolved

11 years agoFix unlikely null dereference in TGS client code
Neng Xue [Mon, 30 Jun 2014 21:04:56 +0000 (14:04 -0700)] 
Fix unlikely null dereference in TGS client code

If krb5_get_tgs_ktypes fails (due to an out-of-memory condition or an
error re-reading the profile), k5_make_tgs_req will dereference a null
pointer.  Check the return value before dereferencing defenctypes.

[ghudson@mit.edu: clarified commit message]

(cherry picked from commit 81e503c09ad9aef4a0afc6bf66a0269cde2151f3)

ticket: 7952
version_fixed: 1.12.2
status: resolved

11 years agoFix KDC worker process argument parsing
Greg Hudson [Wed, 18 Jun 2014 16:58:39 +0000 (12:58 -0400)] 
Fix KDC worker process argument parsing

To create worker processes, the KDC shuts down realms, forks off the
worker processes, then reinitializes realms in each child.
Reinitializing realms requires making a second pass over the
command-line arguments.  To do this with getopt, optind must be
reinitialized to 1 for each pass; otherwise, no options will be seen
the second time around.

(cherry picked from commit 1776fd19120d230115527febbd22979eb64ee1ff)

ticket: 7945
version_fixed: 1.12.2
status: resolved

11 years agoHandle invalid RFC 1964 tokens [CVE-2014-4341...]
Greg Hudson [Thu, 19 Jun 2014 17:49:16 +0000 (13:49 -0400)] 
Handle invalid RFC 1964 tokens [CVE-2014-4341...]

Detect the following cases which would otherwise cause invalid memory
accesses and/or integer underflow:

* An RFC 1964 token being processed by an RFC 4121-only context
  [CVE-2014-4342]

* A header with fewer than 22 bytes after the token ID or an
  incomplete checksum [CVE-2014-4341 CVE-2014-4342]

* A ciphertext shorter than the confounder [CVE-2014-4341]

* A declared padding length longer than the plaintext [CVE-2014-4341]

If we detect a bad pad byte, continue on to compute the checksum to
avoid creating a padding oracle, but treat the checksum as invalid
even if it compares equal.

CVE-2014-4341:

In MIT krb5, an unauthenticated remote attacker with the ability to
inject packets into a legitimately established GSSAPI application
session can cause a program crash due to invalid memory references
when attempting to read beyond the end of a buffer.

    CVSSv2 Vector: AV:N/AC:M/Au:N/C:N/I:N/A:P/E:POC/RL:OF/RC:C

CVE-2014-4342:

In MIT krb5 releases krb5-1.7 and later, an unauthenticated remote
attacker with the ability to inject packets into a legitimately
established GSSAPI application session can cause a program crash due
to invalid memory references when reading beyond the end of a buffer
or by causing a null pointer dereference.

    CVSSv2 Vector: AV:N/AC:M/Au:N/C:N/I:N/A:P/E:POC/RL:OF/RC:C

[tlyu@mit.edu: CVE summaries, CVSS]

(cherry picked from commit fb99962cbd063ac04c9a9d2cc7c75eab73f3533d)

ticket: 7949
version_fixed: 1.12.2
status: resolved

11 years agoFix unlikely null dereference in mk_cred()
Nalin Dahyabhai [Wed, 25 Jun 2014 16:56:42 +0000 (12:56 -0400)] 
Fix unlikely null dereference in mk_cred()

If krb5_encrypt_keyhelper() returns an error, the ciphertext structure
may contain a non-zero length, but it will already have freed the
pointer to its data, making encrypt_credencpart()'s subsequent attempt
to clear and free the memory fail.  Remove that logic.

Based on a patch from Jatin Nansi.

(cherry picked from commit 476284de8dc9a52b5544445cb1b316a417ae88f0)

ticket: 7948
version_fixed: 1.12.2
status: resolved