SlideShare a Scribd company logo
1 of 86
Download to read offline
On the Surprising E
ffi
ciency and 

Exponential Cost of Fuzzing
Marcel Böhme
Software Security

MPI-SP & Monash

Keywords: Vulnerability Discovery,
Automated Software Testing,
E
ff
ectiveness, E
ffi
ciency, 

Scalability, Guarantees
• Fuzzing for Automatic Vulnerability Discovery

• Making machines attack other machines.

• Focus on scalability, e
ffi
ciency, and e
ff
ectiveness.

• Foundations of Software Security

• Assurances in Software Security

• Fundamental limitations of existing approaches

• Drawing from multiple disciplines (information theory, biostatistics)

whoami
2
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Whitebox Fuzzing
φ1 = (s0 != 'b')
Path Conditions
✓
s1 != 'b'
φ1
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Whitebox Fuzzing
φ1 = (s0 != 'b')
Path Conditions
✓
s1 != 'b' s1 == 'b'
s2 != 'a'
φ1
φ2
φ2 = (s0 == 'b') / (s1 != 'a')
✓
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Whitebox Fuzzing
φ1 = (s0 != 'b')
Path Conditions
✓
s1 != 'b' s1 == 'b'
s2 == 'a'
s2 != 'a'
s3 != 'd' s3 == 'd'
s4 != '!' s4 != '!'
φ1
φ2
φ3
φ4 φ5
φ2 = (s0 == 'b') / (s1 != 'a')


φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')


φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')


φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
φ1 = (s0 != 'b')
Path Conditions
✓
φ2 = (s0 == 'b') / (s1 != 'a')


φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')


φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')


φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
Whitebox Fuzzing: Most Effective!
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
It can prove the absence of assertion violation,


by enumerating all paths and modulo some assumptions.
φ1 = (s0 != 'b')
Path Conditions
✓
φ2 = (s0 == 'b') / (s1 != 'a')


φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')


φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')


φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
Whitebox Fuzzing: Most Effective!
2
φ1 = (s0 != 'b')
Path Conditions
✓
φ2 = (s0 == 'b') / (s1 != 'a')


φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')


φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')


φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
Whitebox Fuzzing: Quite Efficient!
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
φ1 = (s0 != 'b')
Path Conditions
✓
φ2 = (s0 == 'b') / (s1 != 'a')


φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')


φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')


φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
Whitebox Fuzzing: Quite Efficient!
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
We only need 3 inputs to find the bug, on average,


if we choose each path at random without replacement.


Choose a random path from the multivariate hypergeometric (i.e., enumerate).


Choose some input that exercises that path (by constraint solving).
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: just random, really.
For each parameter, choose 1 of 256 values


uniformly at random.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: just random, really.
For each parameter, choose 1 of 256 values


uniformly at random.
It can never prove the absence of assertion violation!
https://www.cs.utexas.edu/users/EWD/ewd02xx/EWD249.PDF
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: just random, really.
For each parameter, choose 1 of 256 values


uniformly at random.
It can never prove the absence of assertion violation!
Well, that’s not entirely true. We can estimate a “residual risk”.
[ESEC/FSE’21] Estimating Residual Risk in Greybox Fuzzing, M Böhme, D Liyanage, V Wüstholz

[TOSEM’18] STADS: Software Testing as Species Discovery, M Böhme; ACM Trans. Softw. Eng. Meth.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: just random, really.
For each parameter, choose 1 of 256 values


uniformly at random.
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: just random, really.
For each parameter, choose 1 of 256 values


uniformly at random.
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
So, whitebox fuzzing is better, right?
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: just random, really.
For each parameter, choose 1 of 256 values


uniformly at random.
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
So, whitebox fuzzing is better, right? Wrong. At least not always.
“Whitebox Fuzzing”
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
If our whitebox fuzzer takes too long


per input, our blackbox fuzzer outperforms!


» There is a maximum time per test input!
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
If our whitebox fuzzer takes too long


per input, our blackbox fuzzer outperforms!


» There is a maximum time per test input!
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
Blackbox Fuzzing: Super fast!
• Our model: Error-based partitioning

• EITHER all inputs in a partition do reveal a bug

OR all inputs in a partition do not reveal a bug

Bounds on Fuzzing Efficiency
The most effective testing technique


samples from error-based partitions!


— Weyuker and Jeng’91
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Our model: Error-based partitioning

• EITHER all inputs in a partition do reveal a bug

OR all inputs in a partition do not reveal a bug

• However, we have no a-priori knowledge whether a partition is error-revealing.

• Partitions are of arbitrary size and number.
Bounds on Fuzzing Efficiency
The most effective testing technique


samples from error-based partitions!


— Weyuker and Jeng’91
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Our model: Error-based partitioning

• EITHER all inputs in a partition do reveal a bug

OR all inputs in a partition do not reveal a bug.

• A testing technique samples the program’s input space and 

discovers a partition Di when Di is sampled for the
fi
rst time.

• The discovery of Di shows whether or not Di reveals a bug.

• Notice that we assume a test oracle.
Bounds on Fuzzing Efficiency
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• A testing technique achieves a degree of con
fi
dence x when at least x% of the
program inputs reside in discovered partitions.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.

• Blackbox Fuzzing (R)


• Samples inputs randomly

• Some partitions several times, others not at all

• 1 time unit per input

• Whitebox Fuzzing (S)

• Samples inputs systematically

• Each partition exactly once!

• Most e
ff
ective!

• c time units per input
Bounds on Fuzzing Efficiency
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Whitebox Fuzzing
Time
Con
fi
dence
Achieved
Expected to


achieve 100% in


c·k time units
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
R
Blackbox Fuzzing
Expected to


achieve 100% in


∞ time units
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
c=1
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
Increasing c of S,


increases time to achieve


same degree of confidence!
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Time
Con
fi
dence
Achieved
x
R
c0
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.
Bounds on Fuzzing Efficiency
Blackbox Fuzzing wins —


if the average time to sample


one test input exceeds c0
Time
Con
fi
dence
Achieved
x
R
c0
S
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.

•
Bounds on Fuzzing Efficiency
• Answer: S is expected to lose if c > time units.

• Example:

• R takes 1ms to sample one test input


• Establish correctness for x=90% of inputs


S0 must take less than 4.1ms to sample one test input


Otherwise, R is expected to achieve the 90%-degree of con
fi
dence
fi
rst.
imately as
kpmaxe npmax
]
pi)n by q(n).
ces such that
i 2 Imax we
(17)
(18)
(19)
nmax we have
i
Given a degree of confidence x, we compute the maximum
cost c0 such that the expected time it takes for S0 to achieve
x is at most the same as the expected time it takes R to
achieve x and S0 remains more efficient than R.
Proposition 1
Given a degree of confidence x : 1 e 1
 x < 1, let ns
