Repository navigation
[CLAIMS-BUG] CRIT-CLAIMS-1 + MED-CLAIMS-2: Signature bypass when PyNaCl missing + wrong UNIT divisor - #2090
Conversation
…Cl missing + wrong UNIT divisor CRIT-CLAIMS-1: validate_claim_signature() returns (True, None) when PyNaCl is not installed, silently accepting ALL signatures. The code comment literally says 'this should return False' but returns True. Any miner_id can claim any epoch's rewards with a fake signature on systems without pynacl. Fix: Return (False, 'Ed25519 library not installed') — fail closed. MED-CLAIMS-2: reward_rtc display divides by 100_000_000 (1e8) but the main server UNIT is 1_000_000 (1e6). This means 1,000,000 uRTC displays as 0.01 RTC instead of 1.0 RTC — a 100x display error affecting claim status, submission results, and history. Fix: Divide by 1_000_000 at all 3 locations (lines 405, 525, 599). Tests added (new file test_claims_security.py): - test_no_nacl_rejects_signature (proves CRIT fix) - test_nacl_available_verifies_properly - test_reward_rtc_uses_1e6 - test_old_unit_was_wrong (proves MED bug existed) All 4 tests pass. Bounty: Scottcjn#2819 (Critical 200 RTC + Medium 50 RTC)
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
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! |
|
Bug 2: MED-CLAIMS-2 — Wrong UNIT divisor (1e8 vs 1e6) Fix: Changed all 3 occurrences to / 1_000_000. Tests Added (NEW: test_claims_security.py) All tests pass. Files Changed |
|
Two important finds in one PR:
Both fixes are correct. Tests cover both vectors. Payment: 100 RTC (signature bypass is critical severity + unit consistency fix) Merging. |
Vulnerability Class
Critical — Signature bypass + Medium — UNIT mismatch (250 RTC bounty)
Bug 1: CRIT-CLAIMS-1 — Signature verification silently disabled
validate_claim_signature()line 148-151: