A Quick Look at MS14-068

BeyondTrust
November 21st, 2014

Microsoft recently released an out of band patch for Kerberos.  Taking a look at the Microsoft security bulletin, it seems like there is some kind of issue with Kerberos signatures related to tickets.
Kerebos-checksum-1

Further information is available in the Microsoft SRD Blog post:
microsoft-srd-blogpost

So it looks like there is an issue with PAC signatures.  But what specifically?  If we take a look at the kdsvc.dll patch for Server 2008, there are 3 changed functions:

3

As expected, two of the three involve PAC (Privilege Attribute Certificate).  VerifyPacSignature looks promising.  Let’s see what changed there.

Cadddpture

More or less, a comparison like above ( cmp <something>, 0xFFFFFF76 ) was added in two places.  The result of this comparison will either lead to further processing or to returning a Kerberos specific error as seen below.

5

The value 0xFFFFFF76 can be traced upward in the patched function to a nearby call to _CDLocateChecksum.

6

This function is imported from cryptdll.dll, so opening that in IDA we can follow the second argument to CDLocateChecksum and see that the source of this value seems to come from the _CheckSumFns array.

7

Tracing XREFS to this array, CDRegisterCheckSum appears to be the only other place it is used and is most likely where it gets set.

8

Taking a look at CDRegisterCheckSum, it seems to take an argument and register it into the _CheckSumFns array.

666

XREFS to this function are illustrative of actual population of the array –

xrefs-to-CDRegister

Moving back to LoadCheckSums(), we find the source of this constant nicely formatted with Windows symbols.

load-checksums

Each of these arguments to CDRegisterChecksum is a structure defined like so

DWORD identifier

DWORD checkSumSize

DWORD dunno

<several function pointers>

11

If we take this data and look at the Microsoft specification for PAC [MS-PAC], we can see that it is somewhat inconsistent.  Under section 2.8, we can find details about the PAC signature data:

signature-type

It is apparent from above, that although the spec says you are only allowed to use those three, we have quite a few more available to us as a client including CRC32.  Therefore, getting back to the patch, it appears now that VerifyPacSignature is ensuring that the SignatureType is 0xFFFFFF76 (HMAC_MD5) before continuing processing.

BeyondTrust

BeyondTrust