libfuzzer-sys

Rust bindings to LLVM's libFuzzer for coverage-guided fuzz testing

Library
Cargo
v0.4.13
267 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
41 /100 Fair
Development Activity 12
Maintenance 0
Community 72
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
70 /100 Good
Architecture 76
Code Quality 74
Innovation 70
Learning Curve 60

libfuzzer-sys is a barebones Rust wrapper around LLVM’s libFuzzer runtime, vendoring the libFuzzer C++ sources directly and building them via a build.rs script using the cc crate. Its main export is the fuzz_target! macro, which lets you define a fuzz entry point that libFuzzer’s coverage-guided engine repeatedly calls with generated inputs.

It is the engine underneath cargo fuzz, the recommended tool for fuzzing Rust code, and can also be used manually by wiring a binary crate’s main.rs to a fuzz_target! call and building with sanitizer-coverage flags. Because libFuzzer relies on LLVM sanitizer instrumentation, the crate currently only works on Linux (and other platforms with equivalent LLVM sanitizer support).

What You Get

  • The fuzz_target! macro for declaring a fuzz entry point that closes over your own crate’s code
  • Vendored libFuzzer C++ runtime sources, compiled and linked automatically via build.rs and the cc crate
  • A Corpus enum for signaling whether a given input should be kept in or rejected from the fuzzing corpus
  • Optional arbitrary/arbitrary-derive integration for generating structured fuzz inputs instead of raw bytes
  • Support for linking a custom/prebuilt libFuzzer runtime via CUSTOM_LIBFUZZER_PATH for advanced setups

Common Use Cases

  • Powering cargo fuzz targets to coverage-fuzz parsers, codecs, and other input-handling Rust code
  • Fuzzing security-sensitive code paths (deserializers, protocol parsers) as part of a CI fuzzing pipeline
  • Structured fuzzing of typed inputs via the arbitrary crate integration instead of raw byte slices
  • Regression testing by replaying libFuzzer-discovered crash inputs as unit test cases

Under The Hood

Architecture - The crate has two halves: the vendored libfuzzer/ directory containing libFuzzer’s C++ sources (extracted from LLVM’s compiler-rt via git filter-branch and refreshed through update-libfuzzer.sh), and the Rust surface in src/lib.rs, which exposes the fuzz_target! macro and a Corpus enum for signaling keep/reject decisions. build.rs compiles the vendored C++ sources with the cc crate and links them into the final binary, or links a user-supplied prebuilt libFuzzer via the CUSTOM_LIBFUZZER_PATH environment variable — keeping the C++ toolchain concern isolated from the Rust API.

Tech Stack - Primarily C++ by byte count (the vendored libFuzzer runtime) with a thin Rust (edition = 2018) surface, built via build.rs + the cc crate rather than CMake (explicitly excluded from the crate package). Depends on arbitrary for structured input generation and dual-licenses under MIT OR Apache-2.0 for the Rust code, with the vendored libFuzzer directory under NCSA license as reflected in Cargo.toml’s composite license field.

Code Quality - The crate enforces #![deny(missing_docs, missing_debug_implementations)] at the crate root, meaning every public item must be documented and implement Debug — a stricter-than-default bar for a systems-level crate. Five example fuzz-target workspace members (example, example_arbitrary, example_crossover, example_init, example_mutator) double as both documentation and integration tests exercising different macro forms. A CHANGELOG.md is maintained per release.

API Design - The fuzz_target!(|data: &[u8]| { ... }) macro reduces the ceremony of wiring up libFuzzer’s C entry point to a single closure, and the crate is the de facto dependency cargo fuzz generates for new fuzz targets, so most users never interact with it directly beyond the macro. The main friction point is platform restriction to Linux (due to LLVM sanitizer support) and the need for a nightly-ish toolchain with sanitizer coverage flags for manual (non-cargo-fuzz) usage.

Used by 6 apps in this directory

Go
32%
Apache 2.0

CubeSandbox

AI Agents · Developer Tools · Security

12,728

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
82
Repo Health
88
Technical
63
Dependency
Built with
Go 32%
Rust 26%
C 22%
Updated 1 weeks ago
Rust
96%
Apache 2.0

InfluxDB

Analytics · Databases

31,758

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
82
Repo Health
76
Technical
72
Dependency
Built with
Rust 96%
Updated 1 weeks ago
Rust
100%
Other

Meilisearch

Search

59,424

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust 100%
Updated 1 weeks ago
Rust
72%
MIT

monty

AI Development · Developer Tools

8,362

Run LLM-generated Python code safely inside your agent—no containers, no CPython, no compromise—with sub-microsecond startup.

View details
87
Repo Health
83
Technical
73
Dependency
Built with
Rust 72%
Python 23%
Updated 6 days ago
Go
47%
GPL 3.0

Netdata

Devops · Monitoring

80,675

Real-time per-second metrics, ML-powered anomaly detection, and zero-config observability for any infrastructure.

View details
93
Repo Health
86
Technical
70
Dependency
Built with
Go 47%
C 30%
Rust 14%
Updated 6 days ago
Rust
95%
Apache 2.0

RustFS

File Storage

33,997

A Rust-native, S3-compatible distributed object storage system built for AI, data lake, and big data workloads, licensed under Apache 2.0 with no AGPL restrictions.

View details
88
Repo Health
83
Technical
78
Dependency
Built with
Rust 95%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers