BUGS-3Lesson 3 of 39 min

Built-in protections and memory-safe languages

Overflows are an old problem, and the industry has added several protections against them. One of this course’s books, from 2008, has labs that only work with these protections switched off. Today they are on by default.

Four protections

Figure BUGS-3.1Protections against overflows
Table
ProtectionWhat it doesStops
Length check
Canary
No-run data memory
Random addresses
Memory-safe language
1/5

Buffer overflows have been understood for decades, and several protections now make them hard to use. They work at different points of the attack.

Step 1 of 5

No single protection is perfect, and skilled attackers have found ways around each one in particular cases. Together they turn most overflows from a takeover into a crash: defence in depth again.

Memory-safe languages

Microsoft and Google have each reported that about 70% of the serious security bugs in their large C and C++ programs were memory-safety bugs like this one. Security agencies including CISA and the NSA now urge software makers to move to memory-safe languages.

The picture today

For users, the lesson is the one from station HOST: keep software updated, because overflow fixes arrive as updates. For people who will write software: check every length, use safe functions, and prefer a memory-safe language for new code.

BUGS-3 counts as completed once you step through the figure to its last step.