Topic 3: C/C++ vulnerabilities Flashcards

1
Q

what is buffer overflow?

A

data is written outside a buffer’s boundary (after the buffer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

when do buffer overflows happen?

A

from insufficient input checks, unchecked buffer size, and integer overflows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what functions can cause buffer overflow? (many list at least 4/5)

A

strcpy(), strcat(), memcpy(), memset(), memmove(), read(), fread(), gets(), fgets()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are some effects of buffer overflow?

A
  • crash the app (DoS), take over the app, corrupt app state, leak sensitive data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is uninitialized memory?

A

Using a variable before initializing it with a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

vulnerabilities of uninitialized memory?

A

can contain stale program values controlled by the attacker, larger issue if what is controlled is a pointer, function pointers especially are critical

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what causes null pointers?

A

when a variable is uninitialized or when a previously cleared variable is used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is use-after-free (UAF)?

A

Temporal violation that occurs when writing using a pointer that no longer points to a valid buffer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

problems caused by UAF?

A

serious and hard to discover and defend against, become more complex due to threading and concurrency, as severe as other memory corruption errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is a segmentation fault?

A

when an attempt is made to access memory that either doesn’t exist or that requires a higher tier of permissions than what is accessible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is type confusion?

A

An object is accessed using a pointer of the wrong type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly