harness-writing

Installation
Summary

Techniques for writing effective fuzzing harnesses across languages and frameworks.

  • Covers harness fundamentals for C/C++, Rust, Go, and Python, including entry point signatures, input validation, and structured data extraction using FuzzedDataProvider and arbitrary crate
  • Includes step-by-step guidance from identifying entry points through testing and iteration, with practical patterns for integer casting, complex inputs, and interleaved fuzzing of multiple operations
  • Provides tool-specific harness implementations for libFuzzer, AFL++, cargo-fuzz, and go-fuzz, with compilation flags and running instructions
  • Details anti-patterns to avoid (global state, blocking I/O, memory leaks, calling exit), determinism requirements, and troubleshooting strategies for low coverage or non-reproducible crashes
SKILL.md

Writing Fuzzing Harnesses

A fuzzing harness is the entrypoint function that receives random data from the fuzzer and routes it to your system under test (SUT). The quality of your harness directly determines which code paths get exercised and whether critical bugs are found. A poorly written harness can miss entire subsystems or produce non-reproducible crashes.

Overview

The harness is the bridge between the fuzzer's random byte generation and your application's API. It must parse raw bytes into meaningful inputs, call target functions, and handle edge cases gracefully. The most important part of any fuzzing setup is the harness—if written poorly, critical parts of your application may not be covered.

Key Concepts

Concept Description
Harness Function that receives fuzzer input and calls target code under test
SUT System Under Test—the code being fuzzed
Entry point Function signature required by the fuzzer (e.g., LLVMFuzzerTestOneInput)
FuzzedDataProvider Helper class for structured extraction of typed data from raw bytes
Determinism Property that ensures same input always produces same behavior
Interleaved fuzzing Single harness that exercises multiple operations based on input
Related skills
Installs
2.3K
GitHub Stars
5.1K
First Seen
Jan 19, 2026