nim-fuzzing

Build and run libFuzzer fuzzing harnesses for Nim targets.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/planetis-m/skills_experiment --skill nim-fuzzing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nim-fuzzing
Source: https://github.com/planetis-m/skills_experiment/tree/main/original_skills/nim-fuzzing
Command: npx skills add https://github.com/planetis-m/skills_experiment --skill nim-fuzzing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you reliably test Nim code against unexpected, malformed, or adversarial byte inputs by wiring your code to libFuzzer and turning failures into actionable crash artifacts.

Core Features & Use Cases

  • libFuzzer harness wiring: Builds the required Nim initialize() and testOneInput() procs so fuzz inputs reach your parsing or protocol/format handler.
  • Correct mutation integration: Supports raw byte-to-typed extraction patterns and optional structure-aware customMutator / customCrossOver to improve discovery for structured formats.
  • End-to-end crash triage: Reproduces crashes in standalone mode, minimizes failing inputs, isolates with ASan/UBSan, and guides how to classify findings.

Use case: When adding a parser for a custom binary protocol, use this Skill to catch out-of-bounds reads, integer overflows, and assertion failures by fuzzing the handler with a seed corpus and iterating on harness and mutators.

Quick Start

Use the nim-fuzzing skill to create a libFuzzer-enabled Nim harness that exposes the required initialize and testOneInput exports for your untrusted input entry point.

Frequently Asked Questions about nim-fuzzing

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

FAQPage Schema
How do I fuzz Nim code with libFuzzer?

Fuzzing Nim code with libFuzzer requires building a harness that exports `initialize` and `testOneInput` procs, converting raw byte inputs into typed data for your parser or protocol handler to process.

What is crash triage in fuzz testing and how does it work?

Crash triage in fuzz testing reproduces failures in standalone mode, minimizes failing inputs, isolates bugs with ASan or UBSan, and guides classification of findings into actionable crash artifacts.

How do I handle exceptions safely when writing a libFuzzer harness in Nim?

You handle exceptions safely in a Nim libFuzzer harness by enforcing `raises: []` on your fuzz target procs, ensuring uncaught exceptions do not terminate the fuzzer unexpectedly during corpus-driven execution.

Can I use custom mutators for structured format fuzzing in Nim?

Yes, you can use custom mutators for structured format fuzzing in Nim by implementing `customMutator` and `customCrossOver` functions to generate structure-aware inputs and improve bug discovery.

Does libFuzzer work with Nim for fuzzing binary protocol handlers?

libFuzzer works with Nim for fuzzing binary protocol handlers by wiring byte inputs through a harness that correctly converts `ptr UncheckedArray[byte]` plus length into typed data, catching out-of-bounds reads and integer overflows.

Why do I need a seed corpus for fuzz testing parsers?

A seed corpus provides initial valid byte inputs for fuzz testing parsers, allowing the fuzzer to mutate existing structures and reach deeper code paths more efficiently during corpus-driven execution.