libfuzzer

Automate coverage-guided fuzzing of C/C++ code with libFuzzer and Clang.

19.0k|5.6k|Updated Jul 9, 2024
One-click install
npx skills add https://github.com/elizaOS/eliza --skill libfuzzer-elizaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: libfuzzer
Source: https://github.com/elizaOS/eliza/tree/main/packages/skills/skills/testing-handbook-skills/skills/libfuzzer
Command: npx skills add https://github.com/elizaOS/eliza --skill libfuzzer-elizaos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers find bugs and security vulnerabilities in C/C++ code by automatically generating diverse inputs to test program behavior.

Core Features & Use Cases

  • Coverage-guided fuzzing: Efficiently explores code paths using LLVM's instrumentation.
  • Integration with Clang: Seamlessly works with the LLVM toolchain for C/C++ projects.
  • Use Case: A developer can use this Skill to fuzz a parsing library for a custom network protocol, automatically discovering malformed packet inputs that could lead to crashes or security exploits.

Quick Start

Use the libfuzzer skill to fuzz the provided C++ code located at '/path/to/your/code.cc' with the compiler flag '-fsanitize=fuzzer'.

Frequently Asked Questions about libfuzzer

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

FAQPage Schema
How do I find bugs and security vulnerabilities in C/C++ code?

You can find bugs in C/C++ code by using coverage-guided fuzzing with libFuzzer, which automatically generates diverse inputs to test program behavior and detect crashes. It leverages LLVM's instrumentation to efficiently explore code paths.

How do I set up a fuzzing campaign for a C++ project compiled with Clang?

To set up a fuzzing campaign for a C++ project, compile your code with Clang using the '-fsanitize=fuzzer' flag. This integrates libFuzzer directly and enables coverage-guided fuzzing to automatically discover malformed inputs.

How does coverage-guided fuzzing work with LLVM?

Coverage-guided fuzzing uses LLVM's instrumentation to monitor which code paths are executed during testing. It then prioritizes generating new inputs that explore untested paths, significantly enhancing bug detection efficiency in C/C++ projects.

Can I use this to fuzz a custom network protocol parsing library?

Yes, you can fuzz a parsing library for a custom network protocol. The automated fuzzing process will discover malformed packet inputs that could trigger crashes or expose security vulnerabilities in your C/C++ parsing logic.

What do I need to manage when fuzzing C/C++ projects with libFuzzer?

When fuzzing C/C++ projects, you need to manage fuzzing harnesses, input corpora, and dictionaries. Proper corpus management and dictionary usage help guide the fuzzer toward generating valid yet complex inputs to maximize code coverage.