More threads by David Baxter PhD

David Baxter PhD

Late Founder
Unofficial Patch Released for Adobe Reader Bug
by Dennis Fisher, Threatpost
September 15, 2010

As users await the Oct. 4 release of a patch for the CoolType.dll vulnerability in Adobe Reader, a software and security company has published an unofficial patch for the bug that essentially replaces the vulnerable DLL with a patched one.

The patch was published Wednesday by RamzAfzar, a software development and pen-testing firm, which said in its description of the patch that it took approximately two hours to develop the fix. The method that the company used to fix the bug involves bypassing the insecure call in the DLL and using a more secure one in its place. The company says the patch works on Reader version 9.3.4.

"This call doesn't check length of src and dest parameter of strcat, so if Embedded Gaiji Font in PDF file includes a SING table with large UniqueName (like 300xA) stack will be destroyed and you'll be able to execute code with some techniques (like ROP method for bypassing DEP which is already implemented in the sample of this exploit found in the wild)," the company's explanation says.

"We've decided to modify this strcat call and convert it to strncat. Why? Because strncat at least receives the buffer size and how much bytes you want to copy from src to dest."

This kind of patch that's not supplied by the vendor was all the rage about four years ago, when independent researchers began publishing their own hotfixes for bugs that were awaiting vendor patches. The most notorious example is the Windows WMF vulnerability from late 2005. After the bug was disclosed, there were waves of attacks against the flaw, with a number of sites distributing the exploit. The flaw was considered to be quite serious, and with attacks ongoing, researcher Ilfak Guilfanov released his own patch for the flaw and anti-malware vendor ESET published its own fix soon after.

Microsoft took a dim view of this development, and urged customers to wait for the company's official patch, which came out about a week later. The trend continued with other high-profile bugs, as security vendor eEye Digital Security occasionally published unofficial patches for Windows flaws, including the .ANI bug from 2007.

It's been some time since the release of an unofficial patch has become a public issue, perhaps mainly because most of the major software vendors, including Microsoft and Adobe, have established regular patch cycles, making the time until a patch is available predictable, if not always ideal. And Adobe and Microsoft both have shown that they will go outside those patch cycles and issue emergency fixes when they deem it necessary, typically when a widespread bug is under active attack.

Although there are active attacks against the Reader bug right now, Adobe has given no indication that it plans to issue an emergency patch for the flaw before the next scheduled patch release on Oct. 4.
 

David Baxter PhD

Late Founder
[Unofficial] 0-Day Acrobat SING Table Vulnerability Patch
RamzAfzar
September 15, 2010

Greetings...

As you all may know, there is a new 0-day vulnerability which exploits insecure strcat call in CoolType.dll. This is so dangerous as you can find sample files and exploit generator in a lot of security web sites. Bad guys may use this exploit for their own purposes.

As you see, it's really dangerous. We decided to check with Adobe about patch release date. Suddenly we've discovered it will be patched 20 days later in 4 October 2010. Wow! It's really long time for customers being vulnerable and navigate internet with this conditions or opening a single PDF file using Adobe Acrobat reader.

So we've decided to go on and patch this easy vulnerability and protect at least our customers and all other interested people.

After initial analysis we've discovered that exploit exists in insecure strcat call located in CoolType.dll: (all addresses and names are from Latest Acrobat 9.3.4's CoolType.dll)

0803DDAB E8 483D1300 CALL JMP.&MSVCR80.strcat

This call doesn't check length of src and dest parameter of strcat, so if Embedded Gaiji Font in PDF file includes a SING table with large UniqueName (like 300xA) stack will be destroyed and you'll be able to execute code with some techniques (like ROP method for bypassing DEP which is already implemented in the sample of this exploit found in the wild)

We've decided to modify this strcat call and convert it to strncat. Why? Because strncat at least receives the buffer size and how much bytes you want to copy from src to dest.

So we've moved on. In the code as we don't have source we had to do binary patching, at first we decided to patch it with adding new section and writing our secure code there, but we decided to do it with inline patching.

We found an available address in text section at: 0818EF15 address

We moved all stack pushing operations for strcat call to that address and instead we inserted a jmp instruction to our 0818EF15 address.

In 0818EF15, we first inserted PUSH 0A0 parameter (which is last parameter for strncat)
Then we inserted original src and dest parameters of strcat call and finally we inserted a call to strncat instead of strcat.

Then we jump back to next instruction after strcat call. Using this method we bypassed strcat and redirected call to strncat with added size operator.

And that's all! It took our about 2 hours, I want to know why Adobe needs 20 days!! to patch such easy vulnerability WITH SOURCE CODE! We patched it without having source code in 2 hours and they need 20 days with code, looks odd to me!

Anyways, you can download this CoolType.dll and put it in your Acrobat Reader folder, simply overwrite old CoolType.dll and you'll be secure.

I should mention, we've patched Acrobat 9 variant's CoolType.dll, so if you are using older version of Acrobat, we suggest you to upgrade to Acrobat 9.3.4 and the apply this patch, you'll be safe!

We've notified about another vulnerability in Acrobat. It seems vulnerability exists in embedded Flash or 3D object, we don't have it's sample, if we receive it's sample, we'll be able to patch that vulnerability too as that vulnerability also will be patched in 4 October. But we've not detected so many exploitation attempt using that vulnerability and it seems it's not publicly available.

https://www.rafzar.com/customers/patches/CoolType.dll (2.32 MB)

or compressed version (think about our bandwidth ;) )
https://www.rafzar.com/customers/patches/CoolType.tgz (1.1 MB)
 
Replying is not possible. This forum is only available as an archive.
Top