For Firefox users, you can use Firefox extension AdBlock and add the following lines to its filters to protect you from Facebook Malware:
UPDATE: There’s also AdBlock for Google Chrome Browser here!
According to the commenter who posted this simple hack on BoingBoing:
with all of those blocked, I don’t get any of the facebook frames showing up, since my browser refuses to ask for facebook URLs when not on facebook. (My browser, my rules, dammit)
Now you can safely browse your Facebook without getting malware!