Apple released iOS 4.0.2 for the iPhone (iOS 3.2.2 for the iPad) yesterday to patch a security hole that was identified last week. Shortly after Apple's release of 4.0.2, the code to exploit the security hole was publicly released by the person who first identified it.
What this means in practical terms is that any hacker can now get a copy of this code and use it to hijack your iPhone, iPod Touch or iPad if it has not been updated with Apple's security release. And the risk is not a minor one, the code could grant a hacker complete control of your device.
Security experts are strongly recommending that everyone update their devices as soon as possible. You should be prompted to update to iOS 4.0.2 (iOS 3.2.2 for the iPad) when you connect your device to your computer and run iTunes.