All jokes aside, after a quick google search it could be an internal parasite called Camallanus.

eek



https://petcoupon.wordpress.com/2011/11/28/fish-medical-guide-diagnosing-symptoms/

Quote:
If you can see a red worm protruding from the anus (vent), your fish has an internal parasite called Camallanus. Internal parasites can come from live food or be transmitted from fish to fish. This roundworm (nematode) is easy to identify because of its tendency to hang out the vent. Nematodes are best treated with fenbendazole, piperazine, or levimasole. Jungle Anti-Parasite Medicated Fish Food contains levimasole.