|
MS06-008
Greetings people, Here are some details about the flaw in WebClient service I reported to Microsoft some months ago and that got patched with MS06-008. In the function DavOpenCreateConnection in webclnt.dll, one can notice the following piece of code : The allocated buffer is then used to store both UserName and Password thanks to wcscpy(). A noticeable error here lies within the movzx eax, ax instructions that will only keep the lower 16 bits of (wcslen(Password) * 2), which means that if wcsclen(Password) = 32768, eax will be null, the allocated buffer will then be too small for the widestring copy operation, and a heap overflow will occur. Usually, you will get a page fault this way, so you will have to grow heap first to do a "real" overflow. Of course, before MS06-008, no length check was done on Password or UserName in this function, or its callers. The funny thing is that this flaw is also present in some other functions : - NwOpenCreateConnection in Client Service for Netware, previously reported, and corrected in MS05-046 ; - WsOpenCreateConnection in Workstation Service, but unfortunately length checks have been in there for a while ; In the patch, Microsoft chose to add length checks in parent function DavrCreateConnection, rather than in the function itself, which doesn't seem a really good idea because if a new path to the vulnerable code is added some day, the same issue will probably be raised again. This flaw can be exploited thanks to operation number 0 of RPC interface c8cb7687-e6d3-11d2-a958-00c04f682e16, described here, through the named pipe "DAV RPC SERVICE" which requires authentication. Kostya Comments
| ||||||