Quiz 2 Flashcards
What is Concurrency?
The execution of multiple flows of operation.
What could occur if concurrency is not controlled?
Non-deterministic behavior could occur
What are Race Conditions?
Software defects/vulnerabilities resulting from unanticipated execution ordering of concurrent flows
What are the three properties of race conditions?
It must be concurrent, it must have a shared object and one of the controls must alter the state of the object
What is a Race Window?
A segment of code that access the race object in a way that opens a window of opportunity for a race condition (aka critical section)
What are some ways to avoid race conditions?
Ensure race windows do not overlap
Make them mutually exclusive
Use certain language facilities
What are Semaphores?
Data structures that provides mutual exclusion to critical sections
What are the two operations in semaphores?
Wait(semaphore) decrement and block line of execution until open
Signal(semaphore) increment and allow another thread to enter
What occurs when wait() is called by a thread?
If a semaphore is open, the thread continues, else it blocks on a queue
What occurs when a semaphore is opened by a signal()?
If the thread is waiting on a queue the thread is unblocked
Else the signal is remembered for the next thread
What is a deadlock?
A group of threads wait forever because each of them is waiting for resources that are held by another thread in the group
What are the two sources of race conditions?
“Trusted” control flows (highly coupled threads of execution)
“Untrusted” control flows (Separate application of process)
What are ToC/ToU (Time of check time of use) race conditions?
A race condition where the race object is first checked then used.
How does a ToC/ToU attack work?
The attacker uses the gap between the checking of the object and the use of the object to alter the object to be used to cause the attack
What are some common scenarios for double-fetch bugs to occur?
Dependency lookups
Protocol/signature checking
Information guessing
What is a data race?
A type of race condition that occurs at the level of atomic memory accesses
Data races are the root cause of what?
Synchronization bugs
What are some ways to mitigate race conditions?
Eliminating the race object
Checking file properties securely
Mutual exclusion
Thread safe function
Using atomic operations
Controlling access to the race object
Race condition detection is what complete?
NP complete meaning that we can only approximate detection of race conditions
What are some of the reasons for race condition detection being NP complete
Random time variants
Various different execution paths that could be taken
The time it takes to execute the analzation
What is the idea behind heap spraying?
Since browsers place the shellcode on the heap at an unknown location the idea is to “spray the heap” with a bunch of shellcodes there by making that its very likely that it will be chosen at random
Heap spray can assist with what?
Bypassing the ASLR
What are some defenses against heap spraying?
Protect heap function pointers
Have better browser architectures
Have heap overflow protection to prevent cross page overflows
What is Heap feng shui?
Reliable heap exploits on Internet explorer without spraying
What is vulnerable buffer placement?
Placing vulnerable buffers next to objects to cause an overflow to the object
What is javascript heap spraying?
Pointing the function pointer almost anywhere in the heap to cause the shellcode to execute
What is the goal of control flow hijacking?
To take control over a target machine
What are some common vulnerabilities in control flow hijacking?
Buffer overflow
Integer overflow
Format string vulnerabilities
UAF and Double-free
What are some common targets in control flow hijacking?
Return address
Vtable
Function pointer