Course contentsShow
← Security
Lesson 1393 of 3,05228. Application Security - TestingFree lesson

Corpus Management and Minimization

Learn strategies for building, maintaining, and minimizing fuzzing corpora to maximize coverage efficiency.

Corpus Management and Minimization

You'll learn how to efficiently manage fuzzing input collections to maximize code coverage while minimizing redundancy and resource costs.

What Is a Fuzzing Corpus?

A fuzzing corpus is the collection of input files or test cases your fuzzer uses to explore different code paths. Think of it like a library of example inputs—some cause your program to take path A, others path B, and so on. As coverage-guided fuzzers run, they discover new inputs that trigger previously unexplored code, constantly expanding this collection.

The Problem: Corpus Bloat

Without management, a corpus grows uncontrollably. You might end up with thousands of inputs that all exercise the same code paths—just slightly different variations. This wastes disk space, slows down fuzzer startup (which must process the entire corpus), and provides diminishing returns.

Corpus Minimization Strategies

Size Reduction: Remove inputs that don't add unique coverage. If two files trigger identical code paths, keep only one (typically the smaller).

Input Minimization: For each test case, reduce its size while preserving the unique coverage it provides. A 10KB file might be shrunk to 100 bytes if the extra data doesn't affect which code executes.

Periodic Cleanup: Regularly merge and minimize your corpus as it grows, discarding redundant entries.

Building an Effective Corpus

Start with seed inputs: valid examples of your expected input format. These help the fuzzer understand structure rather than starting from random bytes. Add edge cases manually: empty inputs, maximum values, special characters.

As the fuzzer runs, it discovers new coverage and adds interesting inputs automatically. Your job is to periodically minimize this growing collection.

Key Takeaway: Effective corpus management maintains only unique coverage-adding inputs in their smallest form, dramatically improving fuzzer efficiency and reducing resource consumption.