That's quite a set of conditions you got there. Not only do you need to jailbreak your iPhone, but you also need to install SSH, and to top it all off, leave the root password as-is. I don't know about you, but if you're that lax about security, then it's hard to feel sorry for you.
The worm in question was spotted in Australia, and was mostly benevolent, as it served more as a warning to insecure jailbroken iPhones than anything else. It changed the wallpaper on your iPhone to a picture of Rick Astley, with the text "rikee is never going to give you up".
Once infected, your iPhone will look for other jailbroken iPhones with SSH installed and the default root password, after which it will proceed to infect those phones too. It's a classic worm, but completely harmless. In fact, I'd argue it's a positive thing, as it will nudge owners of jailbroken iPhones to properly secure their devices.
This same SSH/default password "exploit" has been used before; I know of at least two occasions where it was used in The Netherlands. Last week, for instance, a cracker scanned the IP range of T-Mobile in The Netherlands, and disabled some dozens of jailbroken iPhones. Initially, he demanded money for fixing them, but later on he posted a fix for free on the 'net.
What you'll see happening now is two things. First, people will claim this is a flaw in the iPhone and that Apple needs to do something about it. Nonsense of course, as this is not Apple's fault. Two, you'll see Apple fans claiming that jailbreaking is inherently dangerous, and that Apple is right in demanding that it remains illegal. This is also nonsense, as it's not jailbreaking that's dangerous - leaving your device with the default root password is. This is true of any computer.
All in all, this is pretty much a storm in a teacup. Own an iPhone? Nothing to worry about. Own a jailbroken iPhone? Just be sure to change the root password. That's all.