AP® Computer Science Principles · Big Idea 5 · Topic 5.6

Viruses, Malware, and Software Updates

A virus is code that attaches to a legitimate program and copies itself onto new programs or machines without the user's consent. Updates fix the flaws viruses exploit, so skipping them keeps old doors open even with antivirus installed.

A program runs on your machine because something told the machine to run it: you clicked, you opened an attachment, or another program quietly triggered it. Malware gets that trigger by hiding inside something you trust, like an email attachment labeled as an invoice or a pirated app. You think you're running the thing you wanted. You're also running the malicious code riding along with it.

A virus specifically attaches itself to a legitimate program's code. When that host program runs, the virus's instructions run too, and they copy the virus into other programs or files on the system. From there it spreads again when you share a file, plug in a drive, or send an email, each copy looking for new hosts to infect. This is why one infected download on one machine can turn into a network-wide problem.

Software companies find flaws, the openings malware uses to run without permission, and release updates that close them. If you skip an update, the flaw stays open on your machine even though the fix exists and even though attackers now know exactly where to look, since patches often reveal what was broken. Antivirus software only catches malware matching patterns it already recognizes, so it does nothing for a flaw sitting unpatched in your operating system. Real protection needs both: antivirus for known malicious code, and updates for the flaws underneath it.

Key terms

Malware
Any software designed to run on a device without the user's informed consent and cause harm.
Virus
Malware that attaches to a legitimate program and copies itself into other programs or files when that program runs.
Flaw (vulnerability)
A weakness in software's code that lets malware run or data leak without authorization.
Patch
An update released to close a specific known flaw in software.
Antivirus software
A program that detects and blocks malware by matching it against known malicious patterns.

Watch it explained

  1. How it worksHow does a virus attach itself to a legitimate program and then copy itself onward?
  2. Going furtherWhat changes about your exposure when a known flaw is patched and you skip the update?
  3. Common mistakeWhy isn't antivirus software on its own enough to keep a system safe?

Check yourself

Your turn1 of 2
A known software flaw is patched, but 43 percent of users skip installing the update. Out of 65250 total users, how many remain exposed to the flaw?

End of topic.