As carol said the first guess is Planaria which should be easy enough to confirm. If they are Planaria try adding a gourami ,i have found the dwarfs great. The Gourami love to chow down on the Planaria and other crawlies. you should find in a week or so the plague is amost gone.
Most outbreaks can be traced to collected live foods, new plant etc but some times can seem to come from nowhere.
They don't need a mate to start multiplying and can divide like a anemone. Generally they are no problem to the fish, eat left over food but can kill and eat eggs.
Good luck but don't stress