Repository navigation
[UTXO-BUG] Security audit: 4 vulnerabilities found with failing test cases - #2065
dinnar1407-code wants to merge 1 commit into
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! ✅ |
|
Thanks @dinnar1407-code — this is a well-written audit with clear test cases that demonstrate each vulnerability. Good work. However, all four findings overlap with UTXO fixes that were already merged:
Since these were independently discovered and documented with proper failing test cases, we're awarding 25 RTC independent discovery credit. Please provide your RTC wallet address. Closing as duplicate — the fixes are already in main. RTC: 25 (independent discovery) |
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