As some comments note, it is impossible for an ecosystem to be entirely parasitic. Somehow, somewhere, there has to be input to the system - on Earth, that's in the form of stuff like phytoplankton which pretty much consumes the unmatched power of the Sun.
That being said, if the worm ate plants that harvested sunlight like regular plants on Earth, then it might be possible for such an ecosystem to exist - if the worm eats far more food than it needs, then the parasites that live on it would sort of keep it "under control" and not growing too much, and those parasites would be kept in check in turn by their parasites, and so on and so forth. Very, very unlikely, but if the worm is allowed to eat the sun, there's a little less suspension of disbelief there.