4 / 6 · Intermediate
Software updates
Compared as text, version "2.9.1" sorts after "2.10.0", because the character 9 comes after 1; compared as numbers, 2.9.1 is the older one.
Jump to the 9 practice questionsYou will learn
- Explain what a security patch fixes
- Compare version numbers part by part
- Keep every device updating itself
Before this: Spotting phishing
1Explain
Is 2.10.0 newer than 2.9.1?
Try this before reading anything else. Your phone says version 2.10.0 is available, and you have 2.9.1. Is that an upgrade? Run the exercise below without changing it and look at the first line. It prints false. That is wrong. Text is compared character by character, and at the third character 9 comes after 1, so the comparison stops there and never sees the 10. Fix the function, then read on.
2Explore
Text or numbers
The first line compares the text letter by letter, the second compares the middle parts as numbers.
const a = "2.9.1", b = "2.10.0";
console.log(a < b);
console.log(Number(a.split(".")[1]) < Number(b.split(".")[1]));false
true3Practice
Compare versions part by part
isOlder(a, b) should say whether version a is older than b. Split each version on dots, turn the parts into numbers, and compare part by part. The output should be true, false, false.
true
false
falsefunction isOlder(a, b) {
return a < b; // compares text, not numbers: fix it
}
console.log(isOlder('2.9.1', '2.10.0'));
console.log(isOlder('3.0.0', '2.10.0'));
console.log(isOlder('1.4.2', '1.4.2'));
Hint
Stop at the first part that differs.
A solution
function isOlder(a, b) {
const x = a.split('.').map(Number);
const y = b.split('.').map(Number);
for (let i = 0; i < Math.max(x.length, y.length); i++) {
const p = x[i] || 0, q = y[i] || 0;
if (p !== q) return p < q;
}
return false;
}
console.log(isOlder('2.9.1', '2.10.0'));
console.log(isOlder('3.0.0', '2.10.0'));
console.log(isOlder('1.4.2', '1.4.2'));
4Problem
Which is newer?
Which is newer?
Hint
10 is bigger than 9.
Solution
Answer: 2.10.0
Compare part by part as numbers: 10 > 9.
5Explain
What an update is really carrying
Every large program has mistakes in it. Some of those mistakes are vulnerabilities, flaws that let someone run their own code on your device, read files they should not or take over an account. When the maker finds or is told about a flaw, it releases a fix, called a patch, inside an update. CISA's message is short: do not hit "Remind me later". Criminals study patches to learn which flaw was fixed and then go after devices that have not installed them yet.
6Problem
A patch
What is a patch?
Hint
A fix inside an update.
Solution
Answer: A fix for a flaw, delivered in an update
A patch fixes a flaw and is delivered through an update. Adding a feature alone is not a security fix; the patch removes a weakness an attacker could use.
7Problem
The days after a patch
Why are the days after a patch is released risky for un-updated devices?
Hint
The patch points at the flaw.
Solution
Answer: Attackers study the patch to find the flaw
Attackers can study what the patch changed to locate the flaw. Devices still running the unfixed version retain that weakness even though a repair is available.
8Explain
Zero-days and old flaws
A vulnerability that attackers use before any patch exists is called a zero-day, because the maker has had zero days to fix it. Zero-days make headlines. Most successful attacks, though, use flaws that were patched long ago, on devices that never installed the fix. CISA keeps a public Known Exploited Vulnerabilities catalogue listing flaws that have been seen in real attacks, and US federal agencies are required to patch them by set deadlines.
9Problem
A zero-day
What is a zero-day?
Hint
Zero days to fix it.
Solution
Answer: A flaw exploited before any patch exists
The maker has had zero days to fix it.
10Problem
The KEV catalogue
What does CISA's KEV catalogue list?
Hint
Known Exploited Vulnerabilities.
Solution
Answer: Vulnerabilities seen in real attacks
Known Exploited Vulnerabilities are flaws observed in real attacks. The catalogue is not a list of every theoretical bug or a recommendation of security products.
11Explain
Letting devices update themselves
The easiest habit is to turn on automatic updates. CISA suggests looking in the device settings under Software or Security, or searching the settings for "automatic updates". Not everything updates itself, so install the ones you are notified about too, and give priority to web browsers and security software, which face the internet all day. Remember the less obvious devices. The home router, smart TVs, cameras and other connected gadgets run software too, and CISA's ransomware guidance lists operating systems, applications and firmware together as things to keep patched.
12Problem
Update first
Which software should you update first, according to CISA?
Hint
What faces the internet all day.
Solution
Answer: Web browsers and security software
Browsers and security software face internet threats throughout the day. Prioritising their updates closes exposed flaws rather than treating every software change as equally urgent.
13Problem
Easy to forget
Which device is easy to forget but also needs updates?
Hint
The box that links your home to the internet.
Solution
Answer: The home router
Routers run firmware that receives security fixes.
14Explain
Only from official places
Get updates only from the device's own settings or its official app store. A web page that suddenly says your browser is out of date and offers a download is a common trick for installing malware. Watch for end of support as well. When a maker stops releasing security updates for an old operating system or device, new flaws are never fixed again.
15Problem
A fake update page
A web page says your browser is out of date and offers a download. What do you do?
Hint
Updates come from the settings, not from a page.
Solution
Answer: Close it and update from the browser's own settings
Fake update prompts are a common way to install malware.
16Problem
End of support
What happens after a product reaches end of support?
Hint
No more fixes.
Solution
Answer: New security flaws are no longer fixed
It may keep running, but every new flaw stays open.
17Explain
Restart, and check once a month
Updates often need a restart to take effect, and a pending restart is an update that is not yet protecting you. Choose a time, such as the end of the day, and let the device restart when it asks. On phones, keep enough free storage for updates to download, since a full phone is a common reason updates quietly stop. Once a month, open the update screen on each device and check that it says it is up to date.
18Explain
Common mistakes
"Updates only add features, so I can put them off."
Many updates carry security patches. Criminals study a new patch to find the flaw it fixes and then target devices that have not installed it, so delay is exactly when you are most exposed. Waiting is the risk.
"Only zero-days are really dangerous."
Zero-days get the headlines, but most successful attacks use flaws patched long ago on devices that never installed the fix. That is what CISA's KEV catalogue of flaws seen in real attacks is for.
"A page says my browser is out of date, so I should download its update."
Fake update prompts are a common way to install malware. Close the page and update from the browser's own settings or the official store.
"2.9.1 is newer than 2.10.0, because 9 is bigger than 1."
Versions are compared part by part as numbers. The second parts are 9 and 10, and 10 is greater, so 2.10.0 is newer.
19
Summary
- Updates carry patches for vulnerabilities; install them soon.
- Turn on automatic updates; browsers and security software first.
- Routers and other devices need firmware updates too.
- Update only from settings or official stores; replace unsupported software.