Week 11 - Symbolic Execution
Week 11 - Symbolic Execution
Computer Systems
Security
Week 11 –
Symbolic Execution
Introduction
• Finding bugs
– Dynamic Analysis: Fuzzers - AFL
– Static Analysis: Symbolic Execution – EXE, KLEE,
SAGE, STACK
Introduction
• Verification
– Eliminates classes of bugs
– Proves that implementations obey specifications
– Promising, but requires a lot of resource
• Testing
– Making sure software acts in intended ways
– As strong as the test cases
– Against known bugs
• Fuzzing
– Concrete inputs are given to software
– Aim to cover the corner cases
– Against unknown bugs
Overview of EXE
• Crashes
– Divide by zero
– Null pointer dereference
• Out-of-bound array access
• Application specific bugs
• Symbolic execution
• Aims to detect deep bugs
– Not prove to absence of bugs
• Drives program along all paths in program
• Runs with symbolic values
• Branches on each if statement
– Creates one path condition for each if and else
branch
Overview of EXE
1. read int x, y
2. if x > y
3. x = y
4. if x < y
5. x = x + 1
6. if x + y == 7
7. error()
• Compile time
– Program is taken
– EXE runs over the code, instruments it
– When you get a branch statement in runtime, EXE runtime is
called
• Runtime
– Paths are explored
Example of EXE
• Runtime components
– The running app
– Constraints
– Constraint solver (STP)
x > y
App STP
OK/NO/DON’T KNOW
Example of EXE
x > y
App STP
OK/NO/DON’T KNOW
2. x > y
App STP
OK/NO/DON’T KNOW
• Easy
– x+7=y
• Hard
– x . y = 900
• Too hard
– 10 = hash(x)
The Solver