Bug bounty programs in Cybersecurity - Time & Space Complexity
When analyzing bug bounty programs, it is important to understand how the time spent finding bugs grows as the scope of the program increases.
We want to know how the effort changes when more targets or vulnerabilities are involved.
Analyze the time complexity of the following simplified bug scanning process.
for each target in program:
for each vulnerability type:
scan target for vulnerability
if vulnerability found:
report bug
This code scans each target for every type of vulnerability and reports bugs found.
Identify the loops that repeat scanning steps.
- Primary operation: Scanning each target for each vulnerability type.
- How many times: Number of targets multiplied by number of vulnerability types.
As the number of targets or vulnerability types grows, the total scans increase by multiplying these numbers.
| Input Size (targets x vulnerability types) | Approx. Operations |
|---|---|
| 10 x 5 | 50 scans |
| 100 x 5 | 500 scans |
| 1000 x 5 | 5000 scans |
Pattern observation: Doubling targets doubles total scans; adding more vulnerability types also increases scans proportionally.
Time Complexity: O(n * m)
This means the time grows proportionally to the number of targets (n) times the number of vulnerability types (m).
[X] Wrong: "The time to find bugs grows only with the number of targets."
[OK] Correct: The number of vulnerability types also affects the total scanning time, so both factors multiply the effort.
Understanding how scanning effort grows helps you explain how to manage bug bounty programs efficiently and prioritize testing.
"What if the scanning process could check multiple vulnerability types at once? How would the time complexity change?"