These "worms" are probably not worms at all. Common in cycling marine aquariums (new aquariums) are algal blooms. The common ones are diatoms (brown dust), hair algae, and red cyanobacteria. These can be regulated by cycling the tank with filtration via live rock. Watch PO4, ca+, iodine, and NHs. When these levels are ideal over time your problems will subside.