[UTXO-BUG] Security audit: 4 vulnerabilities found with failing test cases#2065
Open
dinnar1407-code wants to merge 1 commit intoScottcjn:mainfrom
Open
[UTXO-BUG] Security audit: 4 vulnerabilities found with failing test cases#2065dinnar1407-code wants to merge 1 commit intoScottcjn:mainfrom
dinnar1407-code wants to merge 1 commit intoScottcjn:mainfrom
Conversation
…ilent fund destruction, zero/negative outputs, duplicate inputs
|
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! |
|
Comprehensive security audit! The test cases for the vulnerabilities are well documented. Feedback:
Good work! ✅ |
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 Red Team Security Audit
Submitted for bounty: Scottcjn/rustchain-bounties#2819
Findings
🔴 CRITICAL: No spending_proof validation (200 RTC)
apply_transaction()never validatesspending_proof. Any user can spend any UTXO by passing a fake proof string. This is a fund theft vulnerability — Bob can steal Alice's UTXOs.🟡 MEDIUM: Silent fund destruction (50 RTC)
Conservation check only rejects
output_total + fee > input_totalbut acceptsoutput_total + fee < input_total. The difference silently vanishes instead of being enforced as strict equality or explicit fee.🟢 LOW: Zero/negative output values accepted (25 RTC)
🟢 LOW: Duplicate inputs not rejected upfront (25 RTC)
Same
box_idlisted twice in inputs inflatesinput_total. The second UPDATE fails (defense in depth), but the design should reject duplicates during validation, not rely on DB-level atomicity.Test File
node/test_utxo_bugs.py— 5 failing test cases demonstrating each vulnerability.Suggested Fixes
output_total + fee == input_totalvalue_nrtc <= 0