OS Attack: MS ASN1 Integer TCP Overflow CVE-2003-0818
This attack could pose a serious security threat. You should take immediate action to stop any damage or prevent further damage from happening.
This signature detects an attempts to exploit an integer overflow in Microsoft's Abstract Syntx Notation1.
Microsoft Windows Abstract Syntax Notation 1 (ASN.1) handling Library (MSASN1.dll) is shipped as a part of the Microsoft Windows Operating System. The MSASN1 library provides an application programmer's interface for Microsoft ASN.1 encoding/decoding and processing functions.
Microsoft ASN.1 handling library has been reported prone to an integer overflow vulnerability that may result in arbitrary heap-based memory corruption. The issue presents itself in the ASN.1 BER decoding/encoding routines, specifically in the ASN1BERDecBitString() function. ASN1BERDecBitString() handles constructed bit strings by concatenating each of the simple bit strings that comprise the compound one. The integer overflow occurs when a bit string is processed and the number of bits in the bit string is added to the cumulative total as follows: lea eax, [ecx+eax+7]
This may provide a conduit for an attacker to trigger a boundary condition error. When the first bit string processed by ASN1BERDecBitString possesses a specified signed length of 0xfffffff9(-7), then the aforementioned arithmetic (ecx+eax+7) sums the accumulated bits (0) with the signed length of the bit string (-7). The rounding value (+7) is then added to the total. This will result in a total assigned length of zero.
It has been reported that this value is then further processed by the DecMemReAlloc() function call, and ultimately results in a zero-byte chunk being allocated on the heap. The original bit string lengths are passed to the function ASN1bitcpy(). This function later performs a memcpy() operation to copy supplied bit string data into the zero-byte allocated heap based buffer. This operation will result in the corruption of heap based management structures, and may ultimately be leveraged by an attacker to have arbitrary code executed in the context of the affected process.
This vulnerability is exposed in a number of security related operating system components, including Kerberos (via UDP port 88), Microsoft IIS with SSL support enabled and NTLMv2 authentication (via TCP ports 135, 139 and 445). Other components may also be affected, though a comprehensive list is not available at this time. Client applications which use the library will be affected, including LSASS.EXE and CRYPT32.DLL (and any application that relies on CRYPT32.DLL). The vulnerable library is used frequently in components that handle certificates such as Internet Explorer and Outlook. Handling of signed ActiveX components could also present an exposure.
It should be noted that because ASN.1 data will likely be encoded, for example Kerberos, SSL, IPSec or Base64 encoded, the malicious integer values may be obfuscated and as a result not easily detectable.
This vulnerability was originally covered in BID 9626, but further information has been made available which identifies a number of distinct vulnerabilities in the library and so this specific issue has been assigned an individual BID.
It has been alleged that an official patch to address this issue in Microsoft Windows 98 systems is available to customers who possess a current support contract with Microsoft. Customers are advised to contact their relative Microsoft TAM, in order to obtain a relevant patch.
Microsoft has released a security update (MS04-007) to address this issue in affected versions of Microsoft Windows. Users are strongly advised to obtain fixes as soon as possible.