One might think that vulnerabilities in ActiveX controls are a thing of the past, but we continue to find evidence that they have not. Just this year, dozens of vulnerabilities have been discovered. In some cases an ActiveX exploit is more attractive to an attacker for targeting specific users of certain software or a company that uses certain business applications.
A few weeks ago, we encountered such an example: an unknown vulnerability in an ActiveX control exploited in the wild. It was DaumGame ActiveX, a control required for playing a web game by Daum Communications on their website. Below, I outline the vulnerability and how one particular attacker exploited it.
DaumGame ActiveX (CLSID: 16B6A027-2732-4028-9303-EFE3E95EF766) versions 220.127.116.11 and 18.104.22.168 by Daum Communications include method "IconCreate," which is designed to support icon processing. This method is vulnerable to a classic buffer overflow. Here is the exploit code we discovered in the wild (CVE-2013-7246):
DaumGame ActiveX exploit from the wild
The method, which accepts printable characters, suffers from a buffer overflow vulnerability that leads to an SEH overwrite. A common technique for exploiting SEH involves overwriting the SE handler pointer with a memory address that points to assembly instructions (pop, pop, ret). This technique gives the attacker control over the pointer to the next SE handler and results in remote code execution. This sample, however, uses a less accurate technique to exploit this vulnerability resulting in the wasting of unneeded memory and slowing down the exploitation. Although it probably spared the attacker time in not having to deal with SafeSEH protections.
The attacker sprayed the memory with NOPs and shellcode and then overflowed the stack to overwrite the SEH pointer with an attacker controlled heap address ("0x05050505"). This address was already filled with NOPs and shellcode, which leads to remote code execution.
We reported the vulnerability to vendor Daum Communications, and they fixed the issue and released a patched version 22.214.171.124. We also published an advisory that contains further details on this vulnerability (CVE-2013-7246).
Trustwave's Secure Web Gateway blocked this attack out-of-the-box using its generic protection engine and did so without any additional updates. We have, however, released Security Update 161 to include additional protection against this particular zero-day exploit using the Malware Entrapment Engine.