[UTXO-BUG] 3 Critical Security Vulnerabilities in UTXO Layer#2064
Closed
kuanglaodi2-sudo wants to merge 1 commit intoScottcjn:mainfrom
Closed
[UTXO-BUG] 3 Critical Security Vulnerabilities in UTXO Layer#2064kuanglaodi2-sudo wants to merge 1 commit intoScottcjn:mainfrom
kuanglaodi2-sudo wants to merge 1 commit intoScottcjn:mainfrom
Conversation
Failing test cases for: 1. [CRITICAL] Coinbase Conservation Law Bypass (200 RTC) 2. [HIGH] Genesis Migration Non-Idempotency (100 RTC) 3. [MEDIUM] Negative/Zero Value Outputs (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! |
Owner
|
Thanks for the security audit. The three vulnerabilities you identified (negative fees, empty-input bypass, non-atomic rollback) were also found by createkr in PRs #2059, #2060, and #2063, which were submitted first and have been merged. Closing as duplicate. If you found additional vulnerabilities not covered by those three PRs, please open a new PR with a focused fix and we'll review it separately. 25 RTC for independent discovery of the same bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[UTXO-BUG] Security Vulnerabilities Found — Bug Bounty Submission
Severity: Critical / High / Medium
Finding 1 [CRITICAL] — Coinbase Conservation Law Bypass (Bounty: 200 RTC)
File:
node/utxo_db.py, methodapply_transaction()Bug: Conservation check is skipped for coinbase transactions.
Impact: A malicious miner can create unlimited RTC by crafting a coinbase transaction with massive outputs and no inputs. The conservation law is completely bypassed.
Reproduction: See
TestCoinbaseConservationBypassinnode/test_utxo_security.pyFix: Add a maximum coinbase reward check — coinbase outputs must not exceed the block reward schedule.
Finding 2 [HIGH] — Genesis Migration Non-Idempotency / Permanent Stuck State (Bounty: 100 RTC)
File:
node/utxo_genesis_migration.py, methodmigrate()Bug: If migration crashes mid-way through the
BEGIN IMMEDIATEtransaction, re-running it permanently blocks.Impact: If a node crashes after inserting some genesis boxes but before COMMIT, the DB has partial state. Re-running sees existing genesis boxes → permanently aborts. All 4 nodes must have identical state roots — one crashed node blocks the entire migration with no recovery path.
Reproduction: See
TestGenesisMigrationIdempotencyinnode/test_utxo_security.pyFix: Make migration idempotent — check if each individual wallet already has its genesis box before inserting, rather than checking globally.
Finding 3 [MEDIUM] — Negative/Zero Value Output Spam (Bounty: 50 RTC)
File:
node/utxo_db.py, methodapply_transaction()Bug: No validation that
out['value_nrtc'] > 0. Transactions can create zero or negative value boxes.# No check before: output_records.append({... 'value_nrtc': out['value_nrtc'] ...})Impact: Zero-value outputs are economically meaningless but consume DB space and clutter the UTXO set. Negative values are mathematically invalid. Both could cause consensus divergence between nodes.
Reproduction: See
TestNegativeValueOutputsinnode/test_utxo_security.pyFix: Add validation:
if out['value_nrtc'] <= 0: return FalseTest Files
All 3 findings include failing unit tests in
node/test_utxo_security.py.Run:
python -m pytest node/test_utxo_security.py -vAll 3 tests FAIL on the current codebase, demonstrating the bugs exist.
Bounty Total: 200 + 100 + 50 = 350 RTC