libfuzzer

Automate coverage-guided fuzz testing for C and C++ programs with libFuzzer.

Updated May 2, 2026
One-click install
npx skills add https://github.com/ayehiaa/my-travel-assistant --skill libfuzzer-ayehiaa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: libfuzzer
Source: https://github.com/ayehiaa/my-travel-assistant/tree/main/.agents/skills/libfuzzer
Command: npx skills add https://github.com/ayehiaa/my-travel-assistant --skill libfuzzer-ayehiaa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you uncover crashes and memory-safety bugs in C/C++ code by continuously generating inputs that maximize code coverage and reproduce failures with minimal effort.

Core Features & Use Cases

  • Coverage-guided fuzzing for C/C++: Uses LLVM’s in-process libFuzzer workflow to drive exploration of your target code.
  • Harness authoring & input modeling: Teaches how to implement LLVMFuzzerTestOneInput, validate inputs, and use FuzzedDataProvider for structured extraction.
  • Production-ready fuzzing setup: Covers compiling with -fsanitize=fuzzer and optionally combining with ASan/UBSan, plus corpus/dictionary management to improve reach and speed.
  • Use Case: When you suspect a parsing library (e.g., a custom file format parser) has edge-case bugs, you can build a harness, seed a corpus, and run long campaigns to reliably discover crashes and generate minimal repro inputs.

Quick Start

Use libfuzzer to fuzz your C/C++ harness and target by running a command like: "clang++ -fsanitize=fuzzer,address -g -O2 -U_FORTIFY_SOURCE harness.cc target.cc -o fuzz && mkdir corpus && ./fuzz corpus/".

Frequently Asked Questions about libfuzzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I start coverage-guided fuzzing for a C++ parser?

You can start coverage-guided fuzzing by compiling your C++ code with -fsanitize=fuzzer,address, creating a harness with LLVMFuzzerTestOneInput, and executing the binary against a corpus directory.

What is a fuzzing harness and how does FuzzedDataProvider work?

A fuzzing harness uses LLVMFuzzerTestOneInput to feed data into target code, while FuzzedDataProvider extracts structured data from raw input to model valid API calls and test edge cases.

Can I use AddressSanitizer with libFuzzer to find memory bugs?

Yes, you can compile with AddressSanitizer and UBSan by adding the -fsanitize=address,undefined flags alongside -fsanitize=fuzzer to detect memory-safety defects and undefined behavior.

How do I manage a fuzzing corpus and dictionary to improve coverage?

Corpus and dictionary management involves seeding the corpus directory with valid input samples and providing a dictionary file to help the fuzzer generate inputs that reach deeper parsing code paths.

What is the best way to reproduce a crash found during fuzzing?

The best way to reproduce a crash is to re-execute the fuzzer binary with the specific crash artifact file generated during the campaign, passing it directly as a command-line argument to the harness.

Does libFuzzer support multi-core execution for long fuzzing campaigns?

Yes, libFuzzer supports multi-core execution to parallelize long fuzzing campaigns, allowing you to maximize code coverage and surface crashes faster across available CPU cores.