and nr be the time at which S0 and R are expected to
achieve x, respectively. For all programs P, the maximum
cost c0 of S0, such that ns  nr, is bounded above as
c0 .
1
ex ex2
Proof : Fix a program P which in turn fixes the number of
partitions k and also the probabilities pi for all i : 1  i  k.
Let cP
0 be the cost of S0, such that ns = nr for P. Now,
setting fs(n) = |D|x yields
n = xkcP
0 (25)
Setting fr(n) = |D|x gives
x ⇠ 1
k
X
pie npi (26)
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.

•
Bounds on Fuzzing Efficiency
• Answer: S is expected to lose if c > time units.

• Example:

• R takes 1ms to sample one test input


• Establish correctness for x=99.9% of inputs


S0 must take less than 370ms to sample one test input


Otherwise, R is expected to achieve the 99.9%-degree of con
fi
dence
fi
rst.
imately as
kpmaxe npmax
]
pi)n by q(n).
ces such that
i 2 Imax we
(17)
(18)
(19)
nmax we have
i
Given a degree of confidence x, we compute the maximum
cost c0 such that the expected time it takes for S0 to achieve
x is at most the same as the expected time it takes R to
achieve x and S0 remains more efficient than R.
Proposition 1
Given a degree of confidence x : 1 e 1
 x < 1, let ns
and nr be the time at which S0 and R are expected to
achieve x, respectively. For all programs P, the maximum
cost c0 of S0, such that ns  nr, is bounded above as
c0 .
1
ex ex2
Proof : Fix a program P which in turn fixes the number of
partitions k and also the probabilities pi for all i : 1  i  k.
Let cP
0 be the cost of S0, such that ns = nr for P. Now,
setting fs(n) = |D|x yields
n = xkcP
0 (25)
Setting fr(n) = |D|x gives
x ⇠ 1
k
X
pie npi (26)
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.

•
Bounds on Fuzzing Efficiency
• Answer: S is expected to lose if c > time units.

• Example:

• R takes 1ms to sample one test input


• Establish correctness for x=99.9% of inputs


S0 must take less than 370ms to sample one test input


Otherwise, R is expected to achieve the 99.9%-degree of con
fi
dence
fi
rst.
imately as
kpmaxe npmax
]
pi)n by q(n).
ces such that
i 2 Imax we
(17)
(18)
(19)
nmax we have
i
Given a degree of confidence x, we compute the maximum
cost c0 such that the expected time it takes for S0 to achieve
x is at most the same as the expected time it takes R to
achieve x and S0 remains more efficient than R.
Proposition 1
Given a degree of confidence x : 1 e 1
 x < 1, let ns
and nr be the time at which S0 and R are expected to
achieve x, respectively. For all programs P, the maximum
cost c0 of S0, such that ns  nr, is bounded above as
c0 .
1
ex ex2
Proof : Fix a program P which in turn fixes the number of
partitions k and also the probabilities pi for all i : 1  i  k.
Let cP
0 be the cost of S0, such that ns = nr for P. Now,
setting fs(n) = |D|x yields
n = xkcP
0 (25)
Setting fr(n) = |D|x gives
x ⇠ 1
k
X
pie npi (26)
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.

•
Bounds on Fuzzing Efficiency
• Answer: S is expected to lose if c > time units.

• Example:

• R takes 1ms to sample one test input


• Establish correctness for x=99.9% of inputs


S0 must take less than 370ms to sample one test input


Otherwise, R is expected to achieve the 99.9%-degree of con
fi
dence
fi
rst.
For all programs


imately as
kpmaxe npmax
]
pi)n by q(n).
ces such that
i 2 Imax we
(17)
(18)
(19)
nmax we have
i
Given a degree of confidence x, we compute the maximum
cost c0 such that the expected time it takes for S0 to achieve
x is at most the same as the expected time it takes R to
achieve x and S0 remains more efficient than R.
Proposition 1
Given a degree of confidence x : 1 e 1
 x < 1, let ns
and nr be the time at which S0 and R are expected to
achieve x, respectively. For all programs P, the maximum
cost c0 of S0, such that ns  nr, is bounded above as
c0 .
1
ex ex2
Proof : Fix a program P which in turn fixes the number of
partitions k and also the probabilities pi for all i : 1  i  k.
Let cP
0 be the cost of S0, such that ns = nr for P. Now,
setting fs(n) = |D|x yields
n = xkcP
0 (25)
Setting fr(n) = |D|x gives
x ⇠ 1
k
X
pie npi (26)
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Achieving con
fi
dence: Whoever can show
fi
rst that the
program works correctly for x% of its inputs wins.

•
Bounds on Fuzzing Efficiency
• Answer: S is expected to lose if c > time units.

• Example:

• R takes 1ms to sample one test input


• Establish correctness for x=99.9% of inputs


S0 must take less than 370ms to sample one test input


Otherwise, R is expected to achieve the 99.9%-degree of con
fi
dence
fi
rst.
For all programs


worst-case
partitioning


imately as
kpmaxe npmax
]
pi)n by q(n).
ces such that
i 2 Imax we
(17)
(18)
(19)
nmax we have
i
Given a degree of confidence x, we compute the maximum
cost c0 such that the expected time it takes for S0 to achieve
x is at most the same as the expected time it takes R to
achieve x and S0 remains more efficient than R.
Proposition 1
Given a degree of confidence x : 1 e 1
 x < 1, let ns
and nr be the time at which S0 and R are expected to
achieve x, respectively. For all programs P, the maximum
cost c0 of S0, such that ns  nr, is bounded above as
c0 .
1
ex ex2
Proof : Fix a program P which in turn fixes the number of
partitions k and also the probabilities pi for all i : 1  i  k.
Let cP
0 be the cost of S0, such that ns = nr for P. Now,
setting fs(n) = |D|x yields
n = xkcP
0 (25)
Setting fr(n) = |D|x gives
x ⇠ 1
k
X
pie npi (26)
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
• Our insight: Even the most e
ff
ective fuzzing technique 

is less e
ffi
cient than blackbox fuzzing if generating a test
takes relatively too long.

• We shed light on a 40 year old riddle and demonstrate a
fundamental limitation of whitebox fuzzing. 

(including grammar-based whitebox fuzzing)
Bounds on Fuzzing Efficiency
[FSE’14] On the E
ffi
ciency of Automated Testing, M Böhme, S. Paul,

[TSE’15] A Probabilistic Analysis of the E
ffi
ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. 

So, if we have sufficiently many machines


(to maximize execs/sec), blackbox fuzzers


are the best we can get, right?
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. 

So, if we have sufficiently many machines


(to maximize execs/sec), blackbox fuzzers


are the best we can get, right?
Wrong.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. 

Generational
So, if we have sufficiently many machines


(to maximize execs/sec), blackbox fuzzers


are the best we can get, right?
Wrong.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. 

Generational
• Mutational Blackbox Fuzzer mutates a random character in a seed.
So, if we have sufficiently many machines


(to maximize execs/sec), blackbox fuzzers


are the best we can get, right?
Wrong.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation.

• Mutational Blackbox Fuzzer mutates a random character in a seed.

