Skip to content

stratum-mining/stratum-fuzzing-corpus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stratum V2 Reference Implementation Fuzzing Corpus

License

This repository contains the fuzzing corpus for the Stratum V2 Reference Implementation (SRI), a next-generation Bitcoin mining protocol implementation.

📋 Overview

This corpus is used for continuous fuzz testing of the Stratum V2 protocol implementation to discover edge cases, parsing vulnerabilities, and potential security issues. The corpus contains inputs that have been discovered during fuzzing campaigns and represent interesting test cases for protocol message parsing and handling.

🎯 Purpose

The corpus serves multiple purposes:

  • Regression Testing: Ensures that previously discovered edge cases continue to be handled correctly
  • Fuzzing Seed Corpus: Provides high-quality starting inputs for fuzzing campaigns
  • Documentation: Demonstrates real-world protocol message patterns and edge cases
  • Community Collaboration: Allows the community to contribute interesting test cases

Each directory contains binary files representing inputs that exercise different code paths in the respective fuzz targets.

🚀 Using This Corpus

With cargo-fuzz

To use this corpus with the Stratum repository:

  1. Clone both repositories:
git clone https://github.com/stratum-mining/stratum.git
git clone https://github.com/stratum-mining/stratum-fuzzing-corpus.git
  1. Copy or link the corpus into the stratum fuzz directory:
cd stratum
cp -r ../stratum-fuzzing-corpus/* fuzz/corpus/
# Or create a symlink:
# ln -s ../../stratum-fuzzing-corpus/* fuzz/corpus/
  1. Run fuzzing with the corpus (e.g.: deserialize_sv2frame target)
cd stratum
cargo +nightly fuzz run deserialize_sv2frame

Continuous Fuzzing

For 24/7 fuzzing operations, the corpus provides a solid foundation:

# Run with multiple jobs using all CPU cores
cargo +nightly fuzz run deserialize_sv2frame -- \
  -max_total_time=0 \
  -jobs=$(nproc) \
  -workers=$(nproc)

🤝 Contributing

We welcome contributions to expand and improve the fuzzing corpus!

Adding New Corpus Entries

If you discover interesting test cases during fuzzing:

  1. Fork this repository
  2. Add your corpus files to the appropriate fuzz target directory
  3. Ensure files are minimal (run cargo fuzz cmin <target_name> to minimize)
  4. Submit a pull request with a description of what makes the input interesting

Guidelines

  • Minimize inputs: Use cargo fuzz cmin <target_name> to reduce corpus bloat
  • Binary format: Corpus files should be raw binary inputs
  • Privacy: Ensure corpus files don't contain sensitive information

🔍 Corpus Maintenance

The corpus is periodically minimized and deduplicated to:

  • Keep repository size manageable
  • Maintain high-quality, diverse inputs

🐛 Found a Bug?

If the corpus reveals a bug in the Stratum implementation:

  1. Do not include the crashing input directly in this repository
  2. Report the issue to stratum-mining/stratum
  3. Follow responsible disclosure practices
  4. After the bug is fixed, the input can be added to the corpus

🔗 Related Resources

💬 Community

Join the Stratum V2 community:

📄 License

This corpus is released under the same license as the Stratum V2 Reference Implementation:

Licensed under either of:

at your option.

🙏 Acknowledgments

This fuzzing corpus is maintained by the Stratum V2 community with support from contributors who run continuous fuzzing infrastructure and discover valuable test cases.


Note: This is an evolving corpus. Inputs are added as fuzzing campaigns discover new interesting cases. The corpus aims for quality over quantity, prioritizing inputs that maximize code coverage and edge case discovery.

About

Fuzzing Corpus of https://github.com/stratum-mining/stratum

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages