Title : Escape From PDF
Author : Didier Stevens
Date : 03/29/2010
Source : http://blog.didierstevens.com/2010/03/29/escape-from-pdf/
This is a special PDF hack: I managed to make a PoC PDF to execute an embedded executable without exploiting any vulnerability!
I use a launch action triggered by the opening of my PoC PDF. With Adobe Reader, the user gets a warning asking for approval to launch the action, but I can (partially) control the message displayed by the dialog. Foxit Reader displays no warning at all, the action gets executed without user interaction.
PDF viewers like Adobe Reader and Foxit Reader donât allow embedded executables (like binaries and scripts) to be extracted and executed, but I found another way to launch a command (/Launch /Action), and ultimately run an executable I embedded using a special technique. With Adobe Reader, a launch action needs to be approved by the user, but I can partially control the message displayed by the dialog box.
Example 1:
http://didierstevens.files.wordpress.com/2010/03/20100329-211248.png?w=478&h=262
Example 2:
http://didierstevens.files.wordpress.com/2010/03/20100329-211313.png?w=478&h=262
Do you believe this could this mislead some of your users? Or maybe you can come up with a better message to fool your users.
With Foxit Reader, no warning is displayed:
Example 3:
http://didierstevens.files.wordpress.com/2010/03/20100329-211310.png?w=457&h=385
Iâm not publishing my PoC PDF yet, but you can download a PDF that will just launch cmd.exe here. Use it to test your PDF reader:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/11987.zip (launch-action-cmd.zip)
With Adobe Reader, the only thing preventing execution is a warning. Disabling JavaScript will not prevent this (I donât use JavaScript in my PoC PDF), and patching Adobe Reader isnât possible (Iâm not exploiting a vulnerability, just being creative with the PDF language specs).
I shared my PoC with Adobeâs PSIRT. Maybe they will come up with a solution to prevent this, should they consider that the protection offered by the warning dialog is not sufficient. BTW, preventing Adobe Reader from creating new processes blocks this trick.
n this case, Foxit Reader is probably worse than Adobe Reader, because no warning gets displayed to prevent the launch action. My PoC PDF requires some changes for Foxit Reader, because ultimately, the executable doesnât run. But thatâs probably due to some variation in the PDF language supported by Foxit Reader.
Tested with Adobe Reader 9.3.1 on Windows XP SP3 and Windows 7.Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation