Principle:0sec labs 0 Harness Reproduction
| Knowledge Sources | |
|---|---|
| Domains | Source_Code_Review, Harness_Generation, Fuzzing |
| Last Updated | 2026-10-30 00:00 GMT |
Overview
Technique for generating and executing multi-tier C/C++ harnesses that reproduce source-code review findings through libFuzzer, multi-component linking, and QEMU sanitizer validation.
Description
Harness reproduction is the principle that a vulnerability found during source code review should be provable by executing it. Three tiers of increasing fidelity: Tier-1 (single-function libFuzzer harness — the default), Tier-2 (multi-component linker harness that links the suspect function with its dependencies), and Tier-3 (Tier-2 build plus QEMU sanitizer validation with ASan/UBSan/MSan). The harness targets a suspect function, resolves the build system (autotools, cmake, meson, auto), and emits a C harness file plus linker fragment. Tier-3 confirms the crash under instrumentation, providing strong evidence that the finding is real.
Usage
Use this principle when a source code review system needs to confirm C/C++ memory safety findings by reproducing them with generated harnesses. The tier system trades off speed (Tier-1 is fast) against fidelity (Tier-3 is definitive).
Theoretical Basis
The three-tier hierarchy:
# Abstract model (NOT real implementation)
# Tier 1: single-function libFuzzer
harness = emit_libfuzzer_harness(function, header)
build_and_run(harness, libfuzzer=True)
# Tier 2: multi-component linker
harness = emit_linker_harness(function, header, build_system)
link_with_dependencies(harness, repo)
run(harness)
# Tier 3: Tier-2 + QEMU sanitizer
build_with_sanitizers(harness, asan=True, ubsan=True)
run_under_qemu(harness, kernel, disk) # confirms crash under instrumentation
Tier-1 covers single-function bugs (buffer overflow in a parser). Tier-2 handles functions that call into other components (needs linking). Tier-3 provides definitive confirmation under memory sanitizers in a QEMU-isolated environment.