The Legacy Virus is a fictional plague appearing in American comic books published by Marvel Comics, in particular those featuring the X-Men. It first appeared in an eponymous storyline running through Marvel Comics titles from 1993 to 2001, during which it swept through the mutant population of the Marvel Universe, killing hundreds and mutating so that it affected non-mutant humans as well.
The Legacy Virus was actually a viroid and was released by Stryfe, a terrorist (and clone of Cable raised by Apocalypse) from approximately 2,000 years in the future. It originally existed in two forms, Legacy-1 and Legacy-2, but later mutated into a third form, Legacy-3; all were airborne agents.
Legacy-1 and Legacy-2 searched for a target organism's "X-factor," the sequence of mutant genes that gave a mutant his/her superpowers. If it did not find an activated X-factor in the target, the viroid would die off, leaving the person completely unaffected. If, however, it did detect the X-factor, it would begin inserting introns (junk DNA sequences) into the transcription codings of the victim's mutant RNA, the process commonly being triggered after the patient used their powers for the first time after contracting the disease. The result was a major compromise of the replication and transcription process so disruptive as to eventually render the body incapable of creating healthy cells, ultimately resulting in the death of the victim. Prior to death, the viroid causes its host's powers to flare out of control.
Legacy-1 attacked general transcription and replication of all cells, a messy and non-selective process that resulted in a condition akin to a fast-replicating cancer. This is the version that infected Illyana "Magik" Rasputin, sister of Piotr "Colossus" Rasputin.