Apple has moved quickly in order to fix a bug within iOS 4 for the iPhone and iPad. The bug allowed malicious code to be run if users visited a site with PDFs on it, but was also the cause of the loophole that allowed to jailbreak iPhones and iPads.

iPhone and iPad owners connecting their devices to iTunes will be prompted to download iOS 4.0.2 and iPad 3.2.2, fixing the loophole and with it the ability to run third party unofficial apps on the device.

At the beginning of August a group of developers released a way to jailbreak Apple's iPhone and iPad via the Safari browser without the need to connect any device to a computer.

The iPhone Dev team are warning people who want to stay "jailbroken" to avoid the new update:

"iOS 4.0.2 is out. Don't accept it! Please wait for further details".

Of course those who are playing by the rules are recommended to upgrade as soon as possible.

The 378MB download is live and ready to go.