[SECURITY] Unsigned attestation path grants full mining rewards without wallet ownership proof

Open
#8,178 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 10 days

Nobody has claimed this yet.

  • #8193 by @waterWang — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with rustchain_v2_integrated_v2.2.1_rip200.py at the cited /attest/submit signature check (L5039-5042) and enrollment logic (L5306-5395); trace how verification and reward weight are determined for non-x86 miners. Check the existing attestation tests and run the relevant suite. Done means unsigned submissions cannot enroll with full rewards, while any explicitly supported legacy path remains restricted as intended.

Written by the indexing model from the issue text.

Description

security

Finding

Location: rustchain_v2_integrated_v2.2.1_rip200.py L5039-5042, L5306-5395

Issue: The /attest/submit endpoint accepts unsigned attestations for backward compatibility. When sig_hex and pubkey_hex are empty strings, the signature verification block is entirely skipped (L5039: # still accept *unsigned* attestations via the backward-compat). The attestation proceeds through nonce validation, hardware fingerprint checks, and is stored in miner_attest_recent (L5317). The miner is then auto-enrolled in epoch_enroll with full reward weight (L5392-5395).

For non-x86 miners (ARM, PowerPC, etc.), measurement_report_verified=False (L5366) only affects x86 vintage tier classification via _derive_enroll_weight_device (L2943). Non-x86 miners receive full hardware weight regardless of measurement_report_verified.

Impact: An attacker with valid hardware can submit attestations for ANY wallet address without proving they control that wallet's private key. While rewards go to the specified wallet (not directly stealable), this means:

  1. An attacker can enroll arbitrary wallets in mining without their owners' consent
  2. Mining farms can run unsigned miners at scale, bypassing the enrollment signature gate
  3. The canonical_payload_verified flag (L5366) is not checked for non-x86 reward eligibility

Exploit Steps:

  1. POST /attest/challenge with {"miner_id": "any_wallet_address"} → get nonce
  2. POST /attest/submit with the nonce, empty signature and public_key, and valid hardware fingerprint data
  3. Server stores attestation and auto-enrolls the wallet in current epoch with full reward weight

Fix: Require signature verification for all new attestations. The unsigned backward-compat path should be deprecated or restricted to a whitelist of legacy miners.


Wallet: leanworld7
Severity: MEDIUM
References: bounty #1102

Dominant language
Python
Stars
850
Forks
589
Avg merge
11d 7h
Merged PRs (30d)
29

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Scottcjn/Rustchain

All issues in Scottcjn/Rustchain

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.