Algorithm Search⌘K

Conceptresearch

Exponential cost of vulnerability discovery

Also called Bohme-Falk law.

An empirical law of fuzzing, measured in campaigns and explained by a species model, that each new bug found in a fixed time takes exponentially more machines.

The exponential cost of vulnerability discovery is an empirical law of fuzz testing, stated by Böhme and Falk (2020): with the same fuzzer and the same time budget, finding linearly more bugs takes exponentially more machines. If a campaign on one machine finds some bugs in a day, each further bug found in that day may need about twice the machines of the one before, as in the paper's own example. The same holds for coverage: each further branch costs exponentially more. The law is the reverse for what is already known: with twice the machines, the fuzzer finds the same bugs in about half the time. The law is a measurement, not a theorem. Böhme and Falk derived it from more than four CPU years of campaigns on almost three hundred open source programs, and they explain it with the species model of STADS, in which most program behaviors are rare. The explanation depends on how the probabilities of the behaviors are spread, and the paper names cases where the law does not hold.

In plain words

Think of a fuzzer as a machine that draws random tickets, where each kind of bug is a prize. A few prizes are common, and many are very rare, each rarer than the one before. Doubling the number of machines doubles the tickets drawn in a day. That is enough to find the next rarest prize, but only that one. To find one more prize, you double again. So each extra bug costs as much as all the machines before it.

For a prize you have already found, more tickets help directly: twice the tickets per hour find it in half the time.

This is why repeating old results is cheap and finding new bugs is expensive. It also means that an attacker with many more machines than you finds only a few bugs that you missed.

The idea

The setting. A machine is an abstraction for inputs per minute: 2x2^x machines generate 2x2^x times as many inputs in the same time, with no cost for synchronization and with every new seed shared at once. Böhme and Falk simulated more machines by dividing the time stamps of real campaigns by 2x2^x. Real parallel fuzzing has overhead, so the measured cost is a lower bound on the real cost.

The three laws (measurements). For a non-deterministic fuzzer, the paper states:

  1. A fuzzer that generates exponentially more inputs per minute discovers only linearly more new species in the same time, or fewer. Species here are known vulnerabilities, crashing campaigns, LibFuzzer features and edges, and AFL seeds and map coverage.
  2. It discovers the same number of species exponentially faster.
  3. The probability to discover a given species in the time budget at first grows exponentially with the exponent xx, until the discovery is expected; then the growth slows and the probability tends to 1.

The species model (explanation). A blackbox fuzzer samples inputs with replacement, and input nn belongs to species ii with probability pip_i, fixed over the campaign. The expected number of species found after nn inputs is

S(n)=∑i=1S(1−(1−pi)n).S(n) = \sum_{i=1}^{S} \bigl(1 - (1 - p_i)^n\bigr).

Let q=(1−p)nq = (1 - p)^n be the probability that one machine misses a given species in the budget. With 2x2^x machines the species is found with probability Q(x)=1−q2xQ(x) = 1 - q^{2^x}. This curve has its inflection point at x0=log⁡2(−1/ln⁡q)x_0 = \log_2(-1/\ln q), where Q(x0)=1−e−1Q(x_0) = 1 - e^{-1}: before that point the probability is near 0 and grows fast, after it the probability is near 1. So each species switches from "not found" to "found" over a narrow range of xx. If the species are spread over many orders of magnitude of abundance, about the same number of them switch for each doubling, and S(2xn)S(2^x n) grows linearly in xx. The inflection point is a theorem of the model; that real species follow such a spread is the empirical part.

Where the explanation stops. The model is for a blackbox fuzzer with fixed probabilities; for greybox fuzzers it is an explanation by analogy, which the measurements support. The paper calls the law empirical because it rests on the spread of the abundances, and names two cases where it fails: when all species are equally likely, and when there is only one species. The simulations, the authors note, are an explanation and not a proof.

Examples

Geometric abundances. Take 60 species with pi=2−ip_i = 2^{-i} for i=1i = 1 to 59 and p60=2−59p_{60} = 2^{-59}, so that the probabilities sum to 1, and a budget of n=1000n = 1000 inputs per machine. The expected number of species found is

machines 1 2 4 8 16 32 1024
expected species S(1000⋅m)S(1000 \cdot m) 10.299 11.299 12.299 13.299 14.299 15.299 20.299

Each doubling adds one species, to three decimals. Species ii is expected to be found after about 2i2^i inputs, so doubling the inputs moves the frontier by one species. Measured as the least number of machines whose expectation exceeds the one-machine value by kk, the cost for k=1,2,3,4,5k = 1, 2, 3, 4, 5 more species is 3, 5, 9, 17 and 33 machines.

Equal abundances. Take 40 species, each with p=1/40p = 1/40, and 100 inputs per machine. One machine expects 36.819 species, two expect 39.747, four 39.998, and eight 40.000. A few machines find everything, and no more machines can add anything: the number of species does not grow linearly in the exponent. This is the coupon collector setting, one of the cases where the law fails. A scratch script computed both tables from the formula for S(n)S(n).

The measured campaigns. In the paper's figures, the additional species found against log⁡2\log_2 of the machines fit a straight line with R2R^2 above 97 percent for most LibFuzzer benchmarks. For AFL on six programs, three of the six grew linearly in seeds and the others grew more slowly, which is an even higher cost. These are measurements on the paper's benchmarks and settings.

Where it is used

  • Planning resources. The law says that adding machines to a mature campaign that finds no new bugs is a poor way to find more. A different fuzzer, new seeds, a better harness or a different target changes the species and their probabilities; more of the same only moves the frontier slowly.
  • Reasoning about attackers. A defender who has fuzzed a program with many machines can expect an attacker with the same fuzzer and a few times more machines to find only a few bugs the defender missed. The paper gives this argument as a consequence of the law, not as a guarantee.
  • Evaluating fuzzers. Campaigns are random and their results grow slowly with time, so a short or single run says little. Comparisons need repeated trials and a time budget fixed in advance, as Klees et al. (2018) recommend.
  • Estimation during a campaign. The same species model gives the Good-Turing estimate of the chance of a new discovery and the Chao1 estimate of the number of species, which tell how close a campaign is to its frontier.
  • Heavy-tailed data elsewhere. Many counts in software and language are heavy tailed, as in Zipf's law; where they are, sampling finds new types only slowly.

References

  1. Marcel Böhme and Brandon Falk, Fuzzing, on the exponential cost of vulnerability discovery, Proceedings of ESEC/FSE 2020, pp. 713 to 724, Section 2 (the benchmarks, the fuzzers and the scaling of time stamps), Section 3 (the three empirical laws) and Section 4 (the species model, the inflection point and the simulation with power-law abundances)
  2. Marcel Böhme, STADS, software testing as species discovery, ACM Transactions on Software Engineering and Methodology 27(2), Article 7, 2018, pp. 1 to 52, the multinomial model of fuzzing as sampling species with replacement
  3. George Klees, Andrew Ruef, Benji Cooper, Shiyi Wei and Michael Hicks, Evaluating fuzz testing, Proceedings of CCS 2018, pp. 2123 to 2138, why the results of fuzzing campaigns are random and must be compared over repeated trials

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/6W73R7/text.yaml