A computer worm is a type of malware that has the main function of repeating itself and infecting other computers while it is active on the infected systems. A computer worm copies itself to spread to uninfected computers.