A flaw in the way that Safari processes .PDF files was the reason that Comex was able to release a browser-based Jailbreak. However, the same exploit that allows automatic downloading and running of a PDF file is how hackers may be able to run code on your device without your consent. Masking a malicious PDF as a web link allows for a hacker to run code inside the file, and thus potentially take over your device.

This is already patched in the latest iOS 4.1 beta, but for those who have not yet updated (or those who want to keep their jailbreak past the inevitable final release of 4.1) there is a way to fix the exploit. It merely asks you every time you want to load a PDF file, but doesn’t actually fix the problem. It just notifies you that you’re about to be an idiot and open an unknown file.

MacStories has the fix, and it’s pretty simple: it involves using Terminal from your Mac or iFile from the iPhone:

Tweeted by @cdevwill earlier today, all you have to do is download this .deb file and open it on your device using either Terminal from your Mac, or iFile on the iPhone. Just download it and place it in /var/mobile.

- Using Terminal:

ssh root@your IP address

alpine

dpkg -i file.deb

Where “alpine” is the default password you’ll get after installing Open SSH from Cydia and “your IP address” is located under Settings – > Wifi – > active wifi connection.

- Using iFile:

Navigate to /var/mobile and double tap on the .deb file to install it.

Not the most elegant of solutions, but, hey, protect ‘yo delf!

(via MacStories)

Tweet