« 1 (900) I got malware!
IE 0 day and general browser security »

PDF: Pretty Dangerous File

January 16th, 2010

The PDF (Portable Document Format) certainly achieved worldwide popularity since its creation back in 1993. Contrary to a standard text file, it handles and preserves fonts, tables, images and looks the same for everybody. Also, to view the file does not require to buy any special program (unlike Microsoft Office). Compression is also pretty good which makes it the number one format to exchange documents on the Internet.

A PDF file in itself should be benign, it’s a document not an executable. That could explain why a lot of people may not realize the risk when opening a PDF attachment. However, the rich functionalities that PDF files support allow a user to craft a document containing dangerous code.

The most common and used technique is inserting Javascript code in the document so that it can cause a heap spray. For those non technical readers, think of it as a method to fill up the memory with shellcode, the program will become unresponsive and finally allow the attacker to execute their payload.

A less often used technique is to exploit a flaw in the PDF language itself which is possible but requires a lot more work and knowledge from the attacker’s point of view.

A PDF file can actually do more than just display a document. In fact, opening a PDF can be similar to running your typical .EXE file.

Now the other thing that a lot of people don’t quite fully grasp is the fact that PDF files can open themselves without your actually clicking on them. For convenience’s sake, when you install the most popular PDF program (Adobe Acrobat Reader), it gets integrated into your browser. Have you ever browsed a site and opened a PDF directly into Internet Explorer? OK, you could argue that you still clicked on a link to launch the PDF. Now what if I told you that you could just be browsing your regular site and out-of-the-blue the PDF document just popped up on your screen?

Malware authors write malicious code and inject it into benign websites. This code triggers your PDF software to open up a file without your consent. A specially crafted PDF file can now run with maximum privileges and compromise your PC.

We can summarize the process like this:

- Browser -> PDF Software -> Malware

I observe this method of infection also known as drive-by download on a regular basis. I’d say that PDF exploits are now one of the  most common attack vector there is, with a high probability of getting through several layers of defense, including User Account Control, Browser security and AV software.

When it comes to PDF security, it seems everybody is way behind. I regularly upload malicious PDFs to the online virus checker VirusTotal and very few AV products actually detect them. And what about Adobe in all of that? For a long time the company was more reactive than proactive, releasing security patches for their PDF software long after exploits were publicly known. With all the heat and attention (and also maybe the fear that people might start switching to a different PDF viewer) Adobe is dedicated to being security conscious and providing updates seamlessly.

All this sounds reassuring but unfortunately it is not a panacea. O day exploits (a known flaw for which there is no patch yet)  in Adobe Reader expose millions of people to malware. It seems like too much of a price to pay for an otherwise very handy program.

Personally, I have removed the Adobe Reader software from my computer altogether. Now I don’t advise that because it is annoying not being able to open so many documents directly from your browser. However, I have a standalone program that I run when I want to open a PDF file. It’s a rather all or nothing approach,  kind of like abstinence… you’re not going to get anyone pregnant ;-)

However, if you still want to be able to view your files easily, there are many tips you can use to reduce the surface of attack:

- use an alternate lesser known PDF software viewer (not the best piece of advice… it sounds like the “don’t use Internet Explorer, use Firefox” motto that resulted in an increase in Firefox exploits)

- disable Javascript within Adobe Reader. Since Javascript is the easiest and most common way to create malicious documents, by disabling it you render the code useless. You may lose a few features but not that many.

- if possible, use a guest account in Windows that you will use to browse the net, check your emails etc… A guest account has limited privileges, so in the event of an attack, the malware will not have sufficient credentials to get through to your system.

- if you are a little technical, read about Didier Stevens (The Man when it comes to PDF security) and how to make your software more secure.

- lastly, even if it’s not a guarantee, keep Adobe Reader updated. At least, you will be protected against all the known exploits (and there are many!).

On a general security point of view, I think there should be digital certificates added to PDF files. For example, whenever you download an invoice or health form that was provided by a legitimate government or organisation, then the document could bear a green checkmark or something like this. All other PDFs created by unknown individuals would have a “not verified” stamp that would prompt users before they actually open them. Wouldn’t be 100% fullproof but it would make the user more aware and prevent unverified PDFs from directly running.

Jerome Segura

    This entry was posted on Saturday, January 16th, 2010 at 6:09 pm and is filed under Malware Trends. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

    Comments:

    1.      by
    2.      by
    3.      by
    4.      by
    5.      by
    • (0) comments
    • |
    • Add your comments




RSS feed to this site
Jerome Segura is a Security Researcher at ParetoLogic.

Twitter

 

Malicious URLs

ParetoLogic, a Microsoft Certified Partner

 

 

Links

  • Malicious URLs
  • Phishing Emails
  • Free PDF Scanner
  • About
  • MalwareDiaries in the press
  • Contact Us



Archives

  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008



Categories

  • Adware (3)
  • Banker Trojans (4)
  • Botnets (9)
  • Conferences (7)
  • DDos (2)
  • Debates (2)
  • Exploits (69)
  • Fake codecs (48)
  • Gaming (1)
  • IM threats (1)
  • Interviews (5)
  • Keyloggers (3)
  • Mac security (15)
  • Malware Trends (71)
  • P2P (1)
  • Phishing (47)
  • Podcast (1)
  • ransomware (7)
  • Research (68)
  • Rogue software (58)
  • Rootkits (2)
  • scams (13)
  • Social Networking (7)
  • Spam (4)
  • Uncategorized (122)
  • Wireless Security (2)
  • world map (1)



 
 
 
Microsoft is a registered trademark of Microsoft Corporation in the United States and/or other countries.

© 2010 ParetoLogic Inc.