Topic 3: C/C++ vulnerabilities Flashcards
what is buffer overflow?
data is written outside a buffer’s boundary (after the buffer)
when do buffer overflows happen?
from insufficient input checks, unchecked buffer size, and integer overflows
what functions can cause buffer overflow? (many list at least 4/5)
strcpy(), strcat(), memcpy(), memset(), memmove(), read(), fread(), gets(), fgets()
what are some effects of buffer overflow?
- crash the app (DoS), take over the app, corrupt app state, leak sensitive data
what is uninitialized memory?
Using a variable before initializing it with a value
vulnerabilities of uninitialized memory?
can contain stale program values controlled by the attacker, larger issue if what is controlled is a pointer, function pointers especially are critical
what causes null pointers?
when a variable is uninitialized or when a previously cleared variable is used
what is use-after-free (UAF)?
Temporal violation that occurs when writing using a pointer that no longer points to a valid buffer
problems caused by UAF?
serious and hard to discover and defend against, become more complex due to threading and concurrency, as severe as other memory corruption errors
what is a segmentation fault?
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
what is type confusion?
An object is accessed using a pointer of the wrong type