Rogue comet

A rogue comet is a general term for an astronomical body that has the characteristics of a comet, but does not have a permanent orbit around a star. Instead, it travels in interstellar space unless perturbed by another object.

Examples of rogue comets include:

One that passed through the Gamma Hydra system in 2267. This comet was unusual and produced radiation that caused extremely rapid aging in humanoids. The orbit of Gamma Hydra IV carried the planet directly through the comet's tail, exposing the planet to the radiation. Kirk alerted Starfleet that the comet was "highly dangerous". (TOS: "The Deadly Years")

A rogue comet was encountered by the USS Enterprise-D in 2370. It appeared to have originated in the D'Arsay system approximately 87 million years previously. The comet's outer shell was composed primarily of gaseoushydrogen and helium surrounding an icy mantle. The inner core consisted of heavier elements, as well as a cultural archive of a race from 87 million years in the past. The comet's outer shell was vaporized by the Enterprise in the course of investigating the comet and the archive. (TNG: "Masks")

The comet discovered in the Delta Quadrant by the USS Voyager in 2372 had an erratic trajectory without any associated stellar or planetary gravitational fields that could account for its motion. The comet was a rogue comet, imprisoning a Q identified as Quinn. (VOY: "Death Wish")