• Started with the seed bad?

• Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation.

• Mutational Blackbox Fuzzer mutates a random character in a seed.

• Started with the seed bad?

• Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation.

• Mutational Blackbox Fuzzer mutates a random character in a seed.

• Started with the seed bad?

• Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation.

• Mutational Blackbox Fuzzer mutates a random character in a seed.

• Started with the seed bad?

• Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation.

• Mutational Blackbox Fuzzer mutates a random character in a seed.

• Started with the seed bad?

• Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Alright, we cheated. We chose a good


seed to start with.
Blackbox Fuzzing: Super fast!
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation.

• Mutational Blackbox Fuzzer mutates a random character in a seed.

• Started with the seed bad?

• Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation.
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
Alright, we cheated. We chose a good


seed to start with.
What if we could automatically


discover this seed?
Greybox Fuzzing: “Enumerate”
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
**** b*** (1✕ 4-1 ✕ 2-8)-1

= 1024
****


b***
ba** (1/2 ✕ 4-1 ✕ 2-8)-1

= 2048
****


b***


ba**
bad* (1/3 ✕ 4-1 ✕ 2-8)-1

= 3072
****


b***


ba**


bad*
bad! (1/4 ✕ 4-1 ✕ 2-8)-1

= 4096
Total: 10240
Seed corpus
Expected #inputs
“Interesting”

Input
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
Greybox Fuzzing: “Enumerate”
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
**** b*** (1✕ 4-1 ✕ 2-8)-1

= 1024
****


b***
ba** (1/2 ✕ 4-1 ✕ 2-8)-1

= 2048
****


b***


ba**
bad* (1/3 ✕ 4-1 ✕ 2-8)-1

= 3072
****


b***


ba**


bad*
bad! (1/4 ✕ 4-1 ✕ 2-8)-1

= 4096
Total: 10240
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
Greybox Fuzzing: “Enumerate”
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
• Greybox Fuzzing started only with **** in 

the seed corpus discovers the bug after

10k inputs (in 150 microseconds)!
**** b*** (1✕ 4-1 ✕ 2-8)-1

= 1024
****


b***
ba** (1/2 ✕ 4-1 ✕ 2-8)-1

= 2048
****


b***


ba**
bad* (1/3 ✕ 4-1 ✕ 2-8)-1

= 3072
****


b***


ba**


bad*
bad! (1/4 ✕ 4-1 ✕ 2-8)-1

= 4096
Total: 10240
Greybox Fuzzing: “Enumerate”
void crashme (char s0, char s1, char s2, char s3) {


int crash = 0;




if (s0 == 'b')


if (s1 == 'a')


if (s2 == 'd')


if (s3 == ‘!’)


crash = 1;


if(crash == 1) abort();


}
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
• Greybox Fuzzing started only with **** in 

the seed corpus discovers the bug after

10k inputs (in 150 microseconds)!
• Boosted Greybox Fuzzing started with **** 

in the seed corpus discovers the bug after

4k inputs (in 55 microseconds)!
**** b*** (1✕ 4-1 ✕ 2-8)-1

= 1024
****


b***
ba** (1 ✕ 4-1 ✕ 2-8)-1

= 1024
****


b***


ba**
bad* (1 ✕ 4-1 ✕ 2-8)-1

= 1024
****


b***


ba**


bad*
bad! (1 ✕ 4-1 ✕ 2-8)-1

= 1024
Total: 4096
Greybox Fuzzing: “Enumerate”
• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
More Machines!
Awesome! We have a really efficient fuzzers.


Let’s throw more machines at the problem!
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
More Machines!
X times more machines means


X times more bugs, right?
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
More Machines!
X times more machines means


X times more bugs, right?
Wrong.
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
Scalability
• 300+ OSS projects (OSSFuzz & Fuzzer-Test-Suite)

• 6 measures of code coverage (4) and bug
fi
nding e
ff
ectiveness (2)

• 4+ CPU years worth of fuzzing campaigns

• 2 fuzzers (AFL and LibFuzzer)

• Open Science and Reproducibility

• Reproduce our results under other circumstances.

• Inspect our data and simulation @ Kaggle (Jupyter Notebook).

