Skip to content

[CLAIMS-BUG] CRIT-CLAIMS-1 + MED-CLAIMS-2: Signature bypass when PyNaCl missing + wrong UNIT divisor - #2090

Merged
Scottcjn merged 1 commit into
Scottcjn:mainfrom
ArokyaMatthew:claims-bug/sig-bypass-and-unit-mismatch
Apr 5, 2026
Merged

Scottcjn merged 1 commit into
Scottcjn:mainfrom
ArokyaMatthew:claims-bug/sig-bypass-and-unit-mismatch

Conversation

@ArokyaMatthew

Copy link
Copy Markdown
Contributor

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:

if not HAVE_NACL:
    return True, None  # ACCEPTS ANY SIGNATURE
The comment says "this should return False" but returns True. When PyNaCl isn't installed, any fake signature is accepted — anyone can claim any miner's epoch reward.

Fix: return False, "Ed25519 library not installed"

…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)
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

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 BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/M PR: 51-200 lines labels Apr 5, 2026
@ArokyaMatthew

Copy link
Copy Markdown
Contributor Author

Bug 2: MED-CLAIMS-2 — Wrong UNIT divisor (1e8 vs 1e6)
reward_rtc divides by 100_000_000 but the main server uses 1_000_000. This makes displayed rewards 100x too small.

Fix: Changed all 3 occurrences to / 1_000_000.

Tests Added (NEW: test_claims_security.py)

All tests pass.

Files Changed
node/claims_submission.py — sig bypass fix + UNIT fix
node/test_claims_security.py — NEW (4 tests)
Wallet: aroky-x86-miner

@Scottcjn

Scottcjn commented Apr 5, 2026

Copy link
Copy Markdown
Owner

Two important finds in one PR:

  1. Signature bypass (CRITICAL): validate_claim_signature() returning True when PyNaCl is missing is a fail-open design. Fail-closed is mandatory for auth checks. Good fix.
  2. Unit mismatch (MEDIUM): 1e8 vs 1e6 divisor means claims display 100x too small. Corrected to match the main server's UNIT constant.

Both fixes are correct. Tests cover both vectors.

Payment: 100 RTC (signature bypass is critical severity + unit consistency fix)

Merging.

@Scottcjn
Scottcjn merged commit 7f11166 into Scottcjn:main Apr 5, 2026
3 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) node Node server related size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants