Sounds like an anchor worm. One of my goldfish had them once but he was so sick anyway I had to put him down. I'm not sure how you treat anchor worms, I hear you are supposed to pull them out but maybe there is some sort of parasite treatment that kills them.