Skip to content

feat: Attestation Fuzz Harness + Crash Regression Corpus — Bounty #475#1960

Merged
Scottcjn merged 2 commits intoScottcjn:mainfrom
LaphoqueRC:feat/attestation-fuzz-harness-475
Mar 29, 2026
Merged

feat: Attestation Fuzz Harness + Crash Regression Corpus — Bounty #475#1960
Scottcjn merged 2 commits intoScottcjn:mainfrom
LaphoqueRC:feat/attestation-fuzz-harness-475

Conversation

@LaphoqueRC
Copy link
Copy Markdown
Contributor

Attestation Fuzz Harness — Bounty #475

Deliverables

  • Hypothesis-based fuzzer targeting attestation validation
  • 9 regression corpus files covering edge cases
  • CI runner script for continuous fuzzing

Closes #475

RTC Wallet: RTC2fe3c33c77666ff76a1cd0999fd4466ee81250ff

B1tor added 2 commits March 28, 2026 06:49
6 findings: 1 Critical, 2 High, 2 Medium, 1 Low

- RC-01 CRITICAL: Testnet mode always-accept (X402_TESTNET defaults to '1')
- RC-02 HIGH: Payment header bypass (presence check, no verification)
- RC-03 HIGH: Payment replay attack (no tx deduplication)
- RC-04 MEDIUM: Admin key timing attack (use hmac.compare_digest)
- RC-05 MEDIUM: Hardcoded admin key default in fleet_immune_system.py
- RC-06 LOW: Wildcard CORS on payment endpoints

Includes executable PoC: security/x402-poc/test_x402_vulns.py

Auditor: @B1tor
RTC Wallet: RTC2fe3c33c77666ff76a1cd0999fd4466ee81250ff
Add property-based fuzz testing harness for the /attest/submit validator
pipeline using Hypothesis.

## What's included

- tests/fuzz/attestation_validators.py  — Validators extracted verbatim
  from node/rustchain_v2_integrated_v2.2.1_rip200.py; no Flask dependency
- tests/fuzz/attestation_fuzz_harness.py — 17 Hypothesis test functions,
  10,500+ generated cases, 8 crash classes, seeded for determinism
- tests/fuzz/regression_corpus/ — 9 JSON fixtures (8 known crash classes +
  1 bug report for OverflowError in _attest_positive_int)
- tests/fuzz/run_fuzz.py — CI runner; exits non-zero on any regression
- tests/fuzz/README.md — Usage, CI integration, coverage table

## Bug found by harness

_attest_positive_int() catches (TypeError, ValueError) but NOT OverflowError.
Passing float('inf') raises: OverflowError: cannot convert float infinity to integer
Fix: add OverflowError to the except clause.

## CI command
  python tests/fuzz/run_fuzz.py

Closes #475
RTC Wallet: RTC2fe3c33c77666ff76a1cd0999fd4466ee81250ff
@github-actions github-actions bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) tests Test suite changes labels Mar 28, 2026
@github-actions
Copy link
Copy Markdown

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Your PR has a BCOS-L1 or BCOS-L2 label
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions bot added the size/XL PR: 500+ lines label Mar 28, 2026
@Scottcjn Scottcjn merged commit cc13d4a into Scottcjn:main Mar 29, 2026
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation size/XL PR: 500+ lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants