Trend Micro Facebook TrendLabs Twitter Malware Blog RSS Feed You Tube - Trend Micro
Search our blog:

  • Recent Posts

  • Calendar

    April 2014
    S M T W T F S
    « Mar    
  • About Us
    TrendLabs Security Intelligence Blog(breadcrumbs are unavailable)

    Author Archive - Jack Tang (Threats Analyst)

    In between the end of support for Windows XP and the Heartbleed OpenSLL vulnerability, one good bit of news may not have been noticed: the Microsoft Word zero-day vulnerability  (CVE-2014-1761) reported in late March was fixed.

    We have since looked into this attack and found that the exploit was created by an attacker with some skill, resulting in what can only be described as a sophisticated exploit.

    It’s quite fortunate that Microsoft was able to patch this vulnerability quickly, as its sophistication and the widespread use of Microsoft Word in enterprises meant that it would have been a highly tempting target for attackers to exploit. While this particular attack is no longer effective (as we will show later), we cannot rule out future attacks that will target the same vulnerability.

    Basic Flow of the Exploit

    This vulnerability is exploited when a user opens an RTF file in Microsoft Word, or previews/opens an RTF email in Outlook (using Word as the RTF viewer).

    The basic flaw at the core of this vulnerability is an out-of-bounds array overwrite. After overwriting, the memory now contains a fake object whose virtual table pointer points to a fake virtual table which is controlled by RTF control words with specially set values chosen by the attacker. The attacker used opcode addresses which point to addresse ranges used by MSCOMCTL.OCX.

    This particular executable is vulnerable to exploitation because it does not have address space layout randomization (ASLR) enabled; why this has been done is unknown. Carefully chosen portions of code (also known as ROP gadgets) from the above .OCX file are used to compose the first stage shellcode, which starts at the 0×40000000 memory address. The first stage shellcode finds the opened RTF file handle in the winword.exe process and maps the buffer into process space, which starts from the file offset 0xF004 and a length of 0×1000, to the process address 0×40002000. This makes up the second stage of shellcode.

    The second set somewhat unusually checks the Windows Update log of the affected system. If it sees that patches have been applied on or after April 8 (the regular Patch Tuesday date), it stops running. Otherwise, it drops its payload (named svchost.exe) and runs it. This particular attack is no longer effective today because of the April 8 date check, but it would be trivial to use similar code without the date check, especially with samples out in the wild to provide guidance to unaware attackers.

    In our analysis, we noticed that this particular sample crashes, but does not successfully exploit, older versions of Office 2010 without the latest updates installed as of late March (we found this using 14.0.4730.1010). Newer versions that were patched as of the discovery of the zero-day were successfully exploited.

    The sample is also similar to exploits for CVE-2012-2539, which also use an invalid value for the RTF control word listoverridecount, like this exploit.

    Solutions and Prevention

    As we noted in our first post on this threat, even before the official Microsoft patch (described in MS14-017) was released, we were able to heuristically detect this particular threat via Deep Dsicovery using the ATSE (Advanced Threats Scan Engine) and prevent users from being affected. However, we still recommend that users apply this patch in order to ensure the security of their systems.

    While other threats like those in online applications (such as browsers and plugins) or online services and protocols (like Heartbleed) may garner more attention, this threat is a reminder that more conventional threats – like exploits in RTF files – have not gone away. If anything, we’ve been observing RTFs used in several attacks recently, as carriers of CPL downloaders (here and here) and backdoors.

    We cannot rule out the possibility that CVE-2014-1761 will continue to be a threat moving forward, especially since many users will forget to update their installed version of Microsoft Word. For these users, our heuristic detection will be able to help reduce the risks of these attacks.

    Posted in Exploits, Vulnerabilities |

    Recently, security researchers disclosed two Java native layer exploits (CVE-2013-2465 and CVE-2013-2471). This caused us to look into native layer exploits more closely, as they have been becoming more common this year. At this year’s Pwn2Own competition at CanSecWest, Joshua Drake showed CVE-2013-1491, which was exploitable on Java 7 running on Windows 8. CVE-2013-1493 has become a popular vulnerability to target in exploits kits such as Blackhole.

    To understand why these exploits are becoming more common, some understanding of Java’s architecture is helpful. Java exploits can be divided into two types: Java layer exploits and Java native layer exploits.

    Figure 1. Java security model

    The above graph shows the Java security model. Java layer exploits target vulnerabilities in the Java layer runtime, which lets applications bypass the Security Manager and call high privilege functions. These exploits have the following characteristics:

    • Can be created with less effort, because attackers need not bypass operating system-level protections.
    • Are cross-platform (i.e., work with multiple operating systems)

    Similarly, Java native layer exploits target the Java native layer runtime. These exploits are harder to create, as they need to bypass OS-level protections like ASLR and DEP. In addition, the skills needed to create native layer exploits are more difficult to acquire.

    Figure 2. Timeline of common Java vulnerabilities

    In the past, Java layer vulnerabilities were more common, but that is no longer the case. Before 2013, there was a 3:1 ratio of Java layer vulnerabilities to Java native layer vulnerabilities. Starting this year, however, we are now seeing more native layer flaws. Why is this the case?

    • A large amount of the vulnerabilities of are present in the Java native layer code. In the June 2013 Java SE Critical Patch Update Advisory, approximately half of all the vulnerabilities fixed were in the Java native layer code.
    • Attackers are becoming more skillful in creating exploits. In the past, while there were many native layer vulnerabilities, less exploits were present because attackers did not always have the skill to create the necessary exploits.

    This year, however, attackers clearly have the capability to take advantage of native layer vulnerabilities. Two methods of exploitation are becoming more common,

    One is to make use of a Java array length overflow to tamper with the java.beans. Statement object’s AccessControlContext member. To do this, the following steps are necessary:

    1. Prepare a Java Array object on a heap.

      Figure 3. Step #1

    2. Trigger a Java native layer vulnerability. The array object’s length is overflowed to a very large value.

      Figure 4. Step #2

    3. An attacker can then use the array object to get or set the following buffer precisely. They can tamper with the following java.beans.Statement object’s acc field, which points to a AccessControlContext object. In general, the acc field will be tampered to point to a full permission AccessControlContext object. This will let arbitrary code be run on the affected system.

      Figure 5. Step #3

    This exploit method requires that both the buffer which can be used to trigger vulnerability and the buffer which needs to be overwritten are in the same heap. It requires some knowledge and skill to ensure that this is the case. In addition to this, information leaks and ROP shell code attacks were demonstrated at Pwn2Own 2013. It gets the module base address by targeting a Java native layer vulnerability and constructing ROP shell code to hijack the execution context. We believe that 2013 will see more similar exploits along these lines.

    We urge users to carefully evaluate their usage of Java is necessary and ensure that copies of Java that are used are updated, to reduce exposure to present and future Java flaws.

    Update as of 9:28 AM PDT, Sept. 2, 2013

    Trend Micro Deep Security provides protection for threats targeting CVE-2013-2465, CVE-2012-4681, CVE-2012-1723 via the following rules:

    • 1005598 – Identified Malicious Java JAR Files – 3
    • 1004870 – Identified Suspicious Jar File
    • 1005093 – Java Applet Field Bytecode Verifier Cache Remote Code Execution Vulnerability
    • 1005640 – Oracle Java storeImageArray() Invalid Array Indexing Vulnerability


    © Copyright 2013 Trend Micro Inc. All rights reserved. Legal Notice