Yesterday, Apple has released iOS 4.0.2 that solves the problem of security present on Safari which it was possible to obtain privileges that allow malicious code execution. The exploit, as you well know, has been used by Comex for the jailbreak of all devices. The new update, does not affect users of the iPhone 2G and iPod Touch 1G as iOS 4 is not available for these devices.
Therefore Apple did not consider these terminals in its updated and easy that people may exploit this flaw to create real options to JailbreakMe. To remedy this, Saurik has created a package on Cydia that fix the bug in all iDevices having any firmware version (even iOS 2.x). PDF patch, this is his name, will be available soon ( after some more thorough testing).
Please note that by running the update on your iPhone / iPod Touch / iPad, you will lose the ability to jailbreak your iDevice, especially if you do not have to save SHSH blobs, but if you already done so you can downgrade by following this guide.
Update 1: The package is now freely available through the repository of Saurik here.