What a flaw costs
Four programming flaws (buffer overflow, integer overflow, unchecked input, unreleased resource) and what they cause for confidentiality, integrity and availability, then for the organisation.
- 22 cards
- 5 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- Scenarios
- Understand
A few cards from the deck
Software vulnerability: what is it?
Show the answer
A flaw in a program that a malicious person can exploit to make it do something other than what was intended.
Not every bug is a vulnerability: it needs an input the attacker controls and an effect that serves his goal (read, modify, block).
What does this C program print?
```c
#include <stdio.h>
int main(void) {
unsigned char c = 250;
c = c + 10;
printf("%d", c);
return 0;
}`4260255-6
Show the answer
4An
unsigned charis 8 bits (0 to 255): 260 is wrapped modulo 256, giving 4. The compiler reports nothing; the program carries on with a wrong value.In C, copying a string into an 8-byte buffer without checking its length causes a buffer …; it is prevented by a copy … to the destination size.
Show the answer
In C, copying a string into an 8-byte buffer without checking its length causes a buffer overflow; it is prevented by a copy bounded to the destination size.
strncpyorsnprintfbound the copy, provided the string is terminated correctly. The other safeguard is to check the length before copying.Buffer overflow: what is it?
Show the answer
Writing more data than a fixed-size memory area can hold, which overwrites the neighbouring memory.
In C,
strcpycopies up to the final zero without knowing the destination size. The overwrite can crash the program or hijack its execution.On its first flight, in 1996, Ariane 5 veers off course and destroys itself about forty seconds after liftoff. Which cause in the code did the inquiry establish?
- A buffer overflow in the telemetry software
- A division by zero in the trajectory calculation
- A memory leak that saturated the on-board computer
- A 64-bit float overflowing a 16-bit integer
Show the answer
A 64-bit float overflowing a 16-bit integer
Software in the inertial reference systems, reused from Ariane 4, converted a value linked to horizontal velocity which, larger on Ariane 5, no longer fitted in 16 bits. The unhandled exception shut down both units, and the on-board computer took their failure messages for flight data. A range check or a wider type would have prevented it.