How can JavaScript be malicious?
Miscreants can program JavaScript in such a way that it will do things you might not want. For example, the recent Yamanner worm targeted Yahoo Mail. It harvested e-mail addresses, sent those off to the attacker, and forwarded itself to all contacts in a user’s Yahoo address book. The Samy worm spread on MySpace, changing profiles on the hugely popular social-networking Web site. Both worms were created in JavaScript.