A computer worm is a type of malware that, once it infects a machine, can automatically copy and extend itself to connected devices.
A computer virus is a type of malware that can replicate itself on your computer and spread to other devices.