Worms
A worm is a malicious program that replicates itself in order to spread to other systems.
Worms can take the form of executable programs that a user is tricked into downloading and executing. Worms like SAMY make use of cross-site scripting to spread via JavaScript.
The Samy worm spread across MySpace in 2005 through a stored cross-site scripting flaw. Anyone who viewed an infected profile added Samy Kamkar, the worm's author, as a friend, and copied the worm onto their own profile for the next visitor. Within about 20 hours, over a million users had been infected, and MySpace had to take the site down to clean it up. (The payload added the line "but most of all, samy is my hero" to each victim's profile, which is about as polite as worms get.)