• Modify parameters in our simulation and analysis.
[FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.

M. Böhme, Brandon Falk (Microsoft)
• #Machines
• An abstraction of the #inputs the fuzzer can generate per minute. 

• Example: Twice the #machines can generate twice #inputs per minute.

• We assume no synchronisation overhead. For greybox fuzzers, 

new seeds immediately available to all fuzzers.

• We use this de
fi
nition for data scaling.
[FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.

M. Böhme, Brandon Falk (Microsoft)
Scalability
•
Fuzzer Test Suite (45min campaigns)
23
Number of Additional Vulns Discovered

Number of Additional Vulns Discovered

Probability to Discover Given Vulnerability

Given the same non-deterministic fuzzer,


discovering linearly more new species


within the same time budget, requires


exponentially more inputs per minute.
Probability to Discover Given Vulnerability

Probability to Discover Given Vulnerability

Probability to Discover Given Vulnerability

Inflection Point
Inflection Point
Probability to Discover Given Vulnerability

Inflection Point
Inflection Point
Between origin and inflection point,


an exponential curve grows slower


than discovery probability!
Probability to Discover Given Vulnerability

• What does that mean for a non-deterministic fuzzer?
Probability to Discover Given Vulnerability

[FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.

M. Böhme, Brandon Falk (Microsoft)
• What does that mean for a non-deterministic fuzzer?

• The probability of exposing a speci
fi
c known vulnerability,

• the probability of reaching a speci
fi
c program statement,

• the probability of violating a speci
fi
c program assertion, etc.

• within a given time budget increases approximately linearly with the
number of available machines — up to a certain limit.
Probability to Discover Given Vulnerability

[FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.

M. Böhme, Brandon Falk (Microsoft)
• What does that mean for a non-deterministic fuzzer?

• The probability of exposing all (known) vulnerabilities,

• the probability of reaching all program statements,

• the probability of violating all program assertions, etc.

• within a given time budget increases approximately linearly with the
number of available machines — up to a certain limit.
Probability to Discover Given Vulnerability

[FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.

M. Böhme, Brandon Falk (Microsoft)
Explaining to Exponential Cost

Figure 10. Number of additional species discovered in a
fi
xed time budget 

as the number of machines increases (5 random samples of each.
Figure 10. Number of additional species discovered in a
fi
xed time budget 

as the number of machines increases (5 random samples of each.
Explaining to Exponential Cost

Figure 10. Number of additional species discovered in a
fi
xed time budget 

as the number of machines increases (5 random samples of each.
Explaining to Exponential Cost

Figure 10. Number of additional species discovered in a
fi
xed time budget 

as the number of machines increases (5 random samples of each.
Explaining to Exponential Cost

Figure 10. Number of additional species discovered in a
fi
xed time budget 

as the number of machines increases (5 random samples of each.
Explaining to Exponential Cost

Intuitively, each new vulnerability requires


some more resources (time or machines)


than the previous vulnerability.
Explaining to Exponential Cost

On the Cost of Vulnerability Discovery
A constant rate of vulnerability discovery


requires exponential amount of resources.
*This is a fundamental limitation of fuzzing!
26
[FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.

M. Böhme, Brandon Falk (Microsoft)

Nominated for ACM Distinguished Paper Award
Wrap up slide
26
void crashme (char s0, char s1, char s2, char s3) {
int crash = 0;
if (s0 == 'b')
if (s1 == 'a')
if (s2 == 'd')
if (s3 == ‘!’)
crash = 1;
if(crash == 1) abort();
}
It can prove the absence of assertion violation,
by enumerating all paths and modulo some assumptions.
φ1 = (s0 != 'b')
Path Conditions
✓
φ2 = (s0 == 'b') / (s1 != 'a')
φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')
φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')
φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
Whitebox Fuzzing: Most Effective!
2
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
If our whitebox fuzzer takes too long
per input, our blackbox fuzzer outperforms!
» There is a maximum time per test input!
void crashme (char s0, char s1, char s2, char s3) {
int crash = 0;
if (s0 == 'b')
if (s1 == 'a')
if (s2 == 'd')
if (s3 == ‘!’)
crash = 1;
if(crash == 1) abort();
}
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
Blackbox Fuzzing: Super fast!
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
• Greybox Fuzzing started only with **** in 

the seed corpus discovers the bug after

10k inputs (in 150 microseconds)!
• Boosted Greybox Fuzzing started with **** 

in the seed corpus discovers the bug after

4k inputs (in 55 microseconds)!
**** b*** (1✕ 4-1 ✕ 2-8)-1

= 1024
****
b***
ba** (1 ✕ 4-1 ✕ 2-8)-1

= 1024
****
b***
ba**
bad* (1 ✕ 4-1 ✕ 2-8)-1

= 1024
****
b***
ba**
bad*
bad! (1 ✕ 4-1 ✕ 2-8)-1

= 1024
Total: 4096
Greybox Fuzzing: “Enumerate”
Figure 10. Number of additional species discovered in a fixed time budget 

as the number of machines increases (5 random samples of each.
Exponential Cost of Vulnerability Discovery

Wrap up slide
26
void crashme (char s0, char s1, char s2, char s3) {
int crash = 0;
if (s0 == 'b')
if (s1 == 'a')
if (s2 == 'd')
if (s3 == ‘!’)
crash = 1;
if(crash == 1) abort();
}
It can prove the absence of assertion violation,
by enumerating all paths and modulo some assumptions.
φ1 = (s0 != 'b')
Path Conditions
✓
φ2 = (s0 == 'b') / (s1 != 'a')
φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd')
φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!')
φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!')
✓
✓
✓
✗
Whitebox Fuzzing: Most Effective!
2
• Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation.

• Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
If our whitebox fuzzer takes too long
per input, our blackbox fuzzer outperforms!
» There is a maximum time per test input!
void crashme (char s0, char s1, char s2, char s3) {
int crash = 0;
if (s0 == 'b')
if (s1 == 'a')
if (s2 == 'd')
if (s3 == ‘!’)
crash = 1;
if(crash == 1) abort();
}
On 100 machines, it takes 63 milliseconds.
On my machine, this takes 6.3 seconds.
Blackbox Fuzzing: Super fast!
[CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 

M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal)
• Greybox Fuzzing: Add generated inputs 

to the corpus which increase coverage!
• Greybox Fuzzing started only with **** in 

the seed corpus discovers the bug after

10k inputs (in 150 microseconds)!
• Boosted Greybox Fuzzing started with **** 

in the seed corpus discovers the bug after

4k inputs (in 55 microseconds)!
**** b*** (1✕ 4-1 ✕ 2-8)-1

= 1024
****
b***
ba** (1 ✕ 4-1 ✕ 2-8)-1

= 1024
****
b***
ba**
bad* (1 ✕ 4-1 ✕ 2-8)-1

= 1024
****
b***
ba**
bad*
bad! (1 ✕ 4-1 ✕ 2-8)-1

= 1024
Total: 4096
Greybox Fuzzing: “Enumerate”
Figure 10. Number of additional species discovered in a fixed time budget 

as the number of machines increases (5 random samples of each.
Exponential Cost of Vulnerability Discovery

If you want to take a deeper dive:
* Read our interactive text book: The Fuzzing Book

* Read our IEEE Software article: “Fuzzing: Challenges and Re
fl
ections”

* Apply for PhD / PostDoc in my group at MPI-SP, Bochum, Germany.

Web: https://mboehme.github.com Twitter: @mboehme_

More Related Content

Similar to On the Surprising Efficiency and Exponential Cost of Fuzzing

Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)James Titcumb
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to PerlSway Wang
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)hasan0812
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test frameworkAbner Chih Yi Huang
 
LET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERSLET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERSKavyaSharma65
 
44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...
44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...
44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...44CON
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -Wataru Kani
 

Similar to On the Surprising Efficiency and Exponential Cost of Fuzzing (9)

Yg byev2e
Yg byev2eYg byev2e
Yg byev2e
 
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
LET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERSLET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERS
 
Strings and Characters
Strings and CharactersStrings and Characters
Strings and Characters
 
44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...
44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...
44CON 2013 - The Forger's Art: Exploiting XML Digital Signature Implementatio...
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
 

More from mboehme

An Implementation of Preregistration
An Implementation of PreregistrationAn Implementation of Preregistration
An Implementation of Preregistrationmboehme
 
On the Reliability of Coverage-based Fuzzer Benchmarking
On the Reliability of Coverage-based Fuzzer BenchmarkingOn the Reliability of Coverage-based Fuzzer Benchmarking
On the Reliability of Coverage-based Fuzzer Benchmarkingmboehme
 
Statistical Reasoning About Programs
Statistical Reasoning About ProgramsStatistical Reasoning About Programs
Statistical Reasoning About Programsmboehme
 
The Curious Case of Fuzzing for Automated Software Testing
The Curious Case of Fuzzing for Automated Software TestingThe Curious Case of Fuzzing for Automated Software Testing
The Curious Case of Fuzzing for Automated Software Testingmboehme
 
Foundations Of Software Testing
Foundations Of Software TestingFoundations Of Software Testing
Foundations Of Software Testingmboehme
 
DS3 Fuzzing Panel (M. Boehme)
DS3 Fuzzing Panel (M. Boehme)DS3 Fuzzing Panel (M. Boehme)
DS3 Fuzzing Panel (M. Boehme)mboehme
 
Fuzzing: On the Exponential Cost of Vulnerability Discovery
Fuzzing: On the Exponential Cost of Vulnerability DiscoveryFuzzing: On the Exponential Cost of Vulnerability Discovery
Fuzzing: On the Exponential Cost of Vulnerability Discoverymboehme
 
Boosting Fuzzer Efficiency: An Information Theoretic Perspective
Boosting Fuzzer Efficiency: An Information Theoretic PerspectiveBoosting Fuzzer Efficiency: An Information Theoretic Perspective
Boosting Fuzzer Efficiency: An Information Theoretic Perspectivemboehme
 
Fuzzing: Challenges and Reflections
Fuzzing: Challenges and ReflectionsFuzzing: Challenges and Reflections
Fuzzing: Challenges and Reflectionsmboehme
 
AFLGo: Directed Greybox Fuzzing
AFLGo: Directed Greybox FuzzingAFLGo: Directed Greybox Fuzzing
AFLGo: Directed Greybox Fuzzingmboehme
 
NUS SoC Graduate Outreach @ TU Dresden
NUS SoC Graduate Outreach @ TU DresdenNUS SoC Graduate Outreach @ TU Dresden
NUS SoC Graduate Outreach @ TU Dresdenmboehme
 

More from mboehme (11)

An Implementation of Preregistration
An Implementation of PreregistrationAn Implementation of Preregistration
An Implementation of Preregistration
 
On the Reliability of Coverage-based Fuzzer Benchmarking
On the Reliability of Coverage-based Fuzzer BenchmarkingOn the Reliability of Coverage-based Fuzzer Benchmarking
On the Reliability of Coverage-based Fuzzer Benchmarking
 
Statistical Reasoning About Programs
Statistical Reasoning About ProgramsStatistical Reasoning About Programs
Statistical Reasoning About Programs
 
The Curious Case of Fuzzing for Automated Software Testing
The Curious Case of Fuzzing for Automated Software TestingThe Curious Case of Fuzzing for Automated Software Testing
The Curious Case of Fuzzing for Automated Software Testing
 
Foundations Of Software Testing
Foundations Of Software TestingFoundations Of Software Testing
Foundations Of Software Testing
 
DS3 Fuzzing Panel (M. Boehme)
DS3 Fuzzing Panel (M. Boehme)DS3 Fuzzing Panel (M. Boehme)
DS3 Fuzzing Panel (M. Boehme)
 
Fuzzing: On the Exponential Cost of Vulnerability Discovery
Fuzzing: On the Exponential Cost of Vulnerability DiscoveryFuzzing: On the Exponential Cost of Vulnerability Discovery
Fuzzing: On the Exponential Cost of Vulnerability Discovery
 
Boosting Fuzzer Efficiency: An Information Theoretic Perspective
Boosting Fuzzer Efficiency: An Information Theoretic PerspectiveBoosting Fuzzer Efficiency: An Information Theoretic Perspective
Boosting Fuzzer Efficiency: An Information Theoretic Perspective
 
Fuzzing: Challenges and Reflections
Fuzzing: Challenges and ReflectionsFuzzing: Challenges and Reflections
Fuzzing: Challenges and Reflections
 
AFLGo: Directed Greybox Fuzzing
AFLGo: Directed Greybox FuzzingAFLGo: Directed Greybox Fuzzing
AFLGo: Directed Greybox Fuzzing
 
NUS SoC Graduate Outreach @ TU Dresden
NUS SoC Graduate Outreach @ TU DresdenNUS SoC Graduate Outreach @ TU Dresden
NUS SoC Graduate Outreach @ TU Dresden
 

Recently uploaded

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

On the Surprising Efficiency and Exponential Cost of Fuzzing

  • 1. On the Surprising E ffi ciency and 
 Exponential Cost of Fuzzing Marcel Böhme Software Security MPI-SP & Monash Keywords: Vulnerability Discovery, Automated Software Testing, E ff ectiveness, E ffi ciency, 
 Scalability, Guarantees
  • 2. • Fuzzing for Automatic Vulnerability Discovery • Making machines attack other machines. • Focus on scalability, e ffi ciency, and e ff ectiveness. • Foundations of Software Security • Assurances in Software Security • Fundamental limitations of existing approaches • Drawing from multiple disciplines (information theory, biostatistics) whoami 2
  • 3. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 4. Whitebox Fuzzing φ1 = (s0 != 'b') Path Conditions ✓ s1 != 'b' φ1 void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 5. Whitebox Fuzzing φ1 = (s0 != 'b') Path Conditions ✓ s1 != 'b' s1 == 'b' s2 != 'a' φ1 φ2 φ2 = (s0 == 'b') / (s1 != 'a') ✓ void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 6. Whitebox Fuzzing φ1 = (s0 != 'b') Path Conditions ✓ s1 != 'b' s1 == 'b' s2 == 'a' s2 != 'a' s3 != 'd' s3 == 'd' s4 != '!' s4 != '!' φ1 φ2 φ3 φ4 φ5 φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 7. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } φ1 = (s0 != 'b') Path Conditions ✓ φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ Whitebox Fuzzing: Most Effective!
  • 8. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } It can prove the absence of assertion violation, 
 by enumerating all paths and modulo some assumptions. φ1 = (s0 != 'b') Path Conditions ✓ φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ Whitebox Fuzzing: Most Effective! 2
  • 9. φ1 = (s0 != 'b') Path Conditions ✓ φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ Whitebox Fuzzing: Quite Efficient! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 10. φ1 = (s0 != 'b') Path Conditions ✓ φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ Whitebox Fuzzing: Quite Efficient! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } We only need 3 inputs to find the bug, on average, if we choose each path at random without replacement. Choose a random path from the multivariate hypergeometric (i.e., enumerate). Choose some input that exercises that path (by constraint solving).
  • 11. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: just random, really. For each parameter, choose 1 of 256 values 
 uniformly at random.
  • 12. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: just random, really. For each parameter, choose 1 of 256 values 
 uniformly at random. It can never prove the absence of assertion violation! https://www.cs.utexas.edu/users/EWD/ewd02xx/EWD249.PDF
  • 13. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: just random, really. For each parameter, choose 1 of 256 values 
 uniformly at random. It can never prove the absence of assertion violation! Well, that’s not entirely true. We can estimate a “residual risk”. [ESEC/FSE’21] Estimating Residual Risk in Greybox Fuzzing, M Böhme, D Liyanage, V Wüstholz [TOSEM’18] STADS: Software Testing as Species Discovery, M Böhme; ACM Trans. Softw. Eng. Meth.
  • 14. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: just random, really. For each parameter, choose 1 of 256 values 
 uniformly at random. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation.
  • 15. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: just random, really. For each parameter, choose 1 of 256 values 
 uniformly at random. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. So, whitebox fuzzing is better, right?
  • 16. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: just random, really. For each parameter, choose 1 of 256 values 
 uniformly at random. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. So, whitebox fuzzing is better, right? Wrong. At least not always.
  • 17.
  • 19. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: Super fast!
  • 20. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. If our whitebox fuzzer takes too long 
 per input, our blackbox fuzzer outperforms! » There is a maximum time per test input! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds. Blackbox Fuzzing: Super fast!
  • 21. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Blackbox Fuzzing: Super fast!
  • 22. • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. If our whitebox fuzzer takes too long 
 per input, our blackbox fuzzer outperforms! » There is a maximum time per test input! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds. Blackbox Fuzzing: Super fast!
  • 23. • Our model: Error-based partitioning • EITHER all inputs in a partition do reveal a bug
 OR all inputs in a partition do not reveal a bug Bounds on Fuzzing Efficiency The most effective testing technique samples from error-based partitions! — Weyuker and Jeng’91 [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 24. • Our model: Error-based partitioning • EITHER all inputs in a partition do reveal a bug
 OR all inputs in a partition do not reveal a bug • However, we have no a-priori knowledge whether a partition is error-revealing. • Partitions are of arbitrary size and number. Bounds on Fuzzing Efficiency The most effective testing technique samples from error-based partitions! — Weyuker and Jeng’91 [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 25. • Our model: Error-based partitioning • EITHER all inputs in a partition do reveal a bug
 OR all inputs in a partition do not reveal a bug. • A testing technique samples the program’s input space and 
 discovers a partition Di when Di is sampled for the fi rst time. • The discovery of Di shows whether or not Di reveals a bug. • Notice that we assume a test oracle. Bounds on Fuzzing Efficiency [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 26. • A testing technique achieves a degree of con fi dence x when at least x% of the program inputs reside in discovered partitions. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 27. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 28. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. • Blackbox Fuzzing (R) • Samples inputs randomly • Some partitions several times, others not at all • 1 time unit per input • Whitebox Fuzzing (S) • Samples inputs systematically • Each partition exactly once! • Most e ff ective! • c time units per input Bounds on Fuzzing Efficiency [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 29. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved
  • 30. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Whitebox Fuzzing Time Con fi dence Achieved Expected to achieve 100% in c·k time units S
  • 31. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved R Blackbox Fuzzing Expected to achieve 100% in ∞ time units S
  • 32. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R S
  • 33. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R S
  • 34. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R c=1 S
  • 35. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R S
  • 36. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R S
  • 37. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R Increasing c of S, increases time to achieve same degree of confidence! S
  • 38. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Time Con fi dence Achieved x R c0 S
  • 39. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. Bounds on Fuzzing Efficiency Blackbox Fuzzing wins — if the average time to sample one test input exceeds c0 Time Con fi dence Achieved x R c0 S
  • 40. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. • Bounds on Fuzzing Efficiency • Answer: S is expected to lose if c > time units. • Example: • R takes 1ms to sample one test input • Establish correctness for x=90% of inputs S0 must take less than 4.1ms to sample one test input Otherwise, R is expected to achieve the 90%-degree of con fi dence fi rst. imately as kpmaxe npmax ] pi)n by q(n). ces such that i 2 Imax we (17) (18) (19) nmax we have i Given a degree of confidence x, we compute the maximum cost c0 such that the expected time it takes for S0 to achieve x is at most the same as the expected time it takes R to achieve x and S0 remains more efficient than R. Proposition 1 Given a degree of confidence x : 1 e 1  x < 1, let ns and nr be the time at which S0 and R are expected to achieve x, respectively. For all programs P, the maximum cost c0 of S0, such that ns  nr, is bounded above as c0 . 1 ex ex2 Proof : Fix a program P which in turn fixes the number of partitions k and also the probabilities pi for all i : 1  i  k. Let cP 0 be the cost of S0, such that ns = nr for P. Now, setting fs(n) = |D|x yields n = xkcP 0 (25) Setting fr(n) = |D|x gives x ⇠ 1 k X pie npi (26) [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 41. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. • Bounds on Fuzzing Efficiency • Answer: S is expected to lose if c > time units. • Example: • R takes 1ms to sample one test input • Establish correctness for x=99.9% of inputs S0 must take less than 370ms to sample one test input Otherwise, R is expected to achieve the 99.9%-degree of con fi dence fi rst. imately as kpmaxe npmax ] pi)n by q(n). ces such that i 2 Imax we (17) (18) (19) nmax we have i Given a degree of confidence x, we compute the maximum cost c0 such that the expected time it takes for S0 to achieve x is at most the same as the expected time it takes R to achieve x and S0 remains more efficient than R. Proposition 1 Given a degree of confidence x : 1 e 1  x < 1, let ns and nr be the time at which S0 and R are expected to achieve x, respectively. For all programs P, the maximum cost c0 of S0, such that ns  nr, is bounded above as c0 . 1 ex ex2 Proof : Fix a program P which in turn fixes the number of partitions k and also the probabilities pi for all i : 1  i  k. Let cP 0 be the cost of S0, such that ns = nr for P. Now, setting fs(n) = |D|x yields n = xkcP 0 (25) Setting fr(n) = |D|x gives x ⇠ 1 k X pie npi (26) [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 42. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. • Bounds on Fuzzing Efficiency • Answer: S is expected to lose if c > time units. • Example: • R takes 1ms to sample one test input • Establish correctness for x=99.9% of inputs S0 must take less than 370ms to sample one test input Otherwise, R is expected to achieve the 99.9%-degree of con fi dence fi rst. imately as kpmaxe npmax ] pi)n by q(n). ces such that i 2 Imax we (17) (18) (19) nmax we have i Given a degree of confidence x, we compute the maximum cost c0 such that the expected time it takes for S0 to achieve x is at most the same as the expected time it takes R to achieve x and S0 remains more efficient than R. Proposition 1 Given a degree of confidence x : 1 e 1  x < 1, let ns and nr be the time at which S0 and R are expected to achieve x, respectively. For all programs P, the maximum cost c0 of S0, such that ns  nr, is bounded above as c0 . 1 ex ex2 Proof : Fix a program P which in turn fixes the number of partitions k and also the probabilities pi for all i : 1  i  k. Let cP 0 be the cost of S0, such that ns = nr for P. Now, setting fs(n) = |D|x yields n = xkcP 0 (25) Setting fr(n) = |D|x gives x ⇠ 1 k X pie npi (26) [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 43. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. • Bounds on Fuzzing Efficiency • Answer: S is expected to lose if c > time units. • Example: • R takes 1ms to sample one test input • Establish correctness for x=99.9% of inputs S0 must take less than 370ms to sample one test input Otherwise, R is expected to achieve the 99.9%-degree of con fi dence fi rst. For all programs imately as kpmaxe npmax ] pi)n by q(n). ces such that i 2 Imax we (17) (18) (19) nmax we have i Given a degree of confidence x, we compute the maximum cost c0 such that the expected time it takes for S0 to achieve x is at most the same as the expected time it takes R to achieve x and S0 remains more efficient than R. Proposition 1 Given a degree of confidence x : 1 e 1  x < 1, let ns and nr be the time at which S0 and R are expected to achieve x, respectively. For all programs P, the maximum cost c0 of S0, such that ns  nr, is bounded above as c0 . 1 ex ex2 Proof : Fix a program P which in turn fixes the number of partitions k and also the probabilities pi for all i : 1  i  k. Let cP 0 be the cost of S0, such that ns = nr for P. Now, setting fs(n) = |D|x yields n = xkcP 0 (25) Setting fr(n) = |D|x gives x ⇠ 1 k X pie npi (26) [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 44. • Achieving con fi dence: Whoever can show fi rst that the program works correctly for x% of its inputs wins. • Bounds on Fuzzing Efficiency • Answer: S is expected to lose if c > time units. • Example: • R takes 1ms to sample one test input • Establish correctness for x=99.9% of inputs S0 must take less than 370ms to sample one test input Otherwise, R is expected to achieve the 99.9%-degree of con fi dence fi rst. For all programs worst-case partitioning imately as kpmaxe npmax ] pi)n by q(n). ces such that i 2 Imax we (17) (18) (19) nmax we have i Given a degree of confidence x, we compute the maximum cost c0 such that the expected time it takes for S0 to achieve x is at most the same as the expected time it takes R to achieve x and S0 remains more efficient than R. Proposition 1 Given a degree of confidence x : 1 e 1  x < 1, let ns and nr be the time at which S0 and R are expected to achieve x, respectively. For all programs P, the maximum cost c0 of S0, such that ns  nr, is bounded above as c0 . 1 ex ex2 Proof : Fix a program P which in turn fixes the number of partitions k and also the probabilities pi for all i : 1  i  k. Let cP 0 be the cost of S0, such that ns = nr for P. Now, setting fs(n) = |D|x yields n = xkcP 0 (25) Setting fr(n) = |D|x gives x ⇠ 1 k X pie npi (26) [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 45. • Our insight: Even the most e ff ective fuzzing technique 
 is less e ffi cient than blackbox fuzzing if generating a test takes relatively too long. • We shed light on a 40 year old riddle and demonstrate a fundamental limitation of whitebox fuzzing. 
 (including grammar-based whitebox fuzzing) Bounds on Fuzzing Efficiency [FSE’14] On the E ffi ciency of Automated Testing, M Böhme, S. Paul, [TSE’15] A Probabilistic Analysis of the E ffi ciency of Automated Testing, M Böhme, S. Paul; IEEE Trans. Softw. Eng.
  • 46. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. So, if we have sufficiently many machines 
 (to maximize execs/sec), blackbox fuzzers are the best we can get, right? void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 47. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. So, if we have sufficiently many machines 
 (to maximize execs/sec), blackbox fuzzers are the best we can get, right? Wrong. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 48. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. Generational So, if we have sufficiently many machines 
 (to maximize execs/sec), blackbox fuzzers are the best we can get, right? Wrong. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 49. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. Generational • Mutational Blackbox Fuzzer mutates a random character in a seed. So, if we have sufficiently many machines 
 (to maximize execs/sec), blackbox fuzzers are the best we can get, right? Wrong. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 50. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. • Mutational Blackbox Fuzzer mutates a random character in a seed. • Started with the seed bad? • Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 51. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. • Mutational Blackbox Fuzzer mutates a random character in a seed. • Started with the seed bad? • Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 52. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. • Mutational Blackbox Fuzzer mutates a random character in a seed. • Started with the seed bad? • Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 53. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. • Mutational Blackbox Fuzzer mutates a random character in a seed. • Started with the seed bad? • Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 54. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. • Mutational Blackbox Fuzzer mutates a random character in a seed. • Started with the seed bad? • Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Alright, we cheated. We chose a good 
 seed to start with.
  • 55. Blackbox Fuzzing: Super fast! • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Generational Blackbox Fuzzer: Discovers the bug after 4 billion inputs, in expectation. • Mutational Blackbox Fuzzer mutates a random character in a seed. • Started with the seed bad? • Discovers the bug after ((4-1)*(2-8))-1 ≈ 1024 inputs, in expectation. void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } Alright, we cheated. We chose a good 
 seed to start with. What if we could automatically 
 discover this seed?
  • 56. Greybox Fuzzing: “Enumerate” [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 57. **** b*** (1✕ 4-1 ✕ 2-8)-1
 = 1024 **** 
 b*** ba** (1/2 ✕ 4-1 ✕ 2-8)-1
 = 2048 **** 
 b*** 
 ba** bad* (1/3 ✕ 4-1 ✕ 2-8)-1
 = 3072 **** 
 b*** 
 ba** 
 bad* bad! (1/4 ✕ 4-1 ✕ 2-8)-1
 = 4096 Total: 10240 Seed corpus Expected #inputs “Interesting”
 Input [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! Greybox Fuzzing: “Enumerate” void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 58. **** b*** (1✕ 4-1 ✕ 2-8)-1
 = 1024 **** 
 b*** ba** (1/2 ✕ 4-1 ✕ 2-8)-1
 = 2048 **** 
 b*** 
 ba** bad* (1/3 ✕ 4-1 ✕ 2-8)-1
 = 3072 **** 
 b*** 
 ba** 
 bad* bad! (1/4 ✕ 4-1 ✕ 2-8)-1
 = 4096 Total: 10240 [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! Greybox Fuzzing: “Enumerate” void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 59. [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! • Greybox Fuzzing started only with **** in 
 the seed corpus discovers the bug after
 10k inputs (in 150 microseconds)! **** b*** (1✕ 4-1 ✕ 2-8)-1
 = 1024 **** 
 b*** ba** (1/2 ✕ 4-1 ✕ 2-8)-1
 = 2048 **** 
 b*** 
 ba** bad* (1/3 ✕ 4-1 ✕ 2-8)-1
 = 3072 **** 
 b*** 
 ba** 
 bad* bad! (1/4 ✕ 4-1 ✕ 2-8)-1
 = 4096 Total: 10240 Greybox Fuzzing: “Enumerate” void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); }
  • 60. [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! • Greybox Fuzzing started only with **** in 
 the seed corpus discovers the bug after
 10k inputs (in 150 microseconds)! • Boosted Greybox Fuzzing started with **** 
 in the seed corpus discovers the bug after
 4k inputs (in 55 microseconds)! **** b*** (1✕ 4-1 ✕ 2-8)-1
 = 1024 **** 
 b*** ba** (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 **** 
 b*** 
 ba** bad* (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 **** 
 b*** 
 ba** 
 bad* bad! (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 Total: 4096 Greybox Fuzzing: “Enumerate”
  • 61. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. More Machines! Awesome! We have a really efficient fuzzers. Let’s throw more machines at the problem! On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds.
  • 62. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. More Machines! X times more machines means 
 X times more bugs, right? On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds.
  • 63. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. More Machines! X times more machines means 
 X times more bugs, right? Wrong. On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds.
  • 64. Scalability • 300+ OSS projects (OSSFuzz & Fuzzer-Test-Suite) • 6 measures of code coverage (4) and bug fi nding e ff ectiveness (2) • 4+ CPU years worth of fuzzing campaigns • 2 fuzzers (AFL and LibFuzzer) • Open Science and Reproducibility • Reproduce our results under other circumstances. • Inspect our data and simulation @ Kaggle (Jupyter Notebook). • Modify parameters in our simulation and analysis. [FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.
 M. Böhme, Brandon Falk (Microsoft)
  • 65. • #Machines • An abstraction of the #inputs the fuzzer can generate per minute. • Example: Twice the #machines can generate twice #inputs per minute. • We assume no synchronisation overhead. For greybox fuzzers, 
 new seeds immediately available to all fuzzers. • We use this de fi nition for data scaling. [FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.
 M. Böhme, Brandon Falk (Microsoft) Scalability
  • 66. • Fuzzer Test Suite (45min campaigns) 23
  • 67. Number of Additional Vulns Discovered

  • 68. Number of Additional Vulns Discovered

  • 69. Probability to Discover Given Vulnerability
 Given the same non-deterministic fuzzer, 
 discovering linearly more new species 
 within the same time budget, requires 
 exponentially more inputs per minute.
  • 70. Probability to Discover Given Vulnerability

  • 71. Probability to Discover Given Vulnerability

  • 72. Probability to Discover Given Vulnerability

  • 73. Inflection Point Inflection Point Probability to Discover Given Vulnerability

  • 74. Inflection Point Inflection Point Between origin and inflection point, 
 an exponential curve grows slower 
 than discovery probability! Probability to Discover Given Vulnerability

  • 75. • What does that mean for a non-deterministic fuzzer? Probability to Discover Given Vulnerability
 [FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.
 M. Böhme, Brandon Falk (Microsoft)
  • 76. • What does that mean for a non-deterministic fuzzer? • The probability of exposing a speci fi c known vulnerability, • the probability of reaching a speci fi c program statement, • the probability of violating a speci fi c program assertion, etc. • within a given time budget increases approximately linearly with the number of available machines — up to a certain limit. Probability to Discover Given Vulnerability
 [FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.
 M. Böhme, Brandon Falk (Microsoft)
  • 77. • What does that mean for a non-deterministic fuzzer? • The probability of exposing all (known) vulnerabilities, • the probability of reaching all program statements, • the probability of violating all program assertions, etc. • within a given time budget increases approximately linearly with the number of available machines — up to a certain limit. Probability to Discover Given Vulnerability
 [FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.
 M. Böhme, Brandon Falk (Microsoft)
  • 78. Explaining to Exponential Cost
 Figure 10. Number of additional species discovered in a fi xed time budget 
 as the number of machines increases (5 random samples of each.
  • 79. Figure 10. Number of additional species discovered in a fi xed time budget 
 as the number of machines increases (5 random samples of each. Explaining to Exponential Cost

  • 80. Figure 10. Number of additional species discovered in a fi xed time budget 
 as the number of machines increases (5 random samples of each. Explaining to Exponential Cost

  • 81. Figure 10. Number of additional species discovered in a fi xed time budget 
 as the number of machines increases (5 random samples of each. Explaining to Exponential Cost

  • 82. Figure 10. Number of additional species discovered in a fi xed time budget 
 as the number of machines increases (5 random samples of each. Explaining to Exponential Cost

  • 83. Intuitively, each new vulnerability requires 
 some more resources (time or machines) 
 than the previous vulnerability. Explaining to Exponential Cost

  • 84. On the Cost of Vulnerability Discovery A constant rate of vulnerability discovery 
 requires exponential amount of resources. *This is a fundamental limitation of fuzzing! 26 [FSE’20] Fuzzing: On the Exponential Cost of Vulnerability Discovery.
 M. Böhme, Brandon Falk (Microsoft) Nominated for ACM Distinguished Paper Award
  • 85. Wrap up slide 26 void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } It can prove the absence of assertion violation, by enumerating all paths and modulo some assumptions. φ1 = (s0 != 'b') Path Conditions ✓ φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ Whitebox Fuzzing: Most Effective! 2 • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. If our whitebox fuzzer takes too long per input, our blackbox fuzzer outperforms! » There is a maximum time per test input! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds. Blackbox Fuzzing: Super fast! [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! • Greybox Fuzzing started only with **** in 
 the seed corpus discovers the bug after
 10k inputs (in 150 microseconds)! • Boosted Greybox Fuzzing started with **** 
 in the seed corpus discovers the bug after
 4k inputs (in 55 microseconds)! **** b*** (1✕ 4-1 ✕ 2-8)-1
 = 1024 **** b*** ba** (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 **** b*** ba** bad* (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 **** b*** ba** bad* bad! (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 Total: 4096 Greybox Fuzzing: “Enumerate” Figure 10. Number of additional species discovered in a fixed time budget 
 as the number of machines increases (5 random samples of each. Exponential Cost of Vulnerability Discovery

  • 86. Wrap up slide 26 void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } It can prove the absence of assertion violation, by enumerating all paths and modulo some assumptions. φ1 = (s0 != 'b') Path Conditions ✓ φ2 = (s0 == 'b') / (s1 != 'a') φ3 = (s0 == 'b') / (s1 == 'a') / (s2 != 'd') φ4 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 != '!') φ5 = (s0 == 'b') / (s1 == 'a') / (s2 == 'd') / (s3 == '!') ✓ ✓ ✓ ✗ Whitebox Fuzzing: Most Effective! 2 • Whitebox Fuzzer: Discovers the bug after 3 inputs, in expectation. • Blackbox Fuzzer: Discovers the bug after ((1/256)4)-1 ≈ 4 billion inputs, in expectation. If our whitebox fuzzer takes too long per input, our blackbox fuzzer outperforms! » There is a maximum time per test input! void crashme (char s0, char s1, char s2, char s3) { int crash = 0; if (s0 == 'b') if (s1 == 'a') if (s2 == 'd') if (s3 == ‘!’) crash = 1; if(crash == 1) abort(); } On 100 machines, it takes 63 milliseconds. On my machine, this takes 6.3 seconds. Blackbox Fuzzing: Super fast! [CCS’16] Coverage-based Greybox Fuzzing as Markov Chain 
 M Böhme, V.T. Pham, A. Roychoudhury (extended in IEEE TSE journal) • Greybox Fuzzing: Add generated inputs 
 to the corpus which increase coverage! • Greybox Fuzzing started only with **** in 
 the seed corpus discovers the bug after
 10k inputs (in 150 microseconds)! • Boosted Greybox Fuzzing started with **** 
 in the seed corpus discovers the bug after
 4k inputs (in 55 microseconds)! **** b*** (1✕ 4-1 ✕ 2-8)-1
 = 1024 **** b*** ba** (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 **** b*** ba** bad* (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 **** b*** ba** bad* bad! (1 ✕ 4-1 ✕ 2-8)-1
 = 1024 Total: 4096 Greybox Fuzzing: “Enumerate” Figure 10. Number of additional species discovered in a fixed time budget 
 as the number of machines increases (5 random samples of each. Exponential Cost of Vulnerability Discovery
 If you want to take a deeper dive: * Read our interactive text book: The Fuzzing Book * Read our IEEE Software article: “Fuzzing: Challenges and Re fl ections” * Apply for PhD / PostDoc in my group at MPI-SP, Bochum, Germany. Web: https://mboehme.github.com Twitter: @mboehme_