Is the worm clear with a black head? If so, it may be the larval stage of a fungus gnat. They are mostly saprophitic (feed on dead and decaying matter) but can be harmful to roots, not extensively though unless there is infestation. The adults are those annoying little black bugs that fly around near the plant but at this stage, do no damage to the plant. A little Safers application to the media works great.