Posts

MS Excel PtgExtraArray Parsing Memory Corruption (Nov 5th, 2010)

Microsoft Excel is a spreadsheet application released as a component of the Microsoft Office suite. The application can create complex spreadsheets with multiple workbooks, formulas, and various data sources. The file format used for storing Microsoft Excel documents is known as the Binary Interchange File Format (BIFF).

In BIFF5 versions and above, data inside all Office Document files is stored in a series of streams. These streams contain meta-data information about the document, such as the author name, subject, and in case of Excel documents, individual sheet names. Excel specific data is organized as a series of Records. The common structure of an Excel Record is shown below:

Offset  Size    Contents ------- ------- ------------------------------------------ 0x0000  int16   Identifier (Type) 0x0002  int16   Size of the following data (n) 0x0004  char[n] Record Data

The Formula record (type 0x06) describes a cell that contains a formula in the Excel file. The Formula record structure is shown below:

Offset  Size    Contents ------- ------- ------------------------------------------ 0x0000  int16   type (0x6) 0x0002  int16   length of the Formula record data 0x0004  int16   row 0x0006  int16   column 0x0008  int16   index to XF record 0x000A  char[8] current value of the formula 0x0012  int16   option flags 0x0014  int32   chn 0x0018  int16   cce length of the expression (n) 0x001A  char[n] rgce parsed expression

Within the Formula record, the rgce field contains the formula in its parsed format which is the internal tokenized representation of an Excel formula. A parsed expression contains a sequence of tokens, each of which consists of a token type and a token value.
When an rgce contains one or more tokens that rquire extra data, the containing formula structure includes an RgbExtra section containing the data for those records. A structure, PtgExtraArray, is contained within the RgbExtra section. The structure is defined as shown:

Offset  Size    Contents ------- ------- ------------------------------------------ 0x0000  char    cols  0x0001  int16   rows 0x0003  n       SerAr[n]

A memory corruption vulnerability exists in Microsoft Office Excel. The vulnerability is due to improper processing of the PtgExtraArray structure within the Formula record of Excel files. The vulnerable code uses the values provided in the cols and rows fields of the PtgExtraArray structure to calculate the number of the elements in the SerAr[] array. The result of this calculation is not verified. This value is then used as the counter in a loop that copies SerAr structures sequentially into a memory buffer.

If the total size of the SerAr structures is large enough then the memory copy loop may write past the boundary specified for the Formula record, overwriting potentially critical data.

Exploitation of this flaw may result in arbitrary code execution. Remote attackers could exploit this vulnerability by persuading unsuspecting users to open a crafted Excel file. Successful exploitation would allow arbitrary code injection and execution in the security context of the logged in user.

SonicWall has released an IPS signature to address a known exploit targeting this vulnerability. The following signature was released:

  • 5915 – MS Excel PtgExtraArray Parsing Memory Corruption PoC 2 (MS10-080)

This vulnerability has been assigned CVE-2010-3231 by mitre. The vendor has released an advisory regarding this issue.

Microsoft Security Bulletins Coverage (Oct 12, 2010)

SonicWALL has analyzed and addressed Microsoft’s security advisories for the month of October, 2010. A list of issues reported, along with SonicWALL coverage information follows:

MS10-071 Cumulative Security Update for Internet Explorer (2360131)

  • CVE-2010-0808 – AutoComplete Information Disclosure Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3243 – HTML Sanitization Vulnerability
    IPS 5844 MS IE XSS Vulnerability Exploit
  • CVE-2010-3324 – HTML Sanitization Vulnerability
    IPS 4149 MS IE toStaticHTML Method Invocation
  • CVE-2010-3325 – CSS Special Character Information Disclosure Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3326– Uninitialized Memory Corruption Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3327 – Anchor Element Information Disclosure Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3328– Uninitialized Memory Corruption Vulnerability
    Note: Detection would require a logical analysis or traversal of a file. It is not feasible.
  • CVE-2010-3329– Uninitialized Memory Corruption Vulnerability
    IPS 5836MS IE Uninitialized Memory Corruption Vulnerability 2 (MS10-071)
  • CVE-2010-3330– Cross-Domain Information Disclosure Vulnerability
    Note: Detection would require a logical analysis or traversal of a file. It is not feasible.
  • CVE-2010-3331– Uninitialized Memory Corruption Vulnerability
    IPS 5835MS IE Uninitialized Memory Corruption Vulnerability (MS10-071)

MS10-072 Vulnerabilities in SafeHTML Could Allow Information Disclosure (2412048)

  • CVE-2010-3243– HTML Sanitization Vulnerability
    Note: Please refer to MS10-071
  • CVE-2010-3324– HTML Sanitization Vulnerability
    Note: Please refer to MS10-071

MS10-073 Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (981957)

  • CVE-2010-2549– Win32K Reference Count Vulnerability
    Note: Local elevation of privilege
  • CVE-2010-2743– Win32K Keyboard Layout Vulnerability
    Note: Local elevation of privilege
  • CVE-2010-2744– Win32k Window Class Vulnerability
    Note: Local elevation of privilege

MS10-074 Vulnerability in Microsoft Foundation Classes Could Allow Remote Code Execution (2387149)

  • CVE-2010-3227– Windows MFC Document Title Updating Buffer Overflow Vulnerability
    Note: There are no known public exploits targeting this vulnerability.

MS10-075 Vulnerability in Media Player Network Sharing Service Could Allow Remote Code Execution (2281679)

  • CVE-2010-3225– RTSP Use After Free Vulnerability
    IPS 5845 Microsoft Windows Media Player Code Execution Exploit

MS10-076 Vulnerability in the Embedded OpenType Font Engine Could Allow Remote Code Execution (982132)

  • CVE-2010-1883– Embedded OpenType Font Integer Overflow Vulnerability
    IPS 5837 Malicious Font File Download 5b

MS10-077Vulnerability in .NET Framework Could Allow Remote Code Execution (2160841)

  • CVE-2010-3228– .NET Framework x64 JIT Compiler Vulnerability
    Note: There is no way to differentiate malformed and legitimate traffic.

MS10-078 Vulnerabilities in the OpenType Font (OTF) Format Driver Could Allow Elevation of Privilege (2279986)

  • CVE-2010-2740– OpenType Font Parsing Vulnerability
    IPS 5831 Malicious Font File Download 3b
  • CVE-2010-2741– OpenType Font Validation Vulnerability
    IPS 5832 Malicious Font File Download 4b

MS10-079Vulnerabilities in Microsoft Word Could Allow Remote Code Execution (2293194)

  • CVE-2010-2747– Word Uninitialized Pointer Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-2748– Word Boundary Check Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-2750– Word Index Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3214– Word Stack Overflow Vulnerability
    IPS 5833Malicious Word Document 3b
  • CVE-2010-3215– Word Return Value Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3216– Word Bookmarks Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3217– Word Pointer Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3218– Word Heap Overflow Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3219– Word Index Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3220– Word Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3221– Word Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.

MS10-080 Vulnerabilities in Microsoft Excel Could Allow Remote Code Execution (2293211)

  • CVE-2010-3230– Excel Record Parsing Integer Overflow Vulnerability
    IPS 5840Malicious Excel Document 6b
  • CVE-2010-3231– Excel Record Parsing Memory Corruption Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3232– Excel File Format Parsing Vulnerability
    IPS 5839Malicious Excel Document 5b
  • CVE-2010-3233– Lotus 1-2-3 Workbook Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3234– Formula Substream Memory Corruption Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3235– Formula Biff Record Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3236– Out Of Bounds Array Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3237– Merge Cell Record Pointer Vulnerability
    IPS 5834Malicious Excel Document 3b
  • CVE-2010-3238– Negative Future Function Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3239– Extra Out of Boundary Record Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3240– Real Time Data Array Record Vulnerability
    IPS 5838Malicious Excel Document 4b
  • CVE-2010-3241– Out-of-Bounds Memory Write in Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.
  • CVE-2010-3242– Ghost Record Type Parsing Vulnerability
    Note: There are no known public exploits targeting this vulnerability.

MS10-081 Vulnerability in Windows Common Control Library Could Allow Remote Code Execution (2296011)

  • CVE-2010-2746– Comctl32 Heap Overflow Vulnerability
    Note: There are no known public exploits targeting this vulnerability.

MS10-082 Vulnerability in Windows Media Player Could Allow Remote Code Execution (2378111)

  • CVE-2010-2745– Windows Media Player Memory Corruption Vulnerability
    Note: There are no known public exploits targeting this vulnerability.

MS10-083 Vulnerability in COM Validation in Windows Shell and WordPad Could Allow Remote Code Execution (2405882)

  • CVE-2010-1263– COM Validation Vulnerability
    Note: This is a platform design-level issue. The detection logic varies in different ActiveX control.

MS10-084 Vulnerability in Windows Local Procedure Call Could Cause Elevation of Privilege (2360937)

  • CVE-2010-3222– LPC Message Buffer Overrun Vulnerability
    Note: This is a Local elevation of privilege.

MS10-085 Vulnerability in SChannel Could Allow Denial of Service (2207566)

  • CVE-2010-3229– TLSv1 Denial of Service Vulnerability
    IPS 5846MS IIS 7.0 Denial of Service Attempt

MS10-086 Vulnerability in Windows Shared Cluster Disks Could Allow Tampering (2294255)

  • CVE-2010-3223– Permissions on New Cluster Disks Vulnerability
    Note: There is no way to differentiate malformed and legitimate traffic.