[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHEMK6AHY0TRK077QPBHPC":3,"skill-same:01M7CHEMK6AHY0TRK077QPBHPC":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7CHEMK6AHY0TRK077QPBHPC","ruzzy",null,"Sets up and runs Ruzzy, Trail of Bits' coverage-guided Ruby fuzzer and the only production-ready one for the language. Covers harness structure, fuzzing pure Ruby and the native C extensions in gems, and sanitizer builds. Use when fuzzing a Ruby library or gem, testing a Ruby C extension for memory safety, or asking how to fuzz Ruby at all.","bongkage\u002Ftrailofbits-skills","bongkage","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F101378796?v=4","01M7CH419QTJ16DNJ33P0WCWBE","01M7CH41A9NWK8D2JBRK9F0M2C",1,"CC-BY-SA-4.0","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftesting-handbook-skills\u002Fskills\u002Fruzzy\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ruzzy\ntype: fuzzer\ndescription: \"Sets up and runs Ruzzy, Trail of Bits' coverage-guided Ruby fuzzer and the only production-ready one for the language. Covers harness structure, fuzzing pure Ruby and the native C extensions in gems, and sanitizer builds. Use when fuzzing a Ruby library or gem, testing a Ruby C extension for memory safety, or asking how to fuzz Ruby at all.\"\n---\n\n# Ruzzy\n\nRuzzy is a coverage-guided fuzzer for Ruby built on libFuzzer. It enables fuzzing both pure Ruby code and Ruby C extensions with sanitizer support for detecting memory corruption and undefined behavior.\n\n## When to Use\n\nRuzzy is currently the only production-ready coverage-guided fuzzer for Ruby.\n\n**Choose Ruzzy when:**\n- Fuzzing Ruby applications or libraries\n- Testing Ruby C extensions for memory safety issues\n- You need coverage-guided fuzzing for Ruby code\n- Working with Ruby gems that have native extensions\n\n## Quick Start\n\nSet up environment:\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\n```\n\nTest with the included toy example:\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby -e 'require \"ruzzy\"; Ruzzy.dummy'\n```\n\nThis should quickly find a crash demonstrating that Ruzzy is working correctly.\n\n## Installation\n\n### Platform Support\n\nRuzzy supports Linux x86-64 and AArch64\u002FARM64. For macOS or Windows, use the [Dockerfile](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy\u002Fblob\u002Fmain\u002FDockerfile) or [development environment](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy#developing).\n\n### Prerequisites\n\n- Linux x86-64 or AArch64\u002FARM64\n- Recent version of clang (tested back to 14.0.0, latest release recommended)\n- Ruby with gem installed\n\n### Installation Command\n\nInstall Ruzzy with clang compiler flags:\n\n```bash\nMAKE=\"make --environment-overrides V=1\" \\\nCC=\"\u002Fpath\u002Fto\u002Fclang\" \\\nCXX=\"\u002Fpath\u002Fto\u002Fclang++\" \\\nLDSHARED=\"\u002Fpath\u002Fto\u002Fclang -shared\" \\\nLDSHAREDXX=\"\u002Fpath\u002Fto\u002Fclang++ -shared\" \\\n    gem install ruzzy\n```\n\n**Environment variables explained:**\n- `MAKE`: Overrides make to respect subsequent environment variables\n- `CC`, `CXX`, `LDSHARED`, `LDSHAREDXX`: Ensure proper clang binaries are used for latest features\n\n### Troubleshooting Installation\n\nIf installation fails, enable debug output:\n\n```bash\nRUZZY_DEBUG=1 gem install --verbose ruzzy\n```\n\n### Verification\n\nVerify installation by running the toy example (see Quick Start section).\n\n## Writing a Harness\n\n### Fuzzing Pure Ruby Code\n\nPure Ruby fuzzing requires two scripts due to Ruby interpreter implementation details.\n\n**Tracer script (`test_tracer.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\n\nRuzzy.trace('test_harness.rb')\n```\n\n**Harness script (`test_harness.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\n\ndef fuzzing_target(input)\n  # Your code to fuzz here\n  if input.length == 4\n    if input[0] == 'F'\n      if input[1] == 'U'\n        if input[2] == 'Z'\n          if input[3] == 'Z'\n            raise\n          end\n        end\n      end\n    end\n  end\nend\n\ntest_one_input = lambda do |data|\n  fuzzing_target(data)\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\nRun with:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby test_tracer.rb\n```\n\n### Fuzzing Ruby C Extensions\n\nC extensions can be fuzzed with a single harness file, no tracer needed.\n\n**Example harness for msgpack (`fuzz_msgpack.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'msgpack'\nrequire 'ruzzy'\n\ntest_one_input = lambda do |data|\n  begin\n    MessagePack.unpack(data)\n  rescue Exception\n    # We're looking for memory corruption, not Ruby exceptions\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\nRun with:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby fuzz_msgpack.rb\n```\n\n### Harness Rules\n\n| Do | Don't |\n|----|-------|\n| Catch Ruby exceptions if testing C extensions | Let Ruby exceptions crash the fuzzer |\n| Return 0 from test_one_input lambda | Return other values |\n| Keep harness deterministic | Use randomness or time-based logic |\n| Use tracer script for pure Ruby | Skip tracer for pure Ruby code |\n\n> **See Also:** For detailed harness writing techniques, patterns for handling complex inputs,\n> and advanced strategies, see the **fuzz-harness-writing** technique skill.\n\n## Compilation\n\n### Installing Gems with Sanitizers\n\nWhen installing Ruby gems with C extensions for fuzzing, compile with sanitizer flags:\n\n```bash\nMAKE=\"make --environment-overrides V=1\" \\\nCC=\"\u002Fpath\u002Fto\u002Fclang\" \\\nCXX=\"\u002Fpath\u002Fto\u002Fclang++\" \\\nLDSHARED=\"\u002Fpath\u002Fto\u002Fclang -shared\" \\\nLDSHAREDXX=\"\u002Fpath\u002Fto\u002Fclang++ -shared\" \\\nCFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\nCXXFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\n    gem install \u003Cgem-name>\n```\n\n### Build Flags\n\n| Flag | Purpose |\n|------|---------|\n| `-fsanitize=address,fuzzer-no-link` | Enable AddressSanitizer and fuzzer instrumentation |\n| `-fno-omit-frame-pointer` | Improve stack trace quality |\n| `-fno-common` | Better compatibility with sanitizers |\n| `-fPIC` | Position-independent code for shared libraries |\n| `-g` | Include debug symbols |\n\n## Running Campaigns\n\n### Environment Setup\n\nBefore running any fuzzing campaign, set ASAN_OPTIONS:\n\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\n```\n\n**Options explained:**\n1. `allocator_may_return_null=1`: Skip common low-impact allocation failures (DoS)\n2. `detect_leaks=0`: Ruby interpreter leaks data, ignore these for now\n3. `use_sigaltstack=0`: Ruby recommends disabling sigaltstack with ASan\n\n### Basic Run\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb\n```\n\n**Note:** `LD_PRELOAD` is required for sanitizer injection. Unlike `ASAN_OPTIONS`, do not export it as it may interfere with other programs.\n\n### With Corpus\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb \u002Fpath\u002Fto\u002Fcorpus\n```\n\n### Passing libFuzzer Options\n\nAll libFuzzer options can be passed as arguments:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb \u002Fpath\u002Fto\u002Fcorpus -max_len=1024 -timeout=10\n```\n\nSee [libFuzzer options](https:\u002F\u002Fllvm.org\u002Fdocs\u002FLibFuzzer.html#options) for full reference.\n\n### Reproducing Crashes\n\nRe-run a crash case by passing the crash file:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb .\u002Fcrash-253420c1158bc6382093d409ce2e9cff5806e980\n```\n\n### Interpreting Output\n\n| Output | Meaning |\n|--------|---------|\n| `INFO: Running with entropic power schedule` | Fuzzing campaign started |\n| `ERROR: AddressSanitizer: heap-use-after-free` | Memory corruption detected |\n| `SUMMARY: libFuzzer: fuzz target exited` | Ruby exception occurred |\n| `artifact_prefix='.\u002F'; Test unit written to .\u002Fcrash-*` | Crash input saved |\n| `Base64: ...` | Base64 encoding of crash input |\n\n## Sanitizer Integration\n\n### AddressSanitizer (ASan)\n\nRuzzy includes a pre-compiled AddressSanitizer library:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb\n```\n\nUse ASan for detecting:\n- Heap buffer overflows\n- Stack buffer overflows\n- Use-after-free\n- Double-free\n- Memory leaks (disabled by default in Ruzzy)\n\n### UndefinedBehaviorSanitizer (UBSan)\n\nRuzzy also includes UBSan:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::UBSAN_PATH') \\\n    ruby harness.rb\n```\n\nUse UBSan for detecting:\n- Signed integer overflow\n- Null pointer dereferences\n- Misaligned memory access\n- Division by zero\n\n### Common Sanitizer Issues\n\n| Issue | Solution |\n|-------|----------|\n| Ruby interpreter leak warnings | Use `ASAN_OPTIONS=detect_leaks=0` |\n| Sigaltstack conflicts | Use `ASAN_OPTIONS=use_sigaltstack=0` |\n| Allocation failure spam | Use `ASAN_OPTIONS=allocator_may_return_null=1` |\n| LD_PRELOAD interferes with tools | Don't export it; set inline with ruby command |\n\n> **See Also:** For detailed sanitizer configuration, common issues, and advanced flags,\n> see the **address-sanitizer** and **undefined-behavior-sanitizer** technique skills.\n\n## Real-World Examples\n\n### Example: msgpack-ruby\n\nFuzzing the msgpack MessagePack parser for memory corruption.\n\n**Install with sanitizers:**\n\n```bash\nMAKE=\"make --environment-overrides V=1\" \\\nCC=\"\u002Fpath\u002Fto\u002Fclang\" \\\nCXX=\"\u002Fpath\u002Fto\u002Fclang++\" \\\nLDSHARED=\"\u002Fpath\u002Fto\u002Fclang -shared\" \\\nLDSHAREDXX=\"\u002Fpath\u002Fto\u002Fclang++ -shared\" \\\nCFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\nCXXFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\n    gem install msgpack\n```\n\n**Harness (`fuzz_msgpack.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'msgpack'\nrequire 'ruzzy'\n\ntest_one_input = lambda do |data|\n  begin\n    MessagePack.unpack(data)\n  rescue Exception\n    # We're looking for memory corruption, not Ruby exceptions\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\n**Run:**\n\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby fuzz_msgpack.rb\n```\n\n### Example: Pure Ruby Target\n\nFuzzing pure Ruby code with a custom parser.\n\n**Tracer (`test_tracer.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\n\nRuzzy.trace('test_harness.rb')\n```\n\n**Harness (`test_harness.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\nrequire_relative 'my_parser'\n\ntest_one_input = lambda do |data|\n  begin\n    MyParser.parse(data)\n  rescue StandardError\n    # Expected exceptions from malformed input\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\n**Run:**\n\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby test_tracer.rb\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| Installation fails | Wrong clang version or path | Verify clang path, use clang 14.0.0+ |\n| `cannot open shared object file` | LD_PRELOAD not set | Set LD_PRELOAD inline with ruby command |\n| Fuzzer immediately exits | Missing corpus directory | Create corpus directory or pass as argument |\n| No coverage progress | Pure Ruby needs tracer | Use tracer script for pure Ruby code |\n| Leak detection spam | Ruby interpreter leaks | Set `ASAN_OPTIONS=detect_leaks=0` |\n| Installation debug needed | Compilation errors | Use `RUZZY_DEBUG=1 gem install --verbose ruzzy` |\n\n## Related Skills\n\n### Technique Skills\n\n| Skill | Use Case |\n|-------|----------|\n| **fuzz-harness-writing** | Detailed guidance on writing effective harnesses |\n| **address-sanitizer** | Memory error detection during fuzzing |\n| **undefined-behavior-sanitizer** | Detecting undefined behavior in C extensions |\n| **libfuzzer** | Understanding libFuzzer options (Ruzzy is built on libFuzzer) |\n\n### Related Fuzzers\n\n| Skill | When to Consider |\n|-------|------------------|\n| **libfuzzer** | When fuzzing Ruby C extension code directly in C\u002FC++ |\n| **aflpp** | Alternative approach for fuzzing Ruby by instrumenting Ruby interpreter |\n\n## Resources\n\n### Key External Resources\n\n**[Introducing Ruzzy, a coverage-guided Ruby fuzzer](https:\u002F\u002Fblog.trailofbits.com\u002F2024\u002F03\u002F29\u002Fintroducing-ruzzy-a-coverage-guided-ruby-fuzzer\u002F)**\nOfficial Trail of Bits blog post announcing Ruzzy, covering motivation, architecture, and initial results.\n\n**[Ruzzy GitHub Repository](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy)**\nSource code, additional examples, and development instructions.\n\n**[libFuzzer Documentation](https:\u002F\u002Fllvm.org\u002Fdocs\u002FLibFuzzer.html)**\nSince Ruzzy is built on libFuzzer, understanding libFuzzer options and behavior is valuable.\n\n**[Fuzzing Ruby C extensions](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy#fuzzing-ruby-c-extensions)**\nDetailed guide on fuzzing C extensions with compilation flags and examples.\n\n**[Fuzzing pure Ruby code](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy#fuzzing-pure-ruby-code)**\nDetailed guide on the tracer pattern required for pure Ruby fuzzing.\n","# Ruzzy\n\nRuzzy is a coverage-guided fuzzer for Ruby built on libFuzzer. It enables fuzzing both pure Ruby code and Ruby C extensions with sanitizer support for detecting memory corruption and undefined behavior.\n\n## When to Use\n\nRuzzy is currently the only production-ready coverage-guided fuzzer for Ruby.\n\n**Choose Ruzzy when:**\n- Fuzzing Ruby applications or libraries\n- Testing Ruby C extensions for memory safety issues\n- You need coverage-guided fuzzing for Ruby code\n- Working with Ruby gems that have native extensions\n\n## Quick Start\n\nSet up environment:\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\n```\n\nTest with the included toy example:\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby -e 'require \"ruzzy\"; Ruzzy.dummy'\n```\n\nThis should quickly find a crash demonstrating that Ruzzy is working correctly.\n\n## Installation\n\n### Platform Support\n\nRuzzy supports Linux x86-64 and AArch64\u002FARM64. For macOS or Windows, use the [Dockerfile](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy\u002Fblob\u002Fmain\u002FDockerfile) or [development environment](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy#developing).\n\n### Prerequisites\n\n- Linux x86-64 or AArch64\u002FARM64\n- Recent version of clang (tested back to 14.0.0, latest release recommended)\n- Ruby with gem installed\n\n### Installation Command\n\nInstall Ruzzy with clang compiler flags:\n\n```bash\nMAKE=\"make --environment-overrides V=1\" \\\nCC=\"\u002Fpath\u002Fto\u002Fclang\" \\\nCXX=\"\u002Fpath\u002Fto\u002Fclang++\" \\\nLDSHARED=\"\u002Fpath\u002Fto\u002Fclang -shared\" \\\nLDSHAREDXX=\"\u002Fpath\u002Fto\u002Fclang++ -shared\" \\\n    gem install ruzzy\n```\n\n**Environment variables explained:**\n- `MAKE`: Overrides make to respect subsequent environment variables\n- `CC`, `CXX`, `LDSHARED`, `LDSHAREDXX`: Ensure proper clang binaries are used for latest features\n\n### Troubleshooting Installation\n\nIf installation fails, enable debug output:\n\n```bash\nRUZZY_DEBUG=1 gem install --verbose ruzzy\n```\n\n### Verification\n\nVerify installation by running the toy example (see Quick Start section).\n\n## Writing a Harness\n\n### Fuzzing Pure Ruby Code\n\nPure Ruby fuzzing requires two scripts due to Ruby interpreter implementation details.\n\n**Tracer script (`test_tracer.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\n\nRuzzy.trace('test_harness.rb')\n```\n\n**Harness script (`test_harness.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\n\ndef fuzzing_target(input)\n  # Your code to fuzz here\n  if input.length == 4\n    if input[0] == 'F'\n      if input[1] == 'U'\n        if input[2] == 'Z'\n          if input[3] == 'Z'\n            raise\n          end\n        end\n      end\n    end\n  end\nend\n\ntest_one_input = lambda do |data|\n  fuzzing_target(data)\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\nRun with:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby test_tracer.rb\n```\n\n### Fuzzing Ruby C Extensions\n\nC extensions can be fuzzed with a single harness file, no tracer needed.\n\n**Example harness for msgpack (`fuzz_msgpack.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'msgpack'\nrequire 'ruzzy'\n\ntest_one_input = lambda do |data|\n  begin\n    MessagePack.unpack(data)\n  rescue Exception\n    # We're looking for memory corruption, not Ruby exceptions\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\nRun with:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby fuzz_msgpack.rb\n```\n\n### Harness Rules\n\n| Do | Don't |\n|----|-------|\n| Catch Ruby exceptions if testing C extensions | Let Ruby exceptions crash the fuzzer |\n| Return 0 from test_one_input lambda | Return other values |\n| Keep harness deterministic | Use randomness or time-based logic |\n| Use tracer script for pure Ruby | Skip tracer for pure Ruby code |\n\n> **See Also:** For detailed harness writing techniques, patterns for handling complex inputs,\n> and advanced strategies, see the **fuzz-harness-writing** technique skill.\n\n## Compilation\n\n### Installing Gems with Sanitizers\n\nWhen installing Ruby gems with C extensions for fuzzing, compile with sanitizer flags:\n\n```bash\nMAKE=\"make --environment-overrides V=1\" \\\nCC=\"\u002Fpath\u002Fto\u002Fclang\" \\\nCXX=\"\u002Fpath\u002Fto\u002Fclang++\" \\\nLDSHARED=\"\u002Fpath\u002Fto\u002Fclang -shared\" \\\nLDSHAREDXX=\"\u002Fpath\u002Fto\u002Fclang++ -shared\" \\\nCFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\nCXXFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\n    gem install \u003Cgem-name>\n```\n\n### Build Flags\n\n| Flag | Purpose |\n|------|---------|\n| `-fsanitize=address,fuzzer-no-link` | Enable AddressSanitizer and fuzzer instrumentation |\n| `-fno-omit-frame-pointer` | Improve stack trace quality |\n| `-fno-common` | Better compatibility with sanitizers |\n| `-fPIC` | Position-independent code for shared libraries |\n| `-g` | Include debug symbols |\n\n## Running Campaigns\n\n### Environment Setup\n\nBefore running any fuzzing campaign, set ASAN_OPTIONS:\n\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\n```\n\n**Options explained:**\n1. `allocator_may_return_null=1`: Skip common low-impact allocation failures (DoS)\n2. `detect_leaks=0`: Ruby interpreter leaks data, ignore these for now\n3. `use_sigaltstack=0`: Ruby recommends disabling sigaltstack with ASan\n\n### Basic Run\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb\n```\n\n**Note:** `LD_PRELOAD` is required for sanitizer injection. Unlike `ASAN_OPTIONS`, do not export it as it may interfere with other programs.\n\n### With Corpus\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb \u002Fpath\u002Fto\u002Fcorpus\n```\n\n### Passing libFuzzer Options\n\nAll libFuzzer options can be passed as arguments:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb \u002Fpath\u002Fto\u002Fcorpus -max_len=1024 -timeout=10\n```\n\nSee [libFuzzer options](https:\u002F\u002Fllvm.org\u002Fdocs\u002FLibFuzzer.html#options) for full reference.\n\n### Reproducing Crashes\n\nRe-run a crash case by passing the crash file:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb .\u002Fcrash-253420c1158bc6382093d409ce2e9cff5806e980\n```\n\n### Interpreting Output\n\n| Output | Meaning |\n|--------|---------|\n| `INFO: Running with entropic power schedule` | Fuzzing campaign started |\n| `ERROR: AddressSanitizer: heap-use-after-free` | Memory corruption detected |\n| `SUMMARY: libFuzzer: fuzz target exited` | Ruby exception occurred |\n| `artifact_prefix='.\u002F'; Test unit written to .\u002Fcrash-*` | Crash input saved |\n| `Base64: ...` | Base64 encoding of crash input |\n\n## Sanitizer Integration\n\n### AddressSanitizer (ASan)\n\nRuzzy includes a pre-compiled AddressSanitizer library:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby harness.rb\n```\n\nUse ASan for detecting:\n- Heap buffer overflows\n- Stack buffer overflows\n- Use-after-free\n- Double-free\n- Memory leaks (disabled by default in Ruzzy)\n\n### UndefinedBehaviorSanitizer (UBSan)\n\nRuzzy also includes UBSan:\n\n```bash\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::UBSAN_PATH') \\\n    ruby harness.rb\n```\n\nUse UBSan for detecting:\n- Signed integer overflow\n- Null pointer dereferences\n- Misaligned memory access\n- Division by zero\n\n### Common Sanitizer Issues\n\n| Issue | Solution |\n|-------|----------|\n| Ruby interpreter leak warnings | Use `ASAN_OPTIONS=detect_leaks=0` |\n| Sigaltstack conflicts | Use `ASAN_OPTIONS=use_sigaltstack=0` |\n| Allocation failure spam | Use `ASAN_OPTIONS=allocator_may_return_null=1` |\n| LD_PRELOAD interferes with tools | Don't export it; set inline with ruby command |\n\n> **See Also:** For detailed sanitizer configuration, common issues, and advanced flags,\n> see the **address-sanitizer** and **undefined-behavior-sanitizer** technique skills.\n\n## Real-World Examples\n\n### Example: msgpack-ruby\n\nFuzzing the msgpack MessagePack parser for memory corruption.\n\n**Install with sanitizers:**\n\n```bash\nMAKE=\"make --environment-overrides V=1\" \\\nCC=\"\u002Fpath\u002Fto\u002Fclang\" \\\nCXX=\"\u002Fpath\u002Fto\u002Fclang++\" \\\nLDSHARED=\"\u002Fpath\u002Fto\u002Fclang -shared\" \\\nLDSHAREDXX=\"\u002Fpath\u002Fto\u002Fclang++ -shared\" \\\nCFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\nCXXFLAGS=\"-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\" \\\n    gem install msgpack\n```\n\n**Harness (`fuzz_msgpack.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'msgpack'\nrequire 'ruzzy'\n\ntest_one_input = lambda do |data|\n  begin\n    MessagePack.unpack(data)\n  rescue Exception\n    # We're looking for memory corruption, not Ruby exceptions\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\n**Run:**\n\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby fuzz_msgpack.rb\n```\n\n### Example: Pure Ruby Target\n\nFuzzing pure Ruby code with a custom parser.\n\n**Tracer (`test_tracer.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\n\nRuzzy.trace('test_harness.rb')\n```\n\n**Harness (`test_harness.rb`):**\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'ruzzy'\nrequire_relative 'my_parser'\n\ntest_one_input = lambda do |data|\n  begin\n    MyParser.parse(data)\n  rescue StandardError\n    # Expected exceptions from malformed input\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n```\n\n**Run:**\n\n```bash\nexport ASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\"\nLD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n    ruby test_tracer.rb\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| Installation fails | Wrong clang version or path | Verify clang path, use clang 14.0.0+ |\n| `cannot open shared object file` | LD_PRELOAD not set | Set LD_PRELOAD inline with ruby command |\n| Fuzzer immediately exits | Missing corpus directory | Create corpus directory or pass as argument |\n| No coverage progress | Pure Ruby needs tracer | Use tracer script for pure Ruby code |\n| Leak detection spam | Ruby interpreter leaks | Set `ASAN_OPTIONS=detect_leaks=0` |\n| Installation debug needed | Compilation errors | Use `RUZZY_DEBUG=1 gem install --verbose ruzzy` |\n\n## Related Skills\n\n### Technique Skills\n\n| Skill | Use Case |\n|-------|----------|\n| **fuzz-harness-writing** | Detailed guidance on writing effective harnesses |\n| **address-sanitizer** | Memory error detection during fuzzing |\n| **undefined-behavior-sanitizer** | Detecting undefined behavior in C extensions |\n| **libfuzzer** | Understanding libFuzzer options (Ruzzy is built on libFuzzer) |\n\n### Related Fuzzers\n\n| Skill | When to Consider |\n|-------|------------------|\n| **libfuzzer** | When fuzzing Ruby C extension code directly in C\u002FC++ |\n| **aflpp** | Alternative approach for fuzzing Ruby by instrumenting Ruby interpreter |\n\n## Resources\n\n### Key External Resources\n\n**[Introducing Ruzzy, a coverage-guided Ruby fuzzer](https:\u002F\u002Fblog.trailofbits.com\u002F2024\u002F03\u002F29\u002Fintroducing-ruzzy-a-coverage-guided-ruby-fuzzer\u002F)**\nOfficial Trail of Bits blog post announcing Ruzzy, covering motivation, architecture, and initial results.\n\n**[Ruzzy GitHub Repository](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy)**\nSource code, additional examples, and development instructions.\n\n**[libFuzzer Documentation](https:\u002F\u002Fllvm.org\u002Fdocs\u002FLibFuzzer.html)**\nSince Ruzzy is built on libFuzzer, understanding libFuzzer options and behavior is valuable.\n\n**[Fuzzing Ruby C extensions](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy#fuzzing-ruby-c-extensions)**\nDetailed guide on fuzzing C extensions with compilation flags and examples.\n\n**[Fuzzing pure Ruby code](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fruzzy#fuzzing-pure-ruby-code)**\nDetailed guide on the tracer pattern required for pure Ruby fuzzing.\n",{"name":5,"type":23,"description":7},"fuzzer","main","321ccfe628eca0d314b0ee4eaffcdd8a05639aaf","plugins\u002Ftesting-handbook-skills\u002Fskills\u002Fruzzy",0,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills","https:\u002F\u002Fgithub.com\u002Fbongkage","2026-11-06 12:15:06",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add bongkage\u002Ftrailofbits-skills --skill ruzzy",{"tool":37,"command":38},"bunx","bunx skills add bongkage\u002Ftrailofbits-skills --skill ruzzy",{"tool":40,"command":41},"pnpm","pnpm dlx skills add bongkage\u002Ftrailofbits-skills --skill ruzzy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftesting-handbook-skills\u002Fskills\u002Fruzzy\u002FSKILL.md",true,[45,51],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",128,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftesting-handbook-skills\u002Fskills\u002Fruzzy\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"assets\u002Ftrail-of-bits-mark.svg","ASSET","资产文件",3084,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftesting-handbook-skills\u002Fskills\u002Fruzzy\u002Fassets\u002Ftrail-of-bits-mark.svg",[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7CHJAESZRWKJXFQG55BMNAA","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fzeroize-audit\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7CHJ543G42A9GQC3PJE4F4V","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fyara-authoring\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7CHHYVFS1AKDTH3YDS1Y4K4","writing-lean-proofs","Writes and reviews structured Lean 4 proofs and designs Lean libraries following Mathlib conventions. Use when proving theorems in Lean, formalizing mathematics or specifications in Lean 4, defining new types or definitions in a Lean library, reviewing Lean proofs for readability and maintainability, refactoring long tactic proofs into lemmas, filling in sorry placeholders in a Lean development, setting up CI or linters for a Lean project, diagnosing slow proofs or maxHeartbeats timeouts, or writing custom tactics, macros, or linters.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fwriting-lean-proofs\u002Fskills\u002Fwriting-lean-proofs\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7CHHQXA39M4965MV2RMM5YS","vulnerability-triage-brocards","This skill should be used when the user asks to \"triage a vulnerability report\", \"assess a CVE\", \"evaluate a bug bounty submission\", \"decide if a finding is valid\", \"review a security finding\", \"dismiss a vulnerability\", \"should we fix this CVE\", \"prioritize a vulnerability report\", or needs to determine whether an incoming vulnerability report warrants investigation. Applies 7 brocards (rules of thumb) to systematically accept, dismiss, or request more information on vulnerability reports, or needs to filter raw findings from agentic vulnerability discovery pipelines before human review.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvulnerability-triage-brocards\u002Fskills\u002Fvulnerability-triage-brocards\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M7CHHJVQC2ZG2M310GXT0T42","variant-analysis","Hunts for the other instances of a bug already found — the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form (\"are there others like this?\", \"is this the same bug?\"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvariant-analysis\u002Fskills\u002Fvariant-analysis\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M7CHHC1GM5GH585ZWGP7D03P","vector-forge","Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before\u002Fafter mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving test vector coverage for crypto primitives.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fvector-forge\u002FSKILL.md",[],